/* ============================================================
   Case Study detail page (PMRI) — shares tokens + cs-hero vocab
   ============================================================ */

/* ---- hero ---- */
.csd-hero {
  position: relative; overflow: hidden;
  padding: calc(var(--space-13) + 56px) 0 var(--space-10);
  background: var(--color-midnight-800); color: #fff;
}
.csd-hero__deco { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(720px 340px at 82% -8%, rgba(220,16,46,0.20), transparent 60%); }
.csd-hero__inner { position: relative; z-index: 1; max-width: 820px; }
.csd-crumb { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: rgba(255,255,255,0.6); text-decoration: none; margin-bottom: var(--space-6); }
.csd-crumb:hover { color: #fff; text-decoration: none; opacity: 1; }
.csd-hero__chips { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.csd-chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-size: var(--text-2xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); padding: 6px 13px; border-radius: var(--radius-pill); }
.csd-chip--red { background: rgba(220,16,46,0.18); border-color: rgba(220,16,46,0.4); }
.csd-hero__title { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 48px); font-weight: var(--fw-bold); line-height: 1.12; letter-spacing: -0.02em; margin: 0; color: #fff; }
.csd-hero__title em { font-style: normal; color: var(--color-crimson-400); }
.csd-hero__meta { margin-top: var(--space-6); font-size: var(--text-sm); color: rgba(255,255,255,0.66); }

/* ---- key outcome band (overlapping hero) ---- */
.csd-outcomes { margin-top: -44px; position: relative; z-index: 2; }
.csd-outcomes__grid { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.csd-outcome { padding: var(--space-7) var(--space-5); text-align: center; }
.csd-outcome + .csd-outcome { border-left: 1px solid var(--border-subtle); }
.csd-outcome b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: var(--fw-bold); color: var(--color-crimson-600); line-height: 1; font-variant-numeric: tabular-nums; }
.csd-outcome span { display: block; margin-top: var(--space-3); font-family: var(--font-display); font-size: 11px; font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-tertiary); line-height: 1.4; }

/* ---- article layout ---- */
.csd-body { padding: var(--space-11) 0 var(--space-12); }
.csd-layout { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-10); align-items: start; }
.csd-main { min-width: 0; }
.csd-h2 { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--fw-bold); color: var(--fg-primary); letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 var(--space-5); }
.csd-h2 .n { color: var(--color-crimson-500); font-size: var(--text-md); vertical-align: super; margin-right: 8px; font-variant-numeric: tabular-nums; }
.csd-p { font-size: var(--text-base); color: var(--fg-secondary); line-height: 1.7; margin: 0 0 var(--space-5); }
.csd-sec { margin-bottom: var(--space-10); }

/* checklist + bullet list */
.csd-list { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-3); }
.csd-list li { display: flex; gap: var(--space-4); align-items: flex-start; font-size: var(--text-base); color: var(--fg-secondary); line-height: 1.55; }
.csd-list li::before { content: ""; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--color-crimson-400); margin-top: 9px; }
.csd-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-6); }
.csd-checks li { display: flex; gap: var(--space-3); align-items: center; font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--fg-primary); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); }
.csd-checks li svg { width: 18px; height: 18px; color: var(--color-success-500); flex-shrink: 0; }

/* image placeholder */
.csd-img { position: relative; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--bg-surface); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--fg-secondary); aspect-ratio: 16/8; margin: var(--space-6) 0; }
.csd-img::before { content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image: linear-gradient(45deg, rgba(10,26,47,0.03) 25%, transparent 25%), linear-gradient(-45deg, rgba(10,26,47,0.03) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(10,26,47,0.03) 75%), linear-gradient(-45deg, transparent 75%, rgba(10,26,47,0.03) 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.csd-img > *:not(.csd-img__label) { position: relative; z-index: 1; padding: 0 16px; }
.csd-img__ico { width: 32px; height: 32px; color: var(--color-crimson-500); margin-bottom: 8px; }
.csd-img__ico svg { width: 100%; height: 100%; }
.csd-img__t { font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--fg-primary); margin: 0 0 4px; }
.csd-img__d { font-size: var(--text-2xs); color: var(--fg-tertiary); line-height: 1.45; max-width: 380px; }
.csd-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }

/* floating labels on images */
.csd-img--labeled { position: relative; }
.csd-img__label { position: absolute; top: 16px; left: 16px; z-index: 10 !important; background: rgba(0, 0, 0, 0.8); color: #fff; padding: 10px 18px; border-radius: var(--radius-md); font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-bold); backdrop-filter: blur(8px); pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.csd-img__label--before { background: rgba(0, 0, 0, 0.8); }
.csd-img__label--after { background: rgba(220, 16, 46, 0.9); }

/* before / after table */
.csd-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; font-size: var(--text-sm); }
.csd-table th { font-family: var(--font-display); font-size: var(--text-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.06em; text-align: left; padding: var(--space-4) var(--space-5); background: var(--color-midnight-800); color: #fff; }
.csd-table th:nth-child(2) { color: rgba(255,255,255,0.7); }
.csd-table th:nth-child(3) { color: var(--color-crimson-300, #FF9AA8); }
.csd-table td { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); color: var(--fg-secondary); vertical-align: top; }
.csd-table td:first-child { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.csd-table td:last-child { font-weight: var(--fw-semibold); color: var(--color-success-700); font-variant-numeric: tabular-nums; }
.csd-table tr:nth-child(even) td { background: var(--bg-canvas); }

/* impact stat cards */
.csd-impact { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.csd-impact__card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-xs); }
.csd-impact__n { font-family: var(--font-display); font-size: 30px; font-weight: var(--fw-bold); color: var(--color-crimson-600); line-height: 1; font-variant-numeric: tabular-nums; }
.csd-impact__t { font-family: var(--font-display); font-size: var(--text-md); font-weight: var(--fw-bold); color: var(--fg-primary); margin: var(--space-3) 0 var(--space-2); }
.csd-impact__d { font-size: var(--text-sm); color: var(--fg-secondary); line-height: 1.55; margin: 0; }

/* quote */
.csd-quote { background: var(--color-crimson-50); border-radius: var(--radius-xl); padding: var(--space-8); position: relative; }
.csd-quote::before { content: "\201C"; position: absolute; top: 6px; left: 22px; font-family: var(--font-display); font-size: 84px; font-weight: var(--fw-bold); color: var(--color-crimson-200); line-height: 1; }
.csd-quote p { position: relative; font-size: var(--text-lg); color: var(--fg-primary); line-height: 1.6; font-style: italic; margin: var(--space-5) 0 var(--space-5); }
.csd-quote footer { font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--fg-secondary); }

/* ---- sidebar ---- */
.csd-aside { position: sticky; top: 96px; display: grid; gap: var(--space-6); }
.csd-panel { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-xs); }
.csd-panel__h { font-family: var(--font-display); font-size: var(--text-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--fg-tertiary); margin: 0 0 var(--space-5); }
.csd-fact { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.csd-fact:last-child { border-bottom: 0; padding-bottom: 0; }
.csd-fact b { display: block; font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--fg-primary); }
.csd-fact span { font-size: var(--text-2xs); color: var(--fg-tertiary); }
.csd-panel--cta { background: var(--color-midnight-800); border-color: transparent; color: #fff; text-align: center; }
.csd-panel--cta h4 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--fw-bold); margin: 0 0 var(--space-3); color: #fff; }
.csd-panel--cta p { font-size: var(--text-sm); color: rgba(255,255,255,0.7); line-height: 1.55; margin: 0 0 var(--space-6); }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .csd-layout { grid-template-columns: 1fr; }
  .csd-aside { position: static; }
  .csd-outcomes__grid { grid-template-columns: repeat(3, 1fr); }
  .csd-outcome:nth-child(4), .csd-outcome:nth-child(5) { border-top: 1px solid var(--border-subtle); }
  .csd-outcome:nth-child(4) { border-left: 0; }
}
@media (max-width: 640px) {
  .csd-checks { grid-template-columns: 1fr; }
  .csd-impact { grid-template-columns: 1fr; }
  .csd-outcomes__grid { grid-template-columns: 1fr 1fr; }
  .csd-outcome { padding: var(--space-5) var(--space-4); }
  .csd-outcome:nth-child(3) { border-top: 1px solid var(--border-subtle); border-left: 0; }
  .csd-outcome:nth-child(odd) { border-left: 0; }
  .csd-outcome:nth-child(even) { border-left: 1px solid var(--border-subtle); }
  .csd-table { font-size: var(--text-2xs); }
  .csd-table th, .csd-table td { padding: var(--space-3) var(--space-4); }
}
