/* ════════════════════════════════════════════════════
   Cases — «С чем работаю»
   Eyebrow · h2 · lead · табы · 3 панели с сетками карточек
   Tokens: design-system/colors_and_type.css
   ════════════════════════════════════════════════════ */

.cases {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  padding: 72px 0;
  color: var(--text-dark);
}
.cases__container {
  max-width: var(--container, 1240px);
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Header (центрированный — стиль «Аккредитаций») ─── */
.cases__eyebrow {
  font: 500 13px/1.3 var(--font-body);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.cases__eyebrow::before,
.cases__eyebrow::after {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.cases__h2 {
  font: 500 clamp(30px, 3.4vw, 44px)/1.2 var(--font-serif);
  letter-spacing: -0.4px;
  color: var(--text-dark);
  margin: 0 auto 16px;
  max-width: 920px;
  text-align: center;
  text-wrap: pretty;
}
.cases__h2 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

.cases__lead {
  font: 400 italic clamp(17px, 1.4vw, 20px)/1.55 var(--font-serif);
  color: rgba(60, 50, 40, 0.85); /* единый вид с .cases-bridge__lead */
  margin: 0 auto;
  max-width: 640px;
  text-align: center;
  text-wrap: pretty;
}

/* ─── Табы ─── */
.cases-tabs {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin: 40px 0 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.cases-tab {
  background: transparent;
  border: 0;
  padding: 16px 4px;
  position: relative;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease-out, ease-out);
}

.cases-tab:hover {
  color: var(--text-dark);
}

.cases-tab.is-active {
  color: var(--accent);
}

.cases-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -17px;
  height: 3px;
  background: var(--accent);
}

.cases-tab__count {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  vertical-align: middle;
}

.cases-tab.is-active .cases-tab__count {
  color: var(--accent);
}

/* ─── Панели + сетка ─── */
.cases-panels {
  /* desktop: переключение через .is-active. Mobile (см. адаптив) — flex со scroll-snap. */
}
.cases-panel {
  display: none;
}
.cases-panel.is-active {
  display: block;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ─── Карточка ─── */
.case-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s var(--ease-out, ease-out),
              transform 0.2s var(--ease-out, ease-out);
}

.case-card__num {
  position: absolute;
  top: 24px;
  right: 28px;
  font-family: var(--font-num, var(--font-number, var(--font-body)));
  font-weight: 900;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.5px;
  line-height: 1;
}

/* Тёмный тик над заголовком: перекличка с карточками карусели */
.case-card__title::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark, #2A2520);
  margin-bottom: 14px;
}

.case-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.case-card__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-dark);
  margin: 0 36px 16px 0;
  text-wrap: pretty;
}
.case-card__title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.case-card__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  text-wrap: pretty;
}

/* ─── Адаптив ─── */
@media (max-width: 1100px) {
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .cases { padding: 56px 0; }
  .cases__container { padding: 0 20px; }

  /* Табы по центру, скролл только если действительно не помещаются */
  .cases-tabs {
    gap: 24px;
    margin: 28px 0 24px;
    overflow-x: auto;
    justify-content: center;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .cases-tabs::-webkit-scrollbar { display: none; }
  .cases-tab {
    flex: 0 0 auto;
    font-size: 17px;
    padding: 14px 4px;
  }
  .cases-tab.is-active::after { bottom: -13px; }

  /* Свайп между панелями (Я чувствую → Я хочу → Мне трудно) */
  .cases-panels {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;        /* hug viewport edges для естественного свайпа */
    padding: 0 20px;
    gap: 20px;
  }
  .cases-panels::-webkit-scrollbar { display: none; }

  /* На мобильном все 3 панели всегда видны (свайп между ними) —
     перебиваем desktop-правила .is-active / hidden */
  .cases-panel,
  .cases-panel.is-active,
  .cases-panel[hidden] {
    display: block !important;
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .cases-grid { grid-template-columns: 1fr; gap: 16px; }
  .case-card { padding: 28px 24px 24px; }
  .case-card__title { font-size: 20px; }
  .case-card__desc { font-size: 14px; }
}


/* ════════════════════════════════════════════════════
   Deep — «Отдельный фокус»: карусель глубоких тем
   Тёмные карточки, scroll-snap, peek ~15%, стрелки
   ════════════════════════════════════════════════════ */
.cases-deep {
  margin: clamp(32px, 4vw, 44px) 0 0;
}
.cases-deep__label {
  font: 500 13px/1.4 var(--font-body);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin: 0 0 20px;
}
.cases-deep__carousel {
  position: relative;
}
.cases-deep__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.cases-deep__track::-webkit-scrollbar { display: none; }
.cases-deep__track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.cases-deep__card {
  flex: 0 0 calc((100% - 3 * 14px) / 4.15);
  scroll-snap-align: start;
  background: var(--text-dark, #2A2520);
  border-radius: 6px;
  padding: 22px 22px 20px;
}
.cases-deep__title {
  font: 600 19px/1.3 var(--font-serif);
  color: #F5F1EC;
  margin: 0 0 10px;
  text-wrap: pretty;
}
.cases-deep__title::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 14px;
}
.cases-deep__desc {
  font: 400 15px/1.6 var(--font-body);
  color: rgba(245, 241, 236, 0.76);
  margin: 0;
  text-wrap: pretty;
}

/* Стрелки */
.cases-deep__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-dark, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(42, 37, 32, 0.18);
  transition: color var(--dur, 0.25s) var(--ease-out, ease), border-color var(--dur, 0.25s) var(--ease-out, ease);
}
.cases-deep__arrow svg { width: 20px; height: 20px; }
.cases-deep__arrow:hover { color: var(--accent); border-color: var(--accent); }
.cases-deep__arrow--prev { left: -14px; }
.cases-deep__arrow--next { right: -14px; }
.cases-deep__arrow[hidden] { display: none; }

/* ─── Мост к повседневным запросам ─── */
.cases-bridge {
  margin: clamp(34px, 4.5vw, 48px) 0 4px;
  text-align: center;
}
.cases-bridge__kicker {
  font: 500 13px/1.4 var(--font-body);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.cases-bridge__lead {
  font: 400 italic clamp(17px, 1.4vw, 20px)/1.55 var(--font-serif);
  color: rgba(60, 50, 40, 0.85);
  max-width: 640px;
  margin: 14px auto 0;
  text-wrap: pretty;
}

/* ─── Дисклеймер внизу секции ─── */
.cases__lead--bottom {
  margin: clamp(36px, 4.5vw, 48px) auto 0;
  /* вид как у .approach__lead-intro: прямой serif + охряная черта */
  font: 500 clamp(19px, 1.6vw, 23px)/1.5 var(--font-serif);
  color: var(--text-dark);
  text-align: left;
  max-width: 720px;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

/* ─── Адаптив карусели ─── */
@media (max-width: 1100px) {
  .cases-deep__card { flex-basis: calc((100% - 2 * 14px) / 3.15); }
}
@media (max-width: 830px) {
  .cases-deep__card { flex-basis: calc((100% - 14px) / 2.15); }
  .cases-deep__arrow { display: none; }
}
@media (max-width: 560px) {
  .cases-deep__card { flex-basis: calc(100% / 1.18); padding: 18px 18px 16px; }
}


/* ─── Интро под заголовком секции ─── */
.cases__lead--intro {
  margin: 0 auto;
  max-width: 680px;
}
/* Фокус-обводка карусели при управлении с клавиатуры */
.cases-deep__track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 6px;
}


/* ─── CTA после секции ─── */
.cases__cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.cases__cta-btn {
  display: inline-block;
  padding: 16px 32px;
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  color: #fff;
  font: 500 15px/1 var(--font-body);
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: background 0.2s var(--ease-out, ease), transform 0.2s var(--ease-out, ease);
}
.cases__cta-btn:hover {
  background: var(--accent-dark, #b56a2c);
  color: #fff; /* перебиваем глобальный a:hover */
  transform: translateY(-2px);
  text-decoration: none;
}
