/* Слайдер карточек специалистов для Tilda — Настройки сайта → Ещё → CSS */

.spec {
  --spec-bg: #b8b0a8;
  --spec-radius: 120px;
  --spec-text: #fff;
  --spec-btn-bg: #fff;
  --spec-btn-text: #2b2b2b;
  --spec-thumb: 60px;
  --spec-ease: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  position: relative;
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 1400 / 780;
  margin: 0 auto;
  border-radius: var(--spec-radius);
  background: var(--spec-bg);
  color: var(--spec-text);
  /* --spec-font-body / --spec-font-heading задаёт specialist-slider.js из .t-name / .t-title */
  font-family: var(--spec-font-body, inherit);
  overflow: hidden;
}

.spec *,
.spec *::before,
.spec *::after {
  box-sizing: border-box;
}

/* Заголовок карточки — шрифт заголовков сайта; остальное — основной текст */
.spec__name {
  font-family: var(--spec-font-heading, var(--spec-font-body, inherit));
}

.spec__line1,
.spec__line2,
.spec__tag,
.spec__price,
.spec__btn,
.spec__btn-arrow {
  font-family: var(--spec-font-body, inherit);
}

.spec__inner {
  position: relative;
  height: 100%;
}

/* —— Фон: фото специалиста на весь блок —— */
.spec__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}

.spec__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity var(--spec-ease);
  user-select: none;
  pointer-events: none;
}

.spec__bg-img.is-active {
  opacity: 1;
}

/* —— Layout: миниатюры слева, текст справа —— */
.spec__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  height: 100%;
}

/* —— Миниатюры (десктоп) —— */
.spec__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 100%;
  padding: 32px 16px 32px 32px;
}

.spec__thumbs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 100%;
  padding: 6px 8px;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
}

.spec__thumbs::-webkit-scrollbar {
  display: none;
}

.spec__thumb {
  flex-shrink: 0;
  width: var(--spec-thumb);
  height: var(--spec-thumb);
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.4;
  transition:
    opacity 0.25s,
    border-color 0.25s,
    transform 0.25s;
}

.spec__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

.spec__thumb:hover {
  opacity: 0.7;
}

.spec__thumb.is-active {
  opacity: 1;
  border-color: #fff;
}

/* —— Сцена: текст карточки —— */
.spec__stage {
  position: relative;
  height: 100%;
}

.spec__panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 56px 40px 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--spec-ease),
    visibility var(--spec-ease);
}

.spec__panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.spec__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 35%;
  max-width: 480px;
}

.spec__name {
  margin: 0 0 18px;
  font-size: clamp(28px, 2.6vw, 42px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.spec__line1,
.spec__line2 {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spec__line1 {
  margin-bottom: 6px;
}

.spec__line2 {
  margin-bottom: 22px;
}

.spec__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.spec__tag {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.spec__price {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.spec__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  background: var(--spec-btn-bg);
  color: var(--spec-btn-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.spec__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.spec__btn-arrow {
  font-size: 14px;
  line-height: 1;
}

/* Мобильный клон миниатюр по умолчанию скрыт; показывается ниже 450px */
.spec__thumbs-mobile {
  display: none;
}

/* —— Планшет 550 < w ≤ 975: десктоп с уменьшением —— */
@media (max-width: 975px) {
  .spec {
    --spec-radius: clamp(48px, 12vw, 120px);
  }

  .spec__nav {
    padding: 20px 12px 20px 20px;
  }

  .spec__panel {
    padding: 24px 32px 24px 16px;
  }

  .spec__body {
    width: 50%;
  }
}

/* —— Мобильный (≤ 550px) —— */
@media (max-width: 550px) {
  .spec {
    --spec-radius: 0;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 0;
    margin: 0;
  }

  /* Десктопные миниатюры внутри .spec — скрываем, их клон живёт снаружи */
  .spec .spec__nav {
    display: none;
  }

  /* Текст карточки — снизу поверх фото с градиентной подложкой */
  .spec__layout {
    grid-template-columns: 1fr;
  }

  .spec__panel {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0;
  }

  .spec__body {
    width: 100%;
    max-width: none;
    padding: 32px 24px 28px;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.25) 60%,
      rgba(0, 0, 0, 0) 100%
    );
  }

  .spec__name {
    font-size: 28px;
    margin-bottom: 14px;
  }

  .spec__line2 {
    margin-bottom: 18px;
  }

  .spec__tags {
    margin-bottom: 22px;
  }

  /* Мобильный клон — статичная горизонтальная полоса под блоком, ВНЕ .spec.
     Ширина = ширине .spec (оба 100%); иконки центрируются по горизонтали. */
  .spec__thumbs-mobile {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 0 0;
    margin: 0;
    overflow: visible;
  }

  .spec__thumbs-mobile .spec__thumb {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spec__panel,
  .spec__bg-img {
    transition: none;
  }
}
