/* Case-study template. Builds on the tokens and grid in style.css */

.back {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.back:hover { color: var(--ink); }

/* Head: title on the left, meta + summary on the right */
.case-head {
  padding-top: 40px;
  padding-bottom: 48px;
}
.case-main { grid-column: 1 / -1; }
.case-num {
  display: block;
  margin-top: 40px;
  font-size: 0.8rem;
  color: var(--muted);
}
.case-title {
  margin-top: 12px;
  font-weight: 500;
  font-size: clamp(2.2rem, 5.2vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 14ch;
}
.case-side { grid-column: 1 / -1; margin-top: 40px; }
.meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px var(--gutter);
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.case-summary {
  margin-top: 32px;
  font-size: 1.1rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 46ch;
}

@media (min-width: 800px) {
  .case-head { padding-top: 56px; padding-bottom: 80px; }
  .case-main { grid-column: 1 / span 7; }
  .case-side { grid-column: 8 / -1; margin-top: 0; padding-top: 2.4rem; }
  .meta-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Full-width image slot */
.case-image { padding-bottom: 8px; }
.case-image figure { grid-column: 1 / -1; margin: 0; }
.case-image img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  background: #f2f2f2;
}

/* Body sections: label in the rail, content on the right */
.case-section .content > * + * { margin-top: 1em; }
.case-note { color: var(--muted); }
.case-note a { color: var(--ink); border-bottom: 1px solid currentColor; }

/* Next project */
.case-next .next-link {
  display: block;
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  transition: color 0.2s ease;
}
.case-next .next-link:hover { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .back, .case-next .next-link { transition: none; }
}

/* ---------- Long-form case-study body ---------- */
.case-section { padding-top: 48px; padding-bottom: 48px; }
@media (min-width: 800px) { .case-section { padding-top: 64px; padding-bottom: 64px; } }

.case-body > * + * { margin-top: 1em; }
.case-body h2 {
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 26ch;
}
.case-body > * + h2 { margin-top: 2.4em; }
.case-body h3 {
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin-top: 1.8em;
}
.case-body p,
.case-body li { font-size: 1.05rem; line-height: 1.6; max-width: 62ch; }
.case-body ul { list-style: disc; padding-left: 1.2em; }
.case-body li + li { margin-top: 0.5em; }
.case-body strong { font-weight: 600; }
.case-body a { border-bottom: 1px solid currentColor; }

.case-body .kicker { font-size: 0.8rem; color: var(--muted); margin-bottom: -0.4em; }
.case-body .kicker + h2 { margin-top: 0.5em; }
.case-body .case-statement {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 30ch;
}
.case-body .case-quote {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 34ch;
  margin: 1.6em 0;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}
.case-body .case-note { font-size: 0.9rem; color: var(--muted); }

/* Big-number rows */
.case-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px var(--gutter);
  border-top: 1px solid var(--ink);
  padding-top: 14px;
  max-width: 62ch;
}
.stat-label { display: block; font-size: 0.8rem; color: var(--muted); }
.stat-num {
  display: block;
  font-size: clamp(1.8rem, 3.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.case-body .stat-line {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--muted);
}
.case-body .stat-line b { color: var(--ink); font-weight: 500; }

/* Captions for image slots (images are added later) */
.case-body .case-captions { list-style: none; padding-left: 0; }
.case-body .case-captions li {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 10px 0;
  border-top: 1px solid var(--hair);
}
.case-body .case-captions li:last-child { border-bottom: 1px solid var(--hair); }

.callout { border-top: 1px solid var(--hair); padding-top: 14px; margin-top: 1.6em; }
.case-body .callout h3 { margin-top: 0; }
.callout p { margin-top: 0.4em; }

/* External links under the summary */
.case-links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.9rem; }
.case-links a { border-bottom: 1px solid currentColor; }
