/* Case study detail page. Tokens and fonts come from transplant.css; shell from inner.css. */
.cs {
  --col: 1400px;
  --read: 720px;
  --gut: clamp(16px, 4vw, 40px);
  --gap: clamp(12px, 2vw, 24px);
  --r: clamp(12px, 1.6vw, 20px);
  padding-bottom: 0;
}

/* ---------- Header ---------- */
.cs-hero { padding: clamp(32px, 6vw, 72px) var(--gut) 0; }
.cs-hero--tint { background: var(--tint); padding-bottom: var(--gap); }
.cs-head { max-width: var(--col); margin: 0 auto; padding-bottom: clamp(32px, 5vw, 56px); }
.cs-hero--tint .cs-head { padding-bottom: clamp(28px, 4vw, 48px); }
.cs-head .crumbs { margin-bottom: clamp(24px, 4vw, 48px); }
.cs-head__main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: end; }
.cs-kicker { margin: 0 0 14px; font-size: 15px; color: var(--accent); font-weight: 500; letter-spacing: 0.01em; }
.cs-head h1 { margin: 0; font-size: clamp(2.5rem, 6.4vw, 5.25rem); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: anywhere; }
.cs-head__side { display: grid; gap: 24px; justify-items: start; padding-bottom: 6px; }
.cs-lede { margin: 0; font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.55; color: var(--text-body); max-width: 34rem; }
.cs-head .btn svg { width: 20px; height: 20px; flex: none; }
.cs-head .btn span, .cs-cta .btn span { white-space: nowrap; }

.cs-meta { display: flex; flex-wrap: wrap; gap: 20px clamp(28px, 5vw, 72px); margin: clamp(32px, 5vw, 56px) 0 0; padding: 20px 0 0; border-top: 1px solid var(--border); }
.cs-hero--tint .cs-meta { border-top-color: rgba(24, 18, 18, 0.12); }
.cs-meta div { min-width: 0; max-width: 28rem; }
.cs-meta dt { font-size: 13px; color: var(--text-muted); margin: 0 0 4px; }
.cs-meta dd { margin: 0; font-size: 16px; line-height: 1.45; color: var(--text); }

/* ---------- Modules ---------- */
.cs-body { padding-top: var(--gap); }
.cs-m, .cs-hero > .cs-m { max-width: calc(var(--col) + 2 * var(--gut)); margin: 0 auto var(--gap); padding: 0 var(--gut); box-sizing: border-box; }
.cs-hero > .cs-m { padding: 0; max-width: var(--col); margin-bottom: 0; }
.cs-body > .cs-m { content-visibility: auto; contain-intrinsic-size: auto 720px; }
.cs-m figure, figure.cs-m { margin-left: auto; margin-right: auto; }
figure.cs-m { margin-top: 0; margin-bottom: var(--gap); }
.cs-hero > figure.cs-m { margin-bottom: 0; }

.cs-zoom { display: block; width: 100%; padding: 0; border: 0; background: var(--accent-25); border-radius: var(--r); overflow: hidden; cursor: zoom-in; line-height: 0; font: inherit; }
.cs-zoom img { display: block; width: 100%; height: auto; }
.cs-zoom:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.cs-pair figure { margin: 0; min-width: 0; }

.cs-read { max-width: calc(var(--read) + 2 * var(--gut)); margin: clamp(28px, 5vw, 64px) auto; padding: 0 var(--gut); box-sizing: border-box; }
.cs-h { font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; color: var(--text); margin-top: clamp(40px, 7vw, 96px); margin-bottom: 0; }
.cs-h + .cs-text { margin-top: 16px; }
.cs-text { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.7; color: var(--text-body); }
.cs-text > :first-child { margin-top: 0; }
.cs-text > :last-child { margin-bottom: 0; }
.cs-text p { margin: 0 0 1.1em; }
.cs-text h3 { font-size: 1.25rem; font-weight: 600; color: var(--text); margin: 1.6em 0 0.4em; }
.cs-text ul, .cs-text ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.cs-text li { margin-bottom: 0.4em; }
.cs-text a, p.cs-read a { color: var(--accent); text-underline-offset: 3px; }

.cs-video { max-width: var(--col); margin: 0 auto; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--neutral-950, #0f0a0a); }
.cs-video iframe, .cs-video video { display: block; width: 100%; height: 100%; border: 0; }
.cs-m:has(> .cs-video) { max-width: calc(var(--col) + 2 * var(--gut)); }

/* ---------- Previous / next ---------- */
.cs-pager { max-width: calc(var(--col) + 2 * var(--gut)); margin: clamp(56px, 9vw, 120px) auto 0; padding: 0 var(--gut); display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); box-sizing: border-box; }
.cs-pn { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(88px, 14vw, 180px); grid-template-areas: 'dir img' 'title img' 'sub img'; align-content: center; column-gap: 20px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--border); border-radius: var(--r); text-decoration: none; color: var(--text); background: #fff; transition: border-color .25s var(--ease-out-spring), transform .25s var(--ease-out-spring); min-height: 140px; }
.cs-pn:hover { border-color: var(--accent-200); transform: translateY(-2px); }
.cs-pn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cs-pn--next { text-align: right; grid-template-columns: clamp(88px, 14vw, 180px) minmax(0, 1fr); grid-template-areas: 'img dir' 'img title' 'img sub'; }
.cs-pn__dir { grid-area: dir; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.cs-pn__title { grid-area: title; font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.cs-pn__sub { grid-area: sub; font-size: 14px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.cs-pn__img { grid-area: img; align-self: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--accent-25); }
.cs-pn__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-pn--noimg, .cs-pn--next.cs-pn--noimg { grid-template-columns: 1fr; grid-template-areas: 'dir' 'title' 'sub'; }
.cs-pn--next { grid-column: 2; }
.cs-pn--prev:only-child, .cs-pn--next:only-child { grid-column: auto; }

/* ---------- Call to action ---------- */
.cs-cta { max-width: calc(var(--col) + 2 * var(--gut)); margin: clamp(56px, 9vw, 120px) auto 0; padding: 0 var(--gut); box-sizing: border-box; text-align: center; display: grid; justify-items: center; gap: 16px; }
.cs-cta h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 600; color: var(--text); }
.cs-cta p { margin: 0 0 8px; color: var(--text-muted); font-size: 1.125rem; max-width: 30rem; }

/* ---------- Lightbox ---------- */
.cs-lb { border: 0; padding: 0; background: transparent; width: 100vw; height: 100vh; max-width: none; max-height: none; cursor: zoom-out; }
.cs-lb::backdrop { background: rgba(15, 10, 10, 0.92); }
.cs-lb[open] { display: grid; place-items: center; }
.cs-lb img { max-width: 96vw; max-height: 94vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.cs-lb__x { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.cs-lb__x:hover, .cs-lb__x:focus-visible { background: rgba(255, 255, 255, 0.28); outline: none; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .cs-head__main { grid-template-columns: 1fr; align-items: start; gap: 20px; }
}
@media (max-width: 640px) {
  .cs-pair { grid-template-columns: 1fr; }
  .cs-pager { grid-template-columns: 1fr; }
  .cs-pn--next { grid-column: auto; }
  .cs-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .cs-head .btn { width: 100%; justify-content: center; }
  .cs-cta .btn { max-width: 100%; }
  .cs-cta .btn span { white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-pn { transition: none; }
}
