/**
 * Case Study — scoped, light-only "document" surface.
 *
 * Ported from the case study's original embedded <style> and scoped under
 * `.case-study` so it styles only the case study article and never leaks into
 * the rest of the site. The surface keeps its own light palette regardless of
 * the site's dark mode (the SVG figures have light colors baked into their
 * markup), while the theme header/footer/nav around it still follow the active
 * theme. Loaded only on the Case Study template (see zm_assets()).
 *
 * @package Zareef_Modern
 */

.case-study {
  color-scheme: light;
  --page:       #f9f9f7;
  --surface-1:  #fcfcfb;
  --ink:        #0b0b0b;
  --ink-2:      #52514e;
  --muted:      #898781;
  --grid:       #e1e0d9;
  --baseline:   #c3c2b7;
  --border:     rgba(11, 11, 11, 0.10);
  --s1: #2a78d6;  /* blue */
  --s2: #eb6834;  /* orange */
  --s3: #1baf7a;  /* aqua */
  --s4: #eda100;  /* yellow */
  --s5: #e87ba4;  /* magenta */
  --s6: #008300;  /* green */
  --s7: #4a3aa7;  /* violet */
  --good: #0ca30c;

  max-width: 90%;
  margin: 0 auto 40px;
  padding: 8px 24px 32px;
  background: var(--page);
  color: var(--ink);
  border-radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  font-size: 16px;
}
.case-study *,
.case-study *::before,
.case-study *::after { box-sizing: border-box; }

/* Sit flush under the site header. This stylesheet loads only on the Case
   Study template, so trimming the shared content-area top padding here is
   safe and affects nothing else. */
#main.content-area { padding-top: 0; }

/* Hero */
.case-study .hero {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 14px; padding: 40px 36px; margin: 24px 0 28px;
}
.case-study .kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: 12px;
  color: var(--muted); font-weight: 600; margin: 0 0 10px; font-family: inherit;
}
.case-study h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; color: var(--ink); }
.case-study .sub { color: var(--ink-2); font-size: 17px; margin: 0; max-width: 46em; }
.case-study .withheld {
  display: inline-block; margin-top: 16px; padding: 6px 12px;
  background: #f0efec; border: 1px dashed var(--baseline); border-radius: 999px;
  font-size: 13px; color: var(--ink-2);
}

/* Headings + text */
.case-study h2 { font-size: 24px; margin: 44px 0 6px; color: var(--ink); }
.case-study h2 .no { color: var(--muted); font-weight: 600; margin-right: 8px; }
.case-study h3 { font-size: 18px; margin: 26px 0 6px; color: var(--ink); }
.case-study p  { margin: 10px 0; color: var(--ink); max-width: 62em; }
.case-study p.dim { color: var(--ink-2); }
.case-study a { color: var(--s1); text-decoration: none; }
.case-study a:hover { text-decoration: underline; }
.case-study .rule { border: 0; border-top: 1px solid var(--grid); margin: 36px 0 0; }

/* Stat tiles */
.case-study .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 20px 0 6px; }
.case-study .tile {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px;
}
.case-study .tile .v { font-size: 30px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.case-study .tile .l { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.case-study .tiny { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Figures */
.case-study figure { margin: 22px 0; background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 20px 18px 8px; }
.case-study figure svg { width: 100%; height: auto; display: block; }
.case-study figcaption { font-size: 13px; color: var(--muted); padding: 8px 6px 10px; }

/* Lists */
.case-study ul { padding-left: 22px; }
.case-study li { margin: 6px 0; color: var(--ink); }

/* Callout + panels */
.case-study .callout {
  border-left: 4px solid var(--s1); background: var(--surface-1);
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 18px 0; color: var(--ink);
}
.case-study .cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.case-study .panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.case-study .panel h4 { margin: 2px 0 8px; font-size: 15px; color: var(--ink); }

/* Footer note */
.case-study footer { margin-top: 56px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--grid); padding-top: 16px; }

/* SVG text defaults */
.case-study svg text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

@media (max-width: 720px) {
  .case-study { padding: 8px 14px 24px; }
  .case-study .cols2 { grid-template-columns: 1fr; }
  .case-study .hero { padding: 28px 22px; }
  .case-study h1 { font-size: 27px; }
}

@media print {
  .case-study { max-width: 100%; margin: 0; padding: 0; border: 0; background: #fff; }
  .case-study figure, .case-study .panel, .case-study .tile, .case-study .callout { break-inside: avoid; }
  .case-study h2 { break-after: avoid; }
  .case-study .hero { border: none; padding: 24px 0; }
}
