/* ===== v3 EXPERTS — founder hero + filter chips + masonry grid =====
   Экран 7b ТЗ: «Алина и эксперты — пространство создают люди».
   Дизайн собран по AI-моку A (founder hero + filter + grid) + плавающие
   шильдики из мока D (7 направлений, новые в сезоне, врачи). */

.experts {
  padding-top: clamp(61px, 9vh, 110px);
  padding-bottom: clamp(61px, 9vh, 110px);
  position: relative;
}


/* ============== FOUNDER HERO ============== */

.experts__hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(27px, 5vw, 68px);
  align-items: center;
  margin-bottom: clamp(48px, 7vh, 82px);
  position: relative;
}

.experts__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
}

.experts__title {
  font-size: clamp(37px, 5.6vw, 71px);
  line-height: 1.0;
  margin: 4px 0 0;
}

.experts__lead {
  max-width: 408px;
  margin: 2px 0 5px;
}

/* Pill-бейдж под lead'ом — прозрачный фон + gradient-border.
   Double-background trick (равномерная толщина по всему периметру pill-радиуса). */
/* Pill-бейдж под lead'ом — прозрачный фон + gradient-border.
   Используем mask-trick (как в shared.css .chip): ::before рисует gradient
   по всему элементу, маска оставляет видимой только padding-зону (1.5px). */
.ex-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 19px;
  background: transparent;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.ex-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--grad);
  -webkit-mask:
    linear-gradient(#000, #000) content-box,
    linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
          mask:
    linear-gradient(#000, #000) content-box,
    linear-gradient(#000, #000);
          mask-composite: exclude;
  pointer-events: none;
}
.ex-badge svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  position: relative; /* над ::before */
}
.ex-badge > * { position: relative; }

/* MEDIA (правая часть hero): фото Алины + floating widgets */
.experts__media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 391px;
}

/* Обёртка вокруг фото — нужна, чтобы плашки позиционировались
   относительно фото, а не media-колонки, и не наследовали rotate. */
.ex-founder-wrap {
  position: relative;
  display: inline-block;
  width: clamp(221px, 30vw, 323px);
  aspect-ratio: 3 / 4;
}

.ex-founder {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 4px;
  background: var(--grad);
  border-radius: var(--radius-lg);
  transform: rotate(1.2deg);
  box-shadow:
    0 32px 68px -24px rgba(233, 74, 161, 0.42),
    0 15px 34px -17px rgba(28, 34, 54, 0.18);
}
.ex-founder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 5px);
  display: block;
}

/* ============== FLOATING WIDGETS ============== */

.ex-fw {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 17px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow:
    0 19px 42px -20px rgba(28, 34, 54, 0.22),
    0 5px 12px -7px rgba(28, 34, 54, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5;
}

.ex-fw__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ex-fw__icon svg {
  width: 15px;
  height: 15px;
}
.ex-fw__icon--orange { background: rgba(255, 122, 69, 0.14); color: var(--g1); }
.ex-fw__icon--pink   { background: rgba(233, 74, 161, 0.14); color: var(--g2); }
.ex-fw__icon--purple { background: rgba(155, 95, 223, 0.14); color: var(--g3); }

.ex-fw__lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}
.ex-fw__lines strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ex-fw__lines em {
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
}
/* Gradient-text caption внутри ex-fw (используется в pill «эксперты» рядом с avatars). */
.ex-fw__caption {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Mini-avatar row внутри виджета */
.ex-fw__avatars {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
.ex-fw__avatars span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background-color: #f3e7d8;
  background-size: cover;
  background-position: center;
  margin-left: -8px;
  box-shadow: 0 4px 8px -4px rgba(28, 34, 54, 0.18);
}
.ex-fw__avatars span:first-child { margin-left: 0; }

.ex-fw__avatars--tiny span {
  width: 20px;
  height: 20px;
  margin-left: -7px;
}

.ex-fw__more {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: #fff !important;
  background-image: none !important;
}

/* Размещение виджетов относительно .ex-founder-wrap.
   directions — внахлёст правого верхнего угла фото.
   count — в районе левого нижнего угла, выезжает за левый край. */
.ex-fw--directions {
  top: -4%;
  right: -16%;
  transform: rotate(2.5deg);
}

.ex-fw--count {
  left: -10%;
  bottom: 12%;
  padding: 14px 19px;
  transform: rotate(-2deg);
}

/* «новые в сезоне» и «5 врачей» — не absolute, размещаются inline в .ex-meta-row
   между filter strip и grid, чтобы не перекрывать карточки экспертов. */
.ex-fw--new,
.ex-fw--doctors {
  position: relative;
}
.ex-fw--new    { transform: rotate(-1deg); }
.ex-fw--doctors { transform: rotate(1deg); }

.ex-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(17px, 2.6vh, 27px);
  padding: 0 4px;
  position: relative;
  z-index: 2;
}

/* ============== FILTER STRIP ============== */

.ex-filters {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 7px;
  margin: 0 auto clamp(27px, 4vh, 41px);
  position: relative;
  z-index: 2;
  /* На узких экранах разрешаем горизонтальный скролл, не перенос строк. */
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}
.ex-filters::-webkit-scrollbar { display: none; }

.ex-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, color .2s ease;
  box-shadow: 0 7px 15px -12px rgba(28, 34, 54, 0.16);
}
.ex-chip:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: 0 12px 22px -14px rgba(28, 34, 54, 0.22);
}
.ex-chip.is-active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 26px -12px rgba(233, 74, 161, 0.5);
}
.ex-chip.is-active .ex-dot { display: none; } /* в active gradient — точку прячем */

/* Цветная точка-bullet */
.ex-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.ex-dot--orange { background: var(--g1); }
.ex-dot--pink   { background: var(--g2); }
.ex-dot--purple { background: var(--g3); }

/* ============== EXPERTS GRID ============== */

.ex-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.6vw, 19px);
  position: relative;
  z-index: 1;
}

.ex-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 12px 27px -17px rgba(28, 34, 54, 0.18);
  transition: transform .25s ease, box-shadow .25s ease, opacity .3s ease, border-color .25s ease;
}
.ex-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 37px -19px rgba(28, 34, 54, 0.26);
}

.ex-card.is-dim {
  opacity: 0.32;
  filter: saturate(0.7);
  pointer-events: none;
}

/* Featured — gradient border, как у активной карточки в кабинете */
.ex-card--featured {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--grad) border-box;
  border: 2px solid transparent;
  box-shadow:
    0 22px 48px -20px rgba(233, 74, 161, 0.32),
    0 8px 19px -8px rgba(28, 34, 54, 0.10);
}

.ex-card__photo {
  position: relative;
  width: 61px;
  height: 61px;
  flex-shrink: 0;
  padding: 2px;
  background: var(--grad);
  border-radius: 50%;
}
.ex-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  background: #f3e7d8;
}

.ex-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0; /* для корректного wrap длинных имён */
}

.ex-card__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.ex-card__role {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0;
  /* Обрезаем до двух строк (страховка), но min-height не ставим —
     если описание укладывается в одну строку, не оставляем пустую
     полосу снизу. Карточки выравниваются по photo (align-items: center). */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tag-chip внутри карточки */
.ex-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 122, 69, 0.12);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--g1);
  margin-top: 2px;
  align-self: flex-start;
}
.ex-tag--pink   { background: rgba(233, 74, 161, 0.10); color: var(--g2); }
.ex-tag--purple { background: rgba(155, 95, 223, 0.12); color: var(--g3); }
.ex-tag--orange { background: rgba(255, 122, 69, 0.12); color: var(--g1); }
.ex-tag .ex-dot { width: 5px; height: 5px; }

/* ============== «ПОСМОТРЕТЬ ВСЕХ» — кнопка раскрытия грида ==============
   На десктопе кнопка скрыта (все карточки видны сразу). На мобильном
   видны только первые 4 (помечены без .is-extra), кнопка появляется. */

.ex-show-all {
  display: none; /* по умолчанию скрыта; включается в @media */
  margin: 19px auto 0;
  padding: 10px 19px;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 8px 20px -14px rgba(28, 34, 54, 0.2);
  transition: transform .2s ease, box-shadow .25s ease;
}
.ex-show-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -14px rgba(28, 34, 54, 0.28);
}
.ex-show-all__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 19px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.ex-show-all__count[hidden] { display: none; }

/* ============== RESPONSIVE ============== */

@media (max-width: 935px) {
  .experts__hero {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  /* Алина: увеличиваем фрейм на мобиле — раньше фото обрезалось
     по верху из-за маленькой ширины (221-323px) и aspect-ratio 3:4. */
  .experts__media { min-height: 0; justify-self: center; }
  .ex-founder-wrap {
    width: min(84vw, 380px);
  }
  .ex-fw--directions { right: 2%; top: 7px; }

  .ex-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 697px) {
  .ex-grid { grid-template-columns: repeat(2, 1fr); }
  .ex-fw--count {
    right: auto;
    left: 50%;
    transform: translateX(-50%) rotate(0);
    top: auto;
    bottom: -24px;
  }
  .ex-fw--directions { display: none; }
  /* На мобиле прячем плашки «новые в сезоне» и «5 врачей» — много инфы. */
  .ex-fw--new, .ex-fw--doctors { display: none; }
  .ex-meta-row { display: none; }

  /* Показываем только первые 4 карточки + кнопку раскрытия. */
  .ex-grid > .ex-card.is-extra { display: none; }
  .experts.is-expanded .ex-grid > .ex-card.is-extra { display: flex; }
  .ex-show-all { display: inline-flex; }
}

@media (max-width: 442px) {
  .ex-grid { grid-template-columns: 1fr; }
  .experts__title { font-size: 31px; }
}
