/* ===== О тренере — тёмный блок (Figma nodes 77:5 + 53:5) ===== */
.trener-wrap {
  background: var(--bg-cream);
  padding: 0 8px;
}

.trener {
  width: 100%;
  background: var(--wine-mesh-bg);
  border-radius: 24px;
  padding: 100px 0;
  display: flex;
  justify-content: center;
}

.trener__container {
  width: 100%;
  max-width: 1180px;
  padding: 0 24px;
}

.trener__row {
  display: flex;
  gap: 4px;
  align-items: stretch;
}

/* --- большая карточка: шире остальных, фигура выходит за верхний край рамки --- */
.trener-photo-card {
  position: relative;
  flex: 2;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* сама рамка — отдельным слоем, чтобы фото могло выходить за неё */
.trener-photo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: #2B0B15;
}

/* фото не обрезается рамкой: приподнято над её верхним краем.
   фон у картинки прозрачный, поэтому видна только фигура */
/* фигура крупнее и по центру карточки */
.trener-photo-card__img {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  height: 108%;
  width: auto;
  max-width: none;
  z-index: 1;
  filter: drop-shadow(0 18px 40px rgba(20, 6, 11, 0.45));
}

/* подложка под подписи — только внутри рамки */
.trener-photo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(to top, rgba(20, 6, 11, 0.92) 0%, rgba(20, 6, 11, 0.35) 30%, rgba(20, 6, 11, 0) 55%);
  pointer-events: none;
  z-index: 2;
}

.trener-photo-card__top,
.trener-photo-card__bottom {
  position: relative;
  z-index: 3;
  padding: 0 28px;
}

.trener-photo-card__top {
  padding-top: 28px;
}

.trener-photo-card__bottom {
  padding-bottom: 28px;
}

.trener-photo-card__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.trener-photo-card__meta {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

/* низ карточки: телеграм слева, цитата справа */
.trener-photo-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.trener-photo-card__tg {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  transition: opacity var(--transition-fast);
}

.trener-photo-card__tg:hover {
  opacity: 0.75;
}

.trener-photo-card__tg-arrow {
  font-size: 12px;
  opacity: 0.6;
  transition: transform var(--transition-fast);
}

.trener-photo-card__tg:hover .trener-photo-card__tg-arrow {
  transform: translate(2px, -2px);
}

.trener-photo-card__quote {
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  max-width: 420px;
  text-align: right;
}

/* --- средняя колонка: опыт + отзывы --- */
.trener-mid {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.trener-mid__exp-label {
  font-size: 13px;
  font-weight: 500;
  color: #8A7A7E;
}

.trener-mid__exp-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--bordeaux-dark);
  line-height: 1.2;
  margin-top: 4px;
}

.trener-quote {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* первый отзыв отталкивается вниз, чтобы оба стояли у нижнего края */
.trener-quote:first-of-type {
  margin-top: auto;
}

.trener-quote__text {
  font-size: 14px;
  font-weight: 400;
  color: #5E5054;
  line-height: 1.5;
}

.trener-quote__author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bordeaux-dark);
}

.trener-quote__author img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- правая колонка: два маленьких карточки --- */
.trener-side {
  flex: 0.85;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trener-side__card {
  background: var(--white);
  border-radius: 24px;
  padding: 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trener-side__card--ring {
  align-items: center;
  text-align: center;
  gap: 4px;
}

.trener-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.trener-ring span {
  font-size: 26px;
  font-weight: 700;
  color: var(--bordeaux-dark);
}

.trener-side__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--bordeaux-dark);
}

.trener-side__desc {
  font-size: 13px;
  font-weight: 400;
  color: #8A7A7E;
  line-height: 1.4;
  margin-top: 4px;
}

.trener-side__num-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.trener-side__num {
  font-size: 40px;
  font-weight: 700;
  color: var(--bordeaux-dark);
  line-height: 1;
  letter-spacing: -0.02em;
}

.trener-side__num-cap {
  font-size: 12px;
  font-weight: 500;
  color: #8A7A7E;
  line-height: 1.25;
}

.trener-side__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trener-tag {
  background: var(--blush-light);
  border-radius: 100px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bordeaux-dark);
  white-space: nowrap;
  transition: transform var(--transition-hover), background var(--transition-hover);
}

.trener-tag:hover {
  transform: translateY(-2px);
  background: var(--blush);
}

/* --- цифры под карточками --- */
.trener-stats {
  display: flex;
  gap: 24px;
  margin-top: 56px;
}

.trener-stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trener-stat__num {
  font-size: 56px;
  font-weight: 700;
  color: #FCE2E8;
  line-height: 1;
  letter-spacing: -0.02em;
}

.trener-stat__cap {
  font-size: 13px;
  font-weight: 500;
  color: rgba(252, 226, 232, 0.7);
  line-height: 1.4;
}

/* --- мой подход --- */
.trener-approach {
  display: flex;
  gap: 48px;
  margin-top: 40px;
}

.trener-approach__left {
  width: 260px;
  flex-shrink: 0;
}

.trener-approach__logo {
  font-size: 15px;
  font-weight: 600;
  color: #FCE2E8;
  letter-spacing: 0.02em;
}

.trener-approach__note {
  font-size: 13px;
  font-weight: 500;
  color: rgba(252, 226, 232, 0.7);
  line-height: 1.45;
  margin-top: 10px;
}

.trener-approach__title {
  font-size: 22px;
  font-weight: 600;
  color: #FCE2E8;
  line-height: 1.3;
}

.trener-approach__desc {
  font-size: 14px;
  font-weight: 400;
  color: rgba(252, 226, 232, 0.65);
  line-height: 1.55;
  margin-top: 10px;
  max-width: 620px;
}

/* ===== Дипломы и сертификаты — компактный список внутри блока о тренере ===== */
.certs {
  margin-top: 48px;
}

.certs__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.certs__title {
  font-size: 22px;
  font-weight: 600;
  color: #FCE2E8;
}

.certs__count {
  font-size: 13px;
  font-weight: 500;
  color: rgba(252, 226, 232, 0.6);
}

/* документов стало восемь — в одну строку они сжимаются до нечитаемых
   колонок, поэтому раскладываем сеткой по четыре */
/* документы показываем компактными плашками: название в одну строку
   и стрелка, подробности открываются в поп-апе */
.certs__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cert-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid rgba(252, 226, 232, 0.28);
  border-radius: 100px;
  background: rgba(252, 226, 232, 0.07);
  color: #FCE2E8;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.cert-item:hover {
  background: rgba(252, 226, 232, 0.16);
  border-color: rgba(252, 226, 232, 0.5);
  transform: translateY(-2px);
}

.cert-item__name {
  white-space: nowrap;
}

/* организация и подпись «смотреть» в компактном виде не нужны:
   их место — в поп-апе, здесь они только ломали строку */
.cert-item__org {
  display: none;
}

.cert-item__look {
  font-size: 11px;
  opacity: 0.6;
}

.cert-item__look span {
  display: none;
}

.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 6, 11, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  animation: certFade 0.25s ease;
}

.cert-modal[hidden] {
  display: none;
}

@keyframes certFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cert-modal__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.cert-modal__close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.cert-modal__close:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* карточки сертификатов выезжают по очереди */
.certs.is-visible .cert-item {
  animation: certIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.certs.is-visible .cert-item:nth-child(1) { animation-delay: 0.05s; }
.certs.is-visible .cert-item:nth-child(2) { animation-delay: 0.14s; }
.certs.is-visible .cert-item:nth-child(3) { animation-delay: 0.23s; }
.certs.is-visible .cert-item:nth-child(4) { animation-delay: 0.32s; }

@keyframes certIn {
  from { opacity: 0; transform: translateY(26px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* цифры о тренере подъезжают снизу */
.trener-stats.is-visible .trener-stat {
  animation: statIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.trener-stats.is-visible .trener-stat:nth-child(1) { animation-delay: 0.05s; }
.trener-stats.is-visible .trener-stat:nth-child(2) { animation-delay: 0.15s; }
.trener-stats.is-visible .trener-stat:nth-child(3) { animation-delay: 0.25s; }
.trener-stats.is-visible .trener-stat:nth-child(4) { animation-delay: 0.35s; }

@keyframes statIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* шапка блока — как во всех секциях */
.trener__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.trener__title {
  font-size: 84px;
  font-weight: 600;
  line-height: 1.05;
  color: #FCE2E8;
}

.trener__lead {
  font-size: 22px;
  font-weight: 600;
  color: #FCE2E8;
  line-height: 1.35;
  max-width: 780px;
  margin-top: 4px;
}

.trener__sub {
  font-size: 15px;
  font-weight: 500;
  color: rgba(252, 226, 232, 0.7);
}

/* ===== Адаптив ===== */
@media (max-width: 1439px) {
  .trener__title { font-size: clamp(48px, 6vw, 84px); }
  .trener-stat__num { font-size: clamp(38px, 4.2vw, 56px); }
}

@media (max-width: 1279px) {
  /* шапка блока: на узком экране она уже разнесена по строкам,
     поэтому отступ до контента короче десктопного */
  .trener__head { margin-bottom: 28px; }
  .trener { padding: 64px 0; }
  .trener__row { flex-wrap: wrap; }
  .trener-photo-card { flex: 1 1 100%; min-height: 460px; }
  /* карточка стала во всю ширину — цитата уходит под ссылку, а не ложится
     поверх фигуры, и подложка снизу плотнее, чтобы текст читался */
  .trener-photo-card__bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .trener-photo-card__quote { text-align: left; max-width: 560px; }
  .trener-photo-card::after {
    background: linear-gradient(to top, rgba(20, 6, 11, 0.95) 0%, rgba(20, 6, 11, 0.6) 32%, rgba(20, 6, 11, 0) 62%);
  }
  .trener-mid { flex: 1 1 calc(60% - 2px); min-width: 280px; }
  .trener-side { flex: 1 1 calc(40% - 2px); min-width: 240px; }
  .trener-stats { flex-wrap: wrap; gap: 28px 24px; }
  .trener-stat { flex: 1 1 calc(50% - 12px); }
  .cert-item { font-size: 12px; padding: 10px 14px; }
  .cert-item__name { white-space: normal; }
}

@media (max-width: 767px) {
  .trener__head { margin-bottom: 20px; }
  .trener-wrap { padding: 0 4px; }
  .trener { padding: 48px 0; border-radius: 20px; }
  .trener__container { padding: 0 16px; }
  .trener__title { font-size: clamp(30px, 9vw, 40px); }
  .trener__lead { font-size: 18px; }
  .trener__row { flex-direction: column; }
  .trener-photo-card,
  .trener-mid,
  .trener-side { flex: none; width: 100%; }
  .trener-photo-card { min-height: 400px; }
  .trener-photo-card__bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
  .trener-photo-card__quote { text-align: left; font-size: 15px; }
  /* цифры в две колонки, как на fabrica: крупное число, под ним подпись */
  .trener-stats { gap: 28px 16px; }
  .trener-stat { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .trener-stat__num { font-size: 38px; }
  .trener-stat__cap { font-size: 13px; line-height: 1.35; }
  .certs__head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cert-item { flex: none; width: 100%; }
  .cert-modal { padding: 20px; }
}

/* ===== Оживляем блок «обо мне» =====
   Кольцо с цифрой прочерчивается, теги влетают по очереди. */
.trener-ring {
  position: relative;
}

.trener-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 4px solid var(--bordeaux-accent);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s cubic-bezier(0.44, 0, 0.56, 1);
}

.trener-side__card--ring.is-visible .trener-ring::before,
.trener-side.is-visible .trener-ring::before {
  clip-path: inset(0 0 0 0);
}

.trener-ring span {
  display: inline-block;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.5);
  opacity: 0;
}

.trener-side.is-visible .trener-ring span {
  transform: scale(1);
  opacity: 1;
  transition-delay: 0.35s;
}

/* теги-специализации появляются волной */
.trener-tag {
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              background var(--transition-hover);
}

.trener-side.is-visible .trener-tag {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.trener-side.is-visible .trener-tag:nth-child(1) { transition-delay: 0.30s; }
.trener-side.is-visible .trener-tag:nth-child(2) { transition-delay: 0.38s; }
.trener-side.is-visible .trener-tag:nth-child(3) { transition-delay: 0.46s; }
.trener-side.is-visible .trener-tag:nth-child(4) { transition-delay: 0.54s; }
.trener-side.is-visible .trener-tag:nth-child(5) { transition-delay: 0.62s; }
.trener-side.is-visible .trener-tag:nth-child(6) { transition-delay: 0.70s; }

/* число «150+» подъезжает вместе с подписью */
.trener-side__num {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.trener-side.is-visible .trener-side__num {
  opacity: 1;
  transform: translateY(0);
}

/* документы проявляются по очереди */
.cert-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.5s ease,
              background var(--transition-fast), border-color var(--transition-fast);
}

.certs.is-visible .cert-item {
  opacity: 1;
  transform: translateY(0);
}

.certs.is-visible .cert-item:nth-child(1) { transition-delay: 0.05s; }
.certs.is-visible .cert-item:nth-child(2) { transition-delay: 0.11s; }
.certs.is-visible .cert-item:nth-child(3) { transition-delay: 0.17s; }
.certs.is-visible .cert-item:nth-child(4) { transition-delay: 0.23s; }
.certs.is-visible .cert-item:nth-child(5) { transition-delay: 0.29s; }
.certs.is-visible .cert-item:nth-child(6) { transition-delay: 0.35s; }
.certs.is-visible .cert-item:nth-child(7) { transition-delay: 0.41s; }
.certs.is-visible .cert-item:nth-child(8) { transition-delay: 0.47s; }

@media (prefers-reduced-motion: reduce) {
  .trener-ring::before,
  .trener-ring span,
  .trener-tag,
  .trener-side__num,
  .cert-item { transition: none; opacity: 1; transform: none; clip-path: none; }
}
