/* =========================================================
   Case studies (/case-studies/*) and the case-study teaser in
   index.html's #examples section.
   Its own file for the same reason as examples.css: everything
   under assets/ is immutable-cached for a year, so new rules go
   in a new filename rather than an edit to site.css.
   Relies on the design tokens in site.css; the finding cards on
   case-study pages reuse .finding-case from examples.css.
   ========================================================= */

/* ---------- Teaser (index.html #examples) ---------- */
.case-study-teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 40px;
  padding: clamp(20px, 2.4vw, 28px) clamp(20px, 2.4vw, 32px);
  border: var(--border-strong);
  background: var(--bg-alt);
}

.case-study-teaser__copy {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.case-study-teaser__eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.case-study-teaser__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  line-height: 1.15;
}

.case-study-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
.case-study-link svg { flex-shrink: 0; transition: transform 0.15s ease; }
.case-study-link:hover svg { transform: translateX(3px); }
.case-study-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}


/* ---------- Case-study page: hero ---------- */
.cs-hero {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2vw, 28px);
}

.cs-back {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text-muted);
}

.cs-hero__h1 {
  margin: 0;
  max-width: 1000px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.01em;
}

.cs-hero__lede {
  margin: 0;
  max-width: 720px;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--text-body);
}


/* ---------- At a glance ---------- */
.cs-glance {
  margin-top: clamp(12px, 2vw, 24px);
  border: var(--border-strong);
  box-shadow: clamp(6px, 0.7vw, 10px) clamp(6px, 0.7vw, 10px) 0 var(--shadow);
  background: var(--text); /* shows through the 1px gaps as hairlines */
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cs-glance__head {
  margin: 0;
  padding: 12px clamp(20px, 2.4vw, 32px);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.cs-glance__list {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
}

.cs-glance__item {
  flex: 2 1 300px;
  padding: 24px clamp(20px, 2.4vw, 32px) 28px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-glance__item--narrow { flex: 1 1 200px; }

.cs-glance__item dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.cs-glance__item dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}


/* ---------- Prose sections (challenge, why it matters) ---------- */
.cs-split {
  display: flex;
  flex-wrap: wrap;
  gap: 20px clamp(32px, 6vw, 80px);
}

.cs-split__label {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-split__body {
  flex: 2 1 480px;
  max-width: 760px;
  min-width: 0;
}

.cs-split__body p {
  margin: 0 0 1em;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-body);
}
.cs-split__body p:last-child { margin-bottom: 0; }


/* ---------- What VIF Pro found ---------- */
.cs-findings__list {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 40px);
}

/* Title row slotted into a .finding-case between its head and columns */
.cs-finding__title {
  margin: 0;
  padding: 20px clamp(20px, 2.4vw, 32px);
  background: var(--bg-card);
  font-family: var(--font-heading);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.1;
}


/* ---------- Quote ---------- */
/* A card in the site's offset-shadow language, with oversized block
   quote marks straddling its top-left and bottom-right borders. */
.cs-quote {
  --mark-w: clamp(56px, 6vw, 84px);
  position: relative;
  margin: calc(var(--mark-w) * 0.42) 0 calc(var(--mark-w) * 0.42);
  max-width: 1040px;
  padding:
    calc(var(--mark-w) * 0.6 + 16px)
    clamp(24px, 4.5vw, 64px)
    calc(var(--mark-w) * 0.6 + 16px);
  border: var(--border-strong);
  border-left: 6px solid var(--accent);
  background: var(--bg-card);
  box-shadow: clamp(6px, 0.7vw, 10px) clamp(6px, 0.7vw, 10px) 0 var(--shadow);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 2.6vw, 36px);
}

.cs-quote__mark {
  position: absolute;
  width: var(--mark-w);
  height: auto;
  aspect-ratio: 48 / 40;
  fill: var(--accent);
  stroke: var(--text);
  stroke-width: 1.5;
  stroke-linejoin: miter;
  paint-order: stroke;
  overflow: visible;
}
.cs-quote__mark--open {
  top: 0;
  left: clamp(24px, 4.5vw, 64px);
  transform: translateY(-50%);
}
.cs-quote__mark--close {
  bottom: 0;
  right: clamp(24px, 4.5vw, 64px);
  transform: translateY(50%) rotate(180deg);
}

.cs-quote blockquote {
  margin: 0;
}

.cs-quote blockquote p {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 600;
  line-height: 1.22;
  text-wrap: pretty;
}

.cs-quote figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.cs-quote figcaption::before {
  content: '';
  width: 40px;
  height: 1.5px;
  background: var(--text);
}

.cs-quote__name {
  font-weight: 600;
  font-size: 16px;
}

.cs-quote__role {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}


/* ---------- Closing CTA (dark band) ---------- */
.cs-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
}

.cs-cta__h {
  flex: 1 1 480px;
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.02;
}

.cs-cta .btn--lg {
  max-width: none;
  white-space: normal;
  text-align: center;
}
