/* ============================================================
   CASE STUDY TEMPLATE  ·  Portfolio Iryna Nechytailo
   Topbar (back + anchors) · case hero · metrics strip
   gallery · about block · section headers · accordion
   decision blocks · collaboration block · impact grid · next CTA
   ============================================================ */

/* ── SINGLE HERO IMAGE (alternative to gallery) ────────────── */
.case-hero-img {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 40px;
  box-shadow: 0 24px 56px -28px rgba(21, 17, 12, 0.14);
}
.case-hero-img img,
.case-hero-img video {
  width: 100%;
  height: auto;
  display: block;
}

/* ── TOPBAR: CASE NAV ───────────────────────────────────────── */
.topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.topbar__back svg { transition: transform var(--d-fast) var(--ease); }
.topbar__back:hover svg { transform: translateX(-3px); }

/* ── CASE HERO ──────────────────────────────────────────────── */
.case-hero {
  padding: 96px 0 56px;
  text-align: center;
}
.case-hero__eyebrow {
  color: var(--case-accent);
  margin-bottom: 28px;
}
.case-hero__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(34px, 3.8vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin: 0 auto;
}
:root[data-type="serif-display"] .case-hero__title { font-weight: 300; }

.case-hero__lede {
  margin: 28px auto 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.case-hero__lede strong { color: var(--ink); font-weight: 500; }

/* ── METRICS STRIP ──────────────────────────────────────────── */
.metrics-strip {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.metric {
  padding: 36px 32px;
  border-right: 1px solid var(--rule-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.metric:first-child { padding-left: 0; }
.metric:last-child  { border-right: none; }

.metric__num {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(48px, 5vw, 76px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
:root[data-type="serif-display"] .metric__num { font-weight: 400; }
.metric__num .unit {
  font-size: 0.55em;
  color: var(--muted);
  margin-left: 4px;
  font-weight: 400;
  letter-spacing: 0;
}
.metric__label {
  margin-top: 14px;
  font-size: 15px;
  color: var(--muted);
  max-width: 24ch;
  line-height: 1.5;
  text-align: center;
}

/* ── GALLERY ────────────────────────────────────────────────── */
.gallery {
  margin-top: 64px;
  position: relative;
  user-select: none;
}

.gallery__track {
  display: flex;
  gap: 20px;
  padding: 8px 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
  /* Edge-to-edge padding aligned to --width */
  padding-left:  max(calc((100vw - var(--width)) / 2), var(--pad-x));
  padding-right: max(calc((100vw - var(--width)) / 2), var(--pad-x));
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.is-grabbing { cursor: grabbing; }
.gallery__track > *               { flex: 0 0 auto; pointer-events: auto; }
.gallery__track.is-grabbing > *   { pointer-events: none; }

/* ─ Screen card ─ */
.gallery__shot {
  height: 540px;
  width: 760px;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 50px -34px rgba(21, 17, 12, 0.18);
  transition: transform var(--d-fast) var(--ease);
}
.gallery__shot:hover { transform: translateY(-2px); }

/* Modifiers */
.gallery__shot--lead  { width: 992px; height: 664px; }
.gallery__shot--light .gallery__shot-cap { color: var(--muted); }

/* Caption bar */
.gallery__shot-cap {
  position: absolute;
  left: 18px; bottom: 16px; right: 18px;
  color: #D4EFE9; /* light mint — 5.3:1 on #0E6B5A, AA ✓ */
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.gallery__shot--light .gallery__shot-cap {
  color: #0E6B5A; /* case accent — 6.4:1 on white, AA ✓ */
}

/* Gallery controls bar */
.gallery__controls-mobile { display: none; }

.gallery__controls {
  width: min(var(--width), 100% - var(--pad-x) * 2);
  margin: 8px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}
.gallery__controls-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gallery__controls-hint { opacity: 0.7; }
.gallery__arrows { display: flex; gap: 8px; }

.gallery__arrow-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
}
.gallery__arrow-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.gallery__arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.gallery__arrow-btn:disabled:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

/* ── ABOUT BLOCK ────────────────────────────────────────────── */
.about {
  margin-top: 96px;
  padding: 40px 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 56px;
  align-items: start;
}

.about__left {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about__right {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about__dt {
  color: var(--case-accent);
  margin-bottom: 8px;
}
.about__dd {
  font-size: 17px;
  line-height: 1.55;
  color: #15110C;
}

.about__block-label {
  color: var(--case-accent);
  margin-bottom: 10px;
}
.about__block-text {
  font-size: 17px;
  line-height: 1.55;
  color: #15110C;
}
.about__block-text + .about__block-text {
  margin-top: 12px;
}
.about__block-text .hl {
  background: linear-gradient(180deg, transparent 60%, var(--case-accent-light) 60%);
  padding: 0 2px;
}

/* ── SECTION HEADERS (case page) ────────────────────────────── */
.sec { padding: 112px 0 0; }

.sec__eyebrow {
  color: var(--case-accent);
  margin-bottom: 16px;
}
.sec__heading {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 24ch;
}
:root[data-type="serif-display"] .sec__heading { font-weight: 400; }

.sec__lede {
  margin-top: 20px;
  color: var(--muted);
  font-family: var(--f-ui);
  font-size: 17px;
  line-height: 1.55;
  max-width: 60ch;
}
.sec__lede strong { color: var(--ink); font-weight: 500; }

/* ─ Two-column layout for sections ─ */
.two-col {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}
.two-col--wide {
  grid-template-columns: 1fr 2fr;
}

/* ── ACCORDION ──────────────────────────────────────────────── */
.accordion {
  margin-top: 36px;
  border-top: 1px solid var(--rule-soft);
}
.accordion__item { border-bottom: 1px solid var(--rule-soft); }

.accordion__item > summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--f-ui);
  font-size: 20px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color var(--d-fast) var(--ease);
}
.accordion__item > summary::-webkit-details-marker { display: none; }
.accordion__item > summary:hover { color: var(--case-accent); }

.accordion__icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  position: relative;
}
.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition:
    opacity   var(--d-fast) var(--ease),
    transform var(--d-fast) var(--ease);
}
.accordion__icon::before { width: 12px; height: 1px; }
.accordion__icon::after  { width: 1px; height: 12px; }
.accordion__item[open] .accordion__icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

.accordion__body {
  padding: 0 0 26px;
  max-width: 64ch;
  color: var(--muted);
  font-family: var(--f-ui);
  font-size: 17px;
  line-height: 1.6;
}

/* ── DECISION BLOCKS ────────────────────────────────────────── */
.decision {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
}

.decision__aside-label {
  color: var(--case-accent);
  margin-bottom: 14px;
}
.decision__aside-heading {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 16ch;
}
:root[data-type="serif-display"] .decision__aside-heading { font-weight: 400; }

.decision__issue {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--bg-2);
  border-radius: 8px;
}
.decision__issue-label {
  font-family: var(--f-ui);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--case-accent);
  margin-bottom: 8px;
}
.decision__issue-text {
  font-family: var(--f-ui);
  font-size: 17px;
  color: var(--ink);
  line-height: 1.55;
}

.decision__card {
  background: var(--bg);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  overflow: hidden;
}
.decision__card-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.decision__card-head-label {
  color: var(--muted);
}
.decision__card-head-title {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.decision__points { padding: 0 24px; }
.decision__point {
  list-style: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.decision__point:last-child { border-bottom: none; }
.decision__point-num {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 1px;
}
.decision__point-title { font-weight: 500; }
.decision__point-desc {
  color: var(--muted);
  margin-top: 4px;
  max-width: 56ch;
}

/* ── INTERACTIVE DECISION TABS ──────────────────────────────── */
.dtabs-block {
  margin-top: 56px;
}

.dtabs-block__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 48px;
}

.dtabs-block__issue {
  margin-top: 0;
}

.dtabs-block__top--solo {
  display: block;
  margin-bottom: 48px;
}

.dtabs {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}

/* — Left column wrapper — */
.dtabs__col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dtabs__col-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dtabs__col-meta {
  font-family: var(--f-ui);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--case-accent);
}

.dtabs__col-name {
  font-family: var(--f-ui);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--case-accent);
}

/* — Tab list — */
.dtabs__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule-soft);
}

.dtabs__tab {
  all: unset;
  display: block;
  cursor: pointer;
  padding-top: 20px;
  box-sizing: border-box;
}

.dtabs__tab-body {
  padding-bottom: 20px;
}

.dtabs__tab-title {
  font-family: var(--f-ui);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--muted);
  transition: color var(--d-fast) var(--ease);
}
.dtabs__tab.is-active .dtabs__tab-title { color: var(--ink); }

.dtabs__tab-desc {
  margin-top: 10px;
  font-family: var(--f-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38ch;
  display: none;
}
.dtabs__tab.is-active .dtabs__tab-desc { display: block; }

/* Progress bar — doubles as separator */
.dtabs__progress {
  height: 2px;
  background: var(--rule-soft);
  overflow: hidden;
}
.dtabs__progress-fill {
  height: 100%;
  width: 0%;
  background: var(--case-accent);
  will-change: width;
}

/* — Panels — */
.dtabs__panels {
  position: sticky;
  top: 96px;
}

.dtabs__panel { display: none; }
.dtabs__panel.is-active { display: block; }

.dtabs__media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 24px 56px -28px rgba(21, 17, 12, 0.14);
  position: relative;
}
/* Inset border overlay — sits above video/img so it stays visible */
.dtabs__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 1px solid var(--rule-soft);
  pointer-events: none;
  z-index: 2;
}
.dtabs__media img,
.dtabs__media video {
  width: 100%;
  height: auto;
  display: block;
}
/* Container adapts to media's natural aspect ratio */
.dtabs__media:has(img),
.dtabs__media:has(video) {
  aspect-ratio: unset;
}

.dtabs__media--spec {
  aspect-ratio: unset;
  height: auto;
  padding: 20px 24px;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #2a2a2a;
  background: #fff;
}
.dtabs__media--spec .k { color: var(--case-accent); }
.dtabs__media--spec .v { color: #444; }
.dtabs__media--spec .c { color: #767676; }

/* ── COLLABORATION BLOCK ────────────────────────────────────── */
.collab {
  margin-top: 36px;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.collab__list {
  display: flex;
  flex-direction: column;
}
.collab__item {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.collab__item:last-child { border-bottom: none; }
.collab__item-title {
  font-weight: 500;
  color: var(--ink);
  font-size: 15px;
}
.collab__item-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.collab__spec {
  background: #fff;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: 18px;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #2a2a2a;
  min-height: 320px;
}
.collab__spec .k { color: var(--case-accent); }
.collab__spec .v { color: #444; }
.collab__spec .c { color: #767676; }

/* ── IMPACT GRID ────────────────────────────────────────────── */
.impact-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule-soft);
}

.impact-card {
  padding: 36px 36px 36px 0;
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.impact-card:nth-child(2n) {
  border-right: none;
  padding-left: 36px;
  padding-right: 0;
}
.impact-card--full {
  grid-column: 1 / -1;
  border-right: none;
  padding-right: 0;
}

.impact-card__label {
  color: var(--case-accent);
}
.impact-card__num {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(40px, 4.4vw, 64px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
:root[data-type="serif-display"] .impact-card__num { font-weight: 400; }
.impact-card__num .unit {
  font-size: 0.55em;
  color: var(--muted);
  margin-left: 2px;
  font-weight: 400;
}
.impact-card--full .impact-card__num {
  font-size: clamp(28px, 2.6vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.18;
  max-width: 32ch;
}

.impact-card__desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 48ch;
}
.impact-card__desc strong { color: var(--ink); font-weight: 500; }

/* ── CASE NEXT CTA ──────────────────────────────────────────── */
.case-next {
  margin-top: 96px;
  padding-bottom: 96px;
}
.case-next__link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  padding: 36px 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  transition: padding var(--d-med) var(--ease);
}
.case-next__link:hover {
  padding-left: 16px;
  padding-right: 16px;
}
.case-next__label {
  color: var(--muted);
}
.case-next__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 24ch;
  margin-top: 8px;
}
:root[data-type="serif-display"] .case-next__title { font-weight: 400; }

/* ── CUSTOM VIDEO PLAYER (.vp) ──────────────────────────────── */
.vp {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 24px 56px -28px rgba(21, 17, 12, 0.22);
  margin-bottom: 40px;
}

/* Poster overlay */
.vp__poster {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.vp__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vp__poster.is-hidden {
  display: none;
}

/* Large centered play button (overlays video when paused) */
.vp__play-big {
  all: unset;
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease);
}
.vp__play-big:hover {
  background: rgba(0,0,0,0.08);
}
.vp__play-big svg {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.92);
  color: #0a0a0a;
  border-radius: 50%;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transition: transform var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
  box-sizing: content-box;
}
.vp__play-big:hover svg {
  transform: scale(1.06);
  background: #fff;
}

/* Video element */
.vp__video {
  width: 100%;
  height: auto;
  display: block;
  min-height: 200px;
}

/* Controls bar — appears on hover or when paused */
.vp__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--d-fast) var(--ease);
  pointer-events: none;
}
.vp:hover .vp__controls,
.vp.is-paused .vp__controls {
  opacity: 1;
  pointer-events: auto;
}

/* Icon buttons */
.vp__btn {
  all: unset;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  border-radius: 6px;
  flex-shrink: 0;
  transition: color var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
}
.vp__btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.14);
}

/* Seek bar */
.vp__seek-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  height: 20px;
  cursor: pointer;
}
.vp__seek-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  overflow: hidden;
  transition: height var(--d-fast) var(--ease);
}
.vp__seek-wrap:hover .vp__seek-track { height: 5px; }
.vp__seek-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 99px;
  pointer-events: none;
}

/* Time display */
.vp__time {
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 72px;
  text-align: center;
}

/* Volume slider */
.vp__volume {
  width: 68px;
  flex-shrink: 0;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
.vp__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.vp__volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .two-col,
  .about,
  .decision {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .metrics-strip,
  .impact-grid,
  .about__blocks,
  .collab {
    grid-template-columns: 1fr;
  }

  .metric,
  .impact-card {
    border-right: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .metric:not(:last-child) { border-bottom: 1px solid var(--rule-soft); }
  .impact-card { border-bottom: 1px solid var(--rule-soft); }

  .gallery__shot { width: 86vw; height: auto; aspect-ratio: 4 / 3; }
  .gallery__shot--lead { width: 92vw; aspect-ratio: 16 / 10; }


  .decision { margin-top: 36px; }
}

@media (max-width: 768px) {
  .gallery__controls {
    width: auto;
    margin-left: var(--pad-x-mobile, 24px);
    margin-right: var(--pad-x-mobile, 24px);
  }

  /* Gallery mobile: hide desktop controls, show mobile bar */
  .gallery__shot-cap { display: none; }
  .gallery__controls-right { display: none; }
  #js-gallery-progress { display: none; }

  .gallery__controls-mobile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
  }
  /* Arrows: shrink to min-width, aligned to top */
  .gallery__controls-mobile .gallery__arrows {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding-top: 1px;
  }
  /* Caption: counter + text, fills remaining space */
  .gallery__caption-mobile {
    flex: 1;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
  }
}

@media (max-width: 700px) {
  /* dtabs: vertical stack — image on top (sticky), tabs below */
  .dtabs {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .dtabs__panels {
    order: -1;
    position: sticky;
    top: 60px;
    z-index: 2;
    margin-bottom: 24px;
  }
  .dtabs__col { order: 1; }

  /* dtabs-block top: single column */
  .dtabs-block__top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
