/* ============================================================================
   article.css — research article / prose pages (two-column journal layout)
   Loaded AFTER css/styles.css (tokens, nav, kicker, btn, cta-band, footer,
   reveal) and css/pareto.css (.mast, .nav--solid).

   Layout: a centered container (~72rem) holds the masthead and the body. Prose
   sections are a 2-column grid — a reading column plus a right rail for figures,
   pull-stats, quotes, and margin notes. Big signature diagrams, comparison
   grids, tables, and the benchmark callout span the full width as "plates".
   ========================================================================== */

:root { --art-max: 72rem; }

/* Center the masthead on the same axis as the body. */
.page .mast { max-width: var(--art-max); margin-left: auto; margin-right: auto; }

.article {
  max-width: var(--art-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vh, 3rem) var(--gutter) 0;
}

/* ---- Sections -------------------------------------------------------------- */
.asec {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 3.5vw, 3.5rem);
  align-items: start;
  padding: clamp(2rem, 5vh, 3.2rem) 0;
  border-top: 1px solid rgba(29, 74, 56, 0.12);
}
.asec:first-of-type { border-top: 0; }

/* Full-width plate: big figures, comparison grids, tables, the callout. */
.asec--wide { display: block; }
.asec--wide > * { max-width: none; }

.asec__body { min-width: 0; }
.asec__aside { min-width: 0; }
.asec__aside > * + * { margin-top: 1.7rem; }

.asec__k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.9rem;
}
.asec h2 {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 1rem;
}
.asec h2 em { color: var(--forest); font-style: italic; }
.asec h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--forest);
  margin: 1.7rem 0 0.5rem;
}
.asec p {
  font-size: 1.02rem;
  line-height: 1.66;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.asec p strong { color: var(--ink); font-weight: 600; }
.asec .lead { font-size: 1.16rem; line-height: 1.55; color: var(--ink); }

/* Inline mono term. */
.term {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--forest);
  background: var(--parchment-deep);
  padding: 0.05em 0.35em;
  border-radius: 2px;
}

/* ---- Right-rail components ------------------------------------------------- */
/* Pull-stat: a big serif number with a mono label. */
.aside__stat { border-top: 2px solid var(--forest); padding-top: 0.7rem; }
.aside__stat .n {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(2.3rem, 5vw, 3.2rem);
  line-height: 0.95;
  color: var(--forest);
  display: block;
}
.aside__stat .l {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin-top: 0.5rem;
  display: block;
  line-height: 1.5;
}

/* Pull-quote. */
.aside__quote {
  margin: 0;
  border-left: 2px solid var(--terracotta);
  padding-left: 1.1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.42;
  color: var(--forest);
}

/* Mono margin note. */
.aside__note {
  border-top: 1px solid rgba(29, 74, 56, 0.14);
  padding-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.62;
  color: var(--ink-soft);
}
.aside__note b { color: var(--forest); font-weight: 500; }
.aside__note .k {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.5rem;
}

/* Small figure in the rail. */
.aside__fig { }
.aside__fig svg { display: block; width: 100%; height: auto; }
.aside__fig .figure__cap { margin-top: 0.7rem; }

/* ---- Figures / plates ------------------------------------------------------ */
.figure {
  margin: 0.4rem 0;
  padding: 1.5rem 1.6rem 1.2rem;
  background: var(--parchment-deep);
  border: 1px solid rgba(29, 74, 56, 0.12);
  border-radius: 2px;
}
.figure--plate { margin: 0.4rem 0 0; padding: 2rem 2.2rem 1.4rem; }
.figure svg { display: block; width: 100%; height: auto; }
.figure__cap {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sage);
  margin-top: 1rem;
}

/* Benchmark tie-back, forest panel (full-width plate). */
.measure {
  margin: 0.4rem 0;
  padding: 1.7rem 1.9rem;
  background: var(--forest);
  border-radius: 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  align-items: start;
}
.measure__k {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}
.measure p { color: rgba(246, 241, 232, 0.9); margin: 0; font-size: 0.98rem; line-height: 1.62; }
.measure em { color: var(--parchment); font-style: italic; }
.measure a { color: var(--parchment); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(246, 241, 232, 0.4); }
.measure a:hover { text-decoration-color: var(--parchment); }

/* Three-up comparison (kinds of RAG). */
.cmp { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); margin: 0.4rem 0; }
.cmp__col {
  padding: 1.2rem 1.2rem 1.3rem;
  background: var(--parchment-deep);
  border: 1px solid rgba(29, 74, 56, 0.12);
  border-radius: 2px;
}
.cmp__tag { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; color: var(--sage); text-transform: uppercase; }
.cmp__col h4 { font-family: var(--serif); font-weight: 500; color: var(--forest); font-size: 1.08rem; margin: 0.35rem 0 0.5rem; }
.cmp__col p { font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.cmp__col svg { display: block; width: 100%; height: auto; margin-bottom: 0.7rem; }

/* Ruled comparison table. */
.atable-wrap { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; margin: 0.4rem 0; font-size: 0.92rem; min-width: 34rem; }
.atable caption {
  text-align: left; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--sage); padding-bottom: 0.6rem;
}
.atable th, .atable td {
  text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid rgba(29, 74, 56, 0.12); vertical-align: top;
}
.atable thead th {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--sage); font-weight: 500;
}
.atable td { color: var(--ink-soft); line-height: 1.5; }
.atable tbody th, .atable td:first-child { font-family: var(--serif); font-weight: 500; color: var(--forest); }

/* ---- Chapter previous / next ---------------------------------------------- */
.chapnav {
  max-width: var(--art-max);
  margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1.5rem;
  padding: 2rem var(--gutter) 0; border-top: 1px solid rgba(29, 74, 56, 0.12);
}
.chapnav a { text-decoration: none; max-width: 20rem; }
.chapnav .np { text-align: right; margin-left: auto; }
.chapnav__dir { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); display: block; margin-bottom: 0.3rem; }
.chapnav__ttl { font-family: var(--serif); font-size: 1.05rem; color: var(--forest); }
.chapnav a:hover .chapnav__ttl { color: var(--terracotta); }

/* ---- Responsive: stack the rail below the reading column ------------------- */
@media (max-width: 860px) {
  .asec { grid-template-columns: 1fr; gap: 1.5rem; }
  .asec__aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; }
  .asec__aside > * + * { margin-top: 0; }
  .measure { grid-template-columns: 1fr; }
  .cmp { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .asec, .figure, .measure, .cmp__col, .aside__stat, .aside__quote, .aside__note { transition: none !important; }
}
