/* =====================================================================
   CASE STUDIES (case-studies/ and case-studies/detail.html): cards, cinematic banner, story timeline.
   Loaded after base.css and components.css. Built from: case-study.css.
   ===================================================================== */

/* ======================== from case-study.css ======================== */
/* Case study detail template (case-study.html). Builds on pages-04.css: p4-hero, p4-story, p4-flow, p4-cases. */

/* ---------- hero: full-bleed cinematic banner ----------
   The incident image fills the banner. --p (0 to 1, scrubbed by case-cine.js while the banner is pinned)
   shrinks it into a rounded card and lifts the copy away; scrolling back up reverses it. */
.cs-cine { --p: 0; min-height: clamp(620px, 100svh, 1000px); display: flex; align-items: flex-end;
  padding: clamp(130px, 18vh, 170px) 0 clamp(44px, 7vh, 80px); }
.cs-cine__stage { position: absolute; inset: 0; z-index: 0; overflow: hidden;
  clip-path: inset(calc(var(--p) * 9%) calc(var(--p) * 7%) calc(var(--p) * 13%) calc(var(--p) * 7%) round calc(var(--p) * 32px)); }
.cs-cine__media { position: absolute; inset: 0; background: #0B2259; }
.cs-cine__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.14 - var(--p) * .14)); }
/* legibility: dark at the bottom and left for the copy, a little at the top for the header */
.cs-cine__shade { position: absolute; inset: 0; opacity: calc(1 - var(--p) * .75);
  background: linear-gradient(0deg, rgba(4, 14, 40, .96) 0%, rgba(4, 14, 40, .72) 30%, rgba(4, 14, 40, .18) 62%, rgba(4, 14, 40, .55) 100%),
    linear-gradient(90deg, rgba(4, 14, 40, .7) 0%, transparent 60%); }
/* camera on-screen display, top right */
.cs-cine__osd { position: absolute; right: clamp(16px, 4vw, 56px); top: clamp(96px, 13vh, 130px); display: flex; gap: 16px; margin: 0;
  font: 600 .74rem/1 var(--o4-hud); letter-spacing: .08em; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px #000; opacity: calc(1 - var(--p) * 2); }
.cs-cine__osd i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #ff3b5c; animation: cs-rec 1.6s steps(2, start) infinite; }
@keyframes cs-rec { to { visibility: hidden; } }
.cs-cine__in { position: relative; z-index: 1; width: 100%; }
.cs-cine__copy { max-width: 980px; transform: translateY(calc(var(--p) * -90px)); opacity: calc(1 - var(--p) * 1.5); }
#main .cs-cine h1 { max-width: 20ch; font-size: clamp(2.2rem, 1.2rem + 3.3vw, 4.6rem); text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.cs-cine .p4-hero__lede { max-width: 60ch; color: rgba(225, 233, 255, .86); }
.cs-cine__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px;
  margin-top: clamp(24px, 3.4vh, 36px); padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .18); }
.cs-cine__facts { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 3.4vw, 52px); margin: 0; }
.cs-cine__facts dt { font-size: .76rem; color: rgba(214, 226, 255, .65); }
.cs-cine__facts dd { margin: 4px 0 0; font-weight: 600; color: #fff; }
.cs-cine .p4-hero__actions { margin-top: 0; }
@media (max-width: 760px) {
  .cs-cine { min-height: clamp(560px, 92svh, 760px); }
  .cs-cine__osd span:last-child { display: none; }
  .cs-cine__foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .cs-cine, .cs-cine * { --p: 0 !important; } .cs-cine__osd i { animation: none; } }
.cs-btn-ghost { color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); }
.cs-btn-ghost:hover, .cs-btn-ghost:focus-visible { background: #fff; border-color: #fff; color: var(--ink); }

/* ---------- story ---------- */
.cs-story { border-top: 0; background: #fff; }
#main .cs-story h2 em { font-style: normal; color: var(--o4-red); }
.cs-story .p4-flow .is-outcome .p4-flow__k { color: #159a5e; }

/* at a glance card (sticky aside) */
.cs-glance { padding: clamp(20px, 2vw, 28px); border-radius: var(--r-lg); background: var(--mist); border: 1px solid var(--line); }
.cs-glance__h { margin: 0 0 12px; font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--o4-red); }
.cs-glance dl { display: grid; gap: 0; margin: 0 0 24px; }
.cs-glance dl div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cs-glance dl div:first-child { padding-top: 0; }
.cs-glance dt { color: var(--muted); font-size: .9rem; }
.cs-glance dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.cs-story .cs-glance .p4-tags li { background: #fff; }
.cs-glance__cta { justify-content: center; }

/* previous / next */
.cs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.cs-pager:empty { display: none; }
.cs-pager__a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: #fff;
  text-decoration: none; color: var(--ink); transition: border-color .25s, box-shadow .25s, transform .25s; }
.cs-pager__a:hover { border-color: rgba(255, 31, 90, .45); box-shadow: 0 20px 40px -28px rgba(12, 27, 58, .5); transform: translateY(-3px); }
.cs-pager__a small { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cs-pager__a small::before { content: "\2190\00a0"; }
.cs-pager__a--next { text-align: right; }
.cs-pager__a--next small::before { content: none; }
.cs-pager__a--next small::after { content: "\00a0\2192"; }
.cs-pager__a b { font-family: var(--display); font-weight: 600; font-size: 1.02rem; line-height: 1.35; }

/* ---------- more case studies: three across ---------- */
.cs-more { border-top: 1px solid var(--line); }
.cs-more__head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: clamp(24px, 3vw, 40px); }
#main .cs-more__head .o4-h2 { margin: 0; }
.cs-more__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#main .cs-more__grid .p4-case h3 { font-size: clamp(1.1rem, 1rem + .3vw, 1.3rem); }
.cs-more + .p4-cta { background: #fff; }

@media (max-width: 1023px) {
  .cs-more__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-more__grid .p4-case:nth-child(3) { display: none; }
}
@media (max-width: 760px) {
  .cs-pager { grid-template-columns: 1fr; }
  .cs-pager__a--next { text-align: left; }
  .cs-more__grid { grid-template-columns: 1fr; }
  .cs-more__grid .p4-case:nth-child(3) { display: flex; }
  .cs-more__head { flex-direction: column; align-items: start; }
}

/* ---------- compact case cards (listing + "more case studies") ---------- */
.p4-cases.cs-compact { gap: clamp(14px, 1.4vw, 20px); }
.p4-cases.cs-compact[data-cs-list] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-compact .p4-case { border-radius: 18px; }
.cs-compact .p4-case:hover { transform: translateY(-5px); box-shadow: 0 28px 50px -32px rgba(12, 27, 58, .5); }
.cs-compact .p4-case__img { aspect-ratio: 16 / 10; }
.cs-compact .p4-case__tag { left: 10px; top: 10px; padding: 4px 9px; font-size: .64rem; letter-spacing: .08em; }
.cs-compact .p4-case__body { gap: 6px; padding: 14px 16px 16px; }
.cs-compact .p4-case__meta { font-size: .7rem; }
#main .cs-compact .p4-case h3 { font-size: clamp(1rem, .95rem + .2vw, 1.12rem); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-compact .p4-case__body > p:not(.p4-case__meta) { font-size: .9rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-compact .o4-link { font-size: .88rem; padding-top: 4px; }

@media (max-width: 1023px) { .p4-cases.cs-compact[data-cs-list] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* phones: one row per story, thumbnail on the left */
@media (max-width: 640px) {
  .p4-cases.cs-compact, .p4-cases.cs-compact[data-cs-list] { grid-template-columns: 1fr; gap: 12px; }
  .cs-compact .p4-case { flex-direction: row; border-radius: 14px; }
  .cs-compact .p4-case__img { flex: 0 0 34%; aspect-ratio: auto; min-height: 120px; }
  .cs-compact .p4-case__tag { display: none; }
  .cs-compact .p4-case__body { padding: 12px 14px; }
  .cs-compact .p4-case__body > p:not(.p4-case__meta) { display: none; }
  .cs-compact .o4-link { margin-top: auto; }
  .cs-more__grid.cs-compact .p4-case:nth-child(3) { display: flex; }
}
