/* ===========================
   DOCTORS — БАЗОВАЯ СТРАНИЦА
   =========================== */

.doctors-page {
  background-color: #f4f4f4;
  padding: 60px 0 80px;
}

/* Заголовок страницы */

.doctors-header {
  margin-bottom: 32px;
}

.doctors-title {
  font-size: 32px;
  font-weight: 700;
  color: #1d2e45;
  margin-bottom: 8px;
}

.doctors-subtitle {
  font-size: 16px;
  color: #6c7a89;
  max-width: 640px;
}

/* Фильтры */

.doctors-filters {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.doctors-filters__form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
}

.doctors-filters__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doctors-filters__group--inline {
  flex-direction: column;
}

.doctors-filters__group--search {
  margin-left: auto;
  min-width: 240px;
}

.doctors-filters__label {
  font-size: 13px;
  font-weight: 500;
  color: #2c3e50;
}

.doctors-filters__select,
.doctors-filters__search {
  border-radius: 999px;
  border: 1px solid #d0d7e2;
  padding: 8px 16px;
  font-size: 14px;
  outline: none;
  min-width: 200px;
}

.doctors-filters__select:focus,
.doctors-filters__search:focus {
  border-color: #3498db;
}

/* Чипы формата приёма */

.doctors-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border-radius: 999px;
  border: 1px solid #d0d7e2;
  background-color: #fff;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chip--active,
.chip:hover {
  background-color: #3498db;
  border-color: #3498db;
  color: #fff;
}

/* visually hidden для label поиска */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Список и карточка врача */

.doctors-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doctors-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  background-color: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.doctors-card__photo img {
  width: 100%;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
}

.doctors-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doctors-card__header {
  margin-bottom: 4px;
}

.doctors-card__name {
  font-size: 20px;
  font-weight: 700;
  color: #1d2e45;
  margin-bottom: 4px;
}

.doctors-card__name a {
  color: inherit;
  text-decoration: none;
}

.doctors-card__name a:hover {
  text-decoration: underline;
}

.doctors-card__speciality {
  font-size: 14px;
  color: #3498db;
}

.doctors-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 13px;
  color: #6c7a89;
}

.doctors-card__meta-item dt {
  font-weight: 600;
  margin-right: 4px;
}

.doctors-card__meta-item dd {
  display: inline;
  margin: 0;
}

.doctors-card__description {
  font-size: 14px;
  color: #2c3e50;
  line-height: 1.5;
  max-width: 640px;
}

.doctors-card__actions {
  margin-top: 8px;
}

.doctors-card__details {
  display: inline-block;
  font-size: 14px;
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.doctors-card__details:hover {
  text-decoration: underline;
}

.doctors-card__clinic {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #6c7a89;
  align-items: baseline;
}

.doctors-card__clinic-name {
  font-weight: 600;
  color: #2c3e50;
}

.doctors-card__clinic-address {
  opacity: 0.9;
}


/* Адаптив под планшет / мобилки */

@media (max-width: 1024px) {
  .doctors-filters__group--search {
    margin-left: 0;
  }

  .doctors-card {
    grid-template-columns: 100px 1fr;
  }
}

@media (max-width: 768px) {
  .doctors-page {
    padding: 40px 0 60px;
  }

  .doctors-card {
    grid-template-columns: 1fr;
  }

  .doctors-card__photo img {
    width: 96px;
    height: 96px;
  }
}

/* На мобильном можно стянуть в столбик */
@media (max-width: 768px) {
  .doctors-card__clinic {
    flex-direction: column;
  }
}

/* =========================
   Попап с картой врача
   ========================= */

.doctor-map-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.doctor-map-modal.is-open {
    display: flex;
}

.doctor-map-modal__overlay {
    position: absolute;
    inset: 0;
}

.doctor-map-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 24px 24px 16px;
    /* шире и адаптивнее */
    width: min(90vw, 1200px);   /* до 1200px, но не больше 90% экрана */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    z-index: 1001;
}

.doctor-map-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.doctor-map-modal__header {
    margin-bottom: 16px;
}

.doctor-map-modal__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.doctor-map-modal__address {
    font-size: 14px;
    color: #666;
}

.doctor-map-modal__body {
    /* больше не тянем блок, просто держим отступы */
    margin-top: 8px;
}

.doctor-map-modal__body iframe {
    display: block;
    width: 100%;
    height: 420px;       /* явная высота карты на десктопе */
    border: 0;
    border-radius: 16px;
}

/* Адаптив — ниже высота карты поменьше */
@media (max-width: 768px) {
    .doctor-map-modal__body iframe {
        height: 260px;
    }
}

/* Адаптив */
@media (max-width: 768px) {
    .doctor-map-modal__dialog {
        margin: 0 16px;
        padding: 16px 16px 12px;
        border-radius: 16px;
        width: calc(100% - 32px); /* почти на всю ширину экрана */
    }

    .doctor-map-modal__body {
        min-height: 260px;
    }
}

.doctors-filters__map-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.doctors-filters__map-link:hover {
  text-decoration: none;
}

/* ============================
   Страница конкретного врача
   ============================ */

.doctors-page--show {
    background-color: #f4f4f4;
    padding: 60px 0 80px;
}

/* ---------- HERO врача ---------- */

.doctor-hero {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.doctor-hero__left {
    flex: 0 0 220px;
}

.doctor-hero__photo {
    width: 220px;
    height: 260px;
    border-radius: 24px;
    overflow: hidden;
    background-color: #e8eef7;
}

.doctor-hero__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.doctor-hero__right {
    flex: 1 1 auto;
}

.doctor-hero__name {
    font-size: 26px;
    line-height: 1.3;
    font-weight: 700;
    color: #1d2e45;
    margin-bottom: 4px;
}

.doctor-hero__speciality {
    font-size: 16px;
    font-weight: 500;
    color: #3498db;
    margin-bottom: 8px;
}

.doctor-hero__short {
    font-size: 14px;
    line-height: 1.5;
    color: #4f5d6f;
    margin-bottom: 16px;
}

/* мета-блок: город, формат, стаж */

.doctor-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0 0 12px;
    padding: 0;
}

.doctor-hero__meta-item {
    min-width: 140px;
}

.doctor-hero__meta-item dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a96a8;
    margin-bottom: 2px;
}

.doctor-hero__meta-item dd {
    margin: 0;
    font-size: 14px;
    color: #1d2e45;
    font-weight: 500;
}

/* теги направлений */

.doctor-hero__tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doctor-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: #f0f4ff;
    color: #1d2e45;
    font-size: 13px;
    font-weight: 500;
}

/* ---------- Места приёма ---------- */

.doctor-locations {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.doctor-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d2e45;
    margin-bottom: 16px;
}

.doctor-locations__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doctor-locations__item {
    padding: 12px 0;
    border-top: 1px solid #edf1f7;
}

.doctor-locations__item:first-child {
    border-top: none;
}

.doctor-locations__name {
    font-size: 14px;
    font-weight: 600;
    color: #1d2e45;
    margin-bottom: 4px;
}

/* кнопка-адрес (открывает карту) */

.doctor-locations__address {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 14px;
    color: #3498db;
    cursor: pointer;
    text-align: left;
}

.doctor-locations__address:hover {
    text-decoration: underline;
}

/* ---------- Общие секции (О враче, опыт, образование) ---------- */

.doctor-section {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.doctor-section__title {
    font-size: 20px;
    font-weight: 600;
    color: #1d2e45;
    margin-bottom: 16px;
}

.doctor-section__body {
    font-size: 14px;
    line-height: 1.6;
    color: #4f5d6f;
}

/* две колонки: образование / курсы */

.doctor-section__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.doctor-section__subtitle {
    font-size: 15px;
    font-weight: 600;
    color: #1d2e45;
    margin-bottom: 8px;
}

/* pre-тексты из БД — делаем аккуратным форматированием */

.doctor-section__pre {
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #4f5d6f;
}

/* ---------- Документы врача ---------- */

.doctor-documents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.doctor-document {
    margin: 0;
}

.doctor-document__image {
    border-radius: 12px;
    overflow: hidden;
    background-color: #eef2f7;
    border: 1px solid #edf1f7;
}

.doctor-document__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.doctor-document__caption {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #4f5d6f;
}

/* ---------- Попап с картой ---------- */

.doctor-map-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

/* скрыт по умолчанию через aria-hidden="true" */

.doctor-map-modal[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
}

.doctor-map-modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.doctor-map-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.doctor-map-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 100% - 32px);
    max-height: 80vh;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doctor-map-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.doctor-map-modal__header {
    padding: 16px 20px 8px 20px;
}

.doctor-map-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2e45;
    margin-bottom: 4px;
}

.doctor-map-modal__address {
    font-size: 14px;
    color: #4f5d6f;
    margin: 0 40px 0 0;
}

.doctor-map-modal__body {
    flex: 1 1 auto;
    padding: 0 20px 20px 20px;
}

.doctor-map-modal__body iframe {
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

/* ---------- Адаптив для карточки врача ---------- */

@media (max-width: 900px) {
    .doctor-hero {
        flex-direction: column;
    }

    .doctor-hero__left {
        flex: 0 0 auto;
    }

    .doctor-hero__photo {
        width: 180px;
        height: 220px;
    }

    .doctor-section__columns {
        grid-template-columns: 1fr;
    }

    .doctor-map-modal__dialog {
        width: calc(100% - 16px);
        max-height: 85vh;
    }
}

@media (max-width: 600px) {
    .doctors-page--show {
        padding: 40px 0 60px;
    }

    .doctor-hero {
        padding: 20px;
        border-radius: 16px;
    }

    .doctor-locations,
    .doctor-section {
        padding: 20px;
        border-radius: 16px;
    }
}