/* ───────────────────────────────────────────────────────────────────────────
   HELIX paper layer — scientific styling ON TOP OF helix-artifact.css.

   Use in an artifact:
     <link rel="stylesheet" href="/artifacts/lib/helix-artifact.css">
     <link rel="stylesheet" href="/artifacts/lib/helix-paper.css">

   Structure (see TEMPLATE.html for the full skeleton):
     header.paper-head  — eyebrow · title · byline (team/date/version/status)
     .abstract          — one-paragraph summary + .key results
     section.sec        — automatically numbered chapters (h2)
     figure.fig         — figure with an automatically numbered caption
     figure.tab         — table with an automatically numbered caption
     .assumption        — explicitly marked assumption (audit trail)
     section.sources    — numbered source list; inline <sup class="ref">
     .provenance        — data vintage · method · code · reproducibility

   CLASS NAMES ARE ENGLISH; the Dutch names of the first generation
   (.aanname, .aanname-blok, .formule, .symbolen, section.bronnen,
   .verantwoording, .abstract .kern, .status.concept|gereviewd|definitief) keep
   working as aliases — existing artifacts must not need a rewrite. New
   artifacts use the English names (see TEMPLATE.html).

   AUTOMATIC LABELS follow <html lang>: "Abstract / Figure / Table" for
   lang="en", "Samenvatting / Figuur / Tabel" for anything else, so Dutch
   artifacts keep their Dutch labels.
─────────────────────────────────────────────────────────────────────────── */

body { counter-reset: sec fig tab ref; max-width: 960px; }

/* ---- kop ---- */
.paper-head { margin-bottom: 22px; }
.paper-head .eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 6px;
}
.paper-head h1 { font-size: 26px; line-height: 1.2; max-width: 30ch; }
.paper-head .byline {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  margin-top: 8px; font-size: 12.5px; color: var(--ink-dim);
}
.paper-head .byline b { font-weight: 650; }
.status {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border);
}
.status.concept, .status.draft      { color: #b07c1e; border-color: #ecd9ab; background: #fdf8ec; }
.status.gereviewd, .status.reviewed { color: #0d4f9e; border-color: #bcd7f2; background: #eff6fd; }
.status.definitief, .status.final   { color: #1f7a4d; border-color: #bfe3cf; background: #effaf3; }

/* ---- abstract ---- */
.abstract {
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 3px solid var(--wbd-blue); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; margin: 0 0 22px; font-size: 14px; max-width: none;
}
.abstract::before {
  content: 'Samenvatting'; display: block;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--wbd-blue);
  margin-bottom: 6px;
}
.abstract .kern, .abstract .key { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.abstract .kern li, .abstract .key li { font-size: 13px; padding-left: 18px; position: relative; }
.abstract .kern li::before, .abstract .key li::before { content: '→'; position: absolute; left: 0; color: var(--wbd-cyan); }

/* ---- genummerde hoofdstukken ---- */
section.sec { margin-top: 30px; counter-increment: sec; }
section.sec > h2 {
  font-size: 16.5px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
section.sec > h2::before {
  content: counter(sec) '.  '; color: var(--wbd-cyan);
  font-family: var(--mono); font-weight: 700;
}
section.sec section h3::before { content: none; }

/* ---- figuren & tabellen met genummerde bijschriften ---- */
figure.fig, figure.tab { margin: 18px 0; }
figure.fig { counter-increment: fig; }
figure.tab { counter-increment: tab; }
figure.fig > figcaption, figure.tab > figcaption {
  font-size: 12.5px; color: var(--ink-dim); margin-top: 8px; line-height: 1.5;
  max-width: 90ch;
}
figure.fig > figcaption::before {
  content: 'Figuur ' counter(fig) ' — '; font-weight: 700; color: var(--ink);
}
figure.tab > figcaption::before {
  content: 'Tabel ' counter(tab) ' — '; font-weight: 700; color: var(--ink);
}
/* bijschrift boven een tabel leest prettiger */
figure.tab > figcaption { margin: 0 0 6px; }

/* ---- automatic labels in English for lang="en" artifacts ----
   The base rules above stay Dutch, so first-generation artifacts (lang="nl")
   keep reading "Samenvatting / Figuur / Tabel" without being touched. */
html[lang|="en"] .abstract::before { content: 'Abstract'; }
html[lang|="en"] figure.fig > figcaption::before { content: 'Figure ' counter(fig) ' — '; }
html[lang|="en"] figure.tab > figcaption::before { content: 'Table ' counter(tab) ' — '; }

/* ---- assumptions marked explicitly (audit trail) ---- */
.aanname, .assumption {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: #b07c1e;
  background: #fdf8ec; border: 1px solid #ecd9ab; border-radius: 4px;
  padding: 0 6px; vertical-align: 1px;
}
.aanname-blok, .assumption-box {
  background: #fdf8ec; border: 1px solid #ecd9ab; border-left: 3px solid #d9a93f;
  border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 12px 0; font-size: 13px;
}

/* ---- formulas (native MathML — no JS lib needed) + symbol table ---- */
.formule, .formula {
  background: #f6f9fc; border: 1px solid #dbe6ef; border-left: 3px solid var(--wbd-blue);
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 12px 0;
}
.formule math, .formula math { font-size: 1.15em; }
.formule .symbolen, .formula .symbols { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-dim); border-collapse: collapse; }
/* Symbol rows read left-to-right (symbol · meaning · unit · origin), so they
   override the right-aligned numeric default of the base table style. */
.formule .symbolen td, .formula .symbols td { padding: 2px 14px 2px 0; vertical-align: top; text-align: left; }
.formule .symbolen td:first-child, .formula .symbols td:first-child { font-family: var(--mono); white-space: nowrap; color: var(--ink); }

/* ---- sources ---- */
sup.ref { font-family: var(--mono); font-size: 10px; color: var(--wbd-blue); }
sup.ref a { text-decoration: none; }
section.bronnen ol, section.sources ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 6px; }
section.bronnen li, section.sources li { font-size: 12.5px; color: var(--ink-dim); }
section.bronnen li b, section.sources li b { color: var(--ink); }
section.bronnen li .vintage, section.sources li .vintage { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* ---- provenance ---- */
.verantwoording, .provenance {
  margin-top: 28px; border-top: 2px solid var(--ink); padding-top: 12px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 22px;
  font-size: 12px; color: var(--ink-dim);
}
.verantwoording .vh, .provenance .vh {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 2px;
}

/* ---- print ---- */
@media print {
  body { max-width: none; padding: 0; font-size: 11pt; }
  .paper-head h1 { font-size: 20pt; }
  .chart-wrap, .plot3d { break-inside: avoid; }
  figure.fig, figure.tab, .card { break-inside: avoid; }
  a { color: inherit; }
  .verantwoording, .provenance { border-top-color: #000; }
}
