/* ──────────────────────────────────────────────────────────────────────────
   DND — The Ledger (/ledger.html)

   The one page that reads the corpus as a whole instead of as a feed.
   Every month of digests, the desk's own scores, the tags, the reader
   questions, and the market tickers — each panel answering one
   question, each number in mono so a column of them can be read down.

   House rules that shaped this file: 4px grid, radius 0, no shadow, no
   blur, depth by surface colour only, every number that changes in
   tabular mono, and no panel that earns its space by being empty.
   ────────────────────────────────────────────────────────────────────────── */

.lg-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--s5) var(--s4) var(--s8);
}

/* ── masthead ───────────────────────────────────────────────────────── */

/* Two columns: the argument on the left, the claim on the right. A
   full-width lede with 700px of nothing beside it is a void, and the
   thesis is the second thing the eye should reach. */
.lg-mast {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--s6) var(--s7);
  align-items: start;
  margin-bottom: var(--s5);
}
.lg-mast h1 {
  font-family: var(--font-display);
  font-size: var(--size-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s3);
}
.lg-mast .lg-lede {
  font-size: var(--size-body);
  line-height: 1.55;
  color: var(--text-1);
  max-width: 62ch;
  margin: 0;
}
.lg-mast .lg-stamp {
  font-family: var(--font-mono);
  font-size: var(--size-caption);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  margin-top: var(--s3);
}

/* ── the thesis: the one sentence the page argues ───────────────────── */

.lg-thesis {
  border-left: 3px solid var(--accent);
  padding-left: var(--s3);
  margin: 0;
}
.lg-thesis p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.42;
  color: var(--text);
  letter-spacing: -0.005em;
}
.lg-thesis em { font-style: normal; color: var(--accent-ink); }
.lg-thesis .lg-thesis-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s2);
}

/* ── grid ───────────────────────────────────────────────────────────── */

.lg-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s6) var(--s5);
  /* A panel hugs its content. Without this the grid stretches every
     panel to the height of the tallest one in its row, and the shorter
     panel carries hundreds of pixels of space it never asked for. */
  align-items: start;
}
.lg-col-4  { grid-column: span 4; }
.lg-col-5  { grid-column: span 5; }
.lg-col-7  { grid-column: span 7; }
.lg-col-8  { grid-column: span 8; }
.lg-col-12 { grid-column: span 12; }

/* ── panels ─────────────────────────────────────────────────────────── */

.lg-panel { border-top: 2px solid var(--line-2); padding-top: var(--s3); min-width: 0; }
.lg-panel-head { margin-bottom: var(--s4); }
.lg-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s1);
}
.lg-panel h2 {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s2);
}
.lg-panel .lg-q {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
  max-width: 60ch;
}
.lg-panel .lg-q strong { color: var(--text-1); font-weight: 600; }

/* ── the numbers strip ──────────────────────────────────────────────── */

.lg-stats { display: flex; flex-direction: column; gap: var(--s3); }
/* The corpus band: five numbers across the width, ruled apart. It sits
   under the headline because these are the page's summary, and because a
   column of five stacked stats beside the hero chart left the chart's
   own column short. */
.lg-stats.lg-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 var(--s5);
}
.lg-stats.lg-band .lg-stat {
  border-bottom: 0;
  border-right: 1px solid var(--line);
  padding: 0 var(--s5) 0 0;
}
.lg-stats.lg-band .lg-stat:last-child { border-right: 0; padding-right: 0; }
.lg-head-row {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.lg-head-row .lg-eyebrow { margin-bottom: 0; }
.lg-head-row h2 { margin: 0; }
.lg-stat { border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.lg-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.lg-stat dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s1);
}
.lg-stat dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--text);
}
.lg-stat dd small {
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ── charts ─────────────────────────────────────────────────────────── */

.lg-chart { width: 100%; height: auto; display: block; overflow: visible; }
.lg-chart text { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lg-axis { fill: var(--text-3); font-size: 10px; letter-spacing: 0.08em; }
.lg-axis-strong { fill: var(--text-2); font-size: 10px; letter-spacing: 0.08em; }
.lg-value { fill: var(--text-1); font-size: 11px; }
/* The category mark. The hue is set inline from the site's one category
   map; this rule is only the fallback. It used to be a presentation
   attribute on .lg-value, and a CSS rule beats a presentation
   attribute — so every category mark rendered in the same grey and the
   colour never reached the screen. */
.lg-glyph { fill: var(--text-1); color: var(--text-1); font-size: 11px; }
.lg-gridline { stroke: var(--line); stroke-width: 1; }
.lg-rule { stroke: var(--line-2); stroke-width: 1; }
.lg-bar { fill: var(--bg-3); }
.lg-bar-hi { fill: var(--accent); }
.lg-bar-cool { fill: var(--data); }
.lg-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lg-line-cool { fill: none; stroke: var(--data); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lg-line-ctrl { fill: none; stroke: var(--text-1); stroke-width: 1.5; stroke-dasharray: 4 3; }
.lg-dot { fill: var(--accent); }
.lg-dot-cool { fill: var(--data); }
.lg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s4);
  margin-top: var(--s3);
  font-size: 0.78rem;
  color: var(--text-2);
}
.lg-legend span { display: inline-flex; align-items: center; gap: var(--s1); }
.lg-key { width: 18px; height: 0; border-top-width: 2px; border-top-style: solid; display: inline-block; }
.lg-key.dash { border-top-style: dashed; border-top-width: 1.5px; }
.lg-key.box { height: 10px; border: 0; background: var(--bg-3); }

/* ── the finding under a chart ──────────────────────────────────────── */

.lg-finding {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-1);
  margin: var(--s4) 0 0;
  max-width: 64ch;
}
.lg-finding strong { color: var(--accent-ink); font-weight: 600; }
.lg-note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-3);
  margin: var(--s2) 0 0;
  max-width: 68ch;
}
/* The boundary line: what this page owns, and where the rest of the desk's
   numbers live. It is a note, not a panel — it earns its place by stopping
   the reader from hunting for the same figure on two pages. */
.lg-boundary {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-2);
  margin: var(--s4) 0 0;
  max-width: 92ch;
  border-left: 2px solid var(--line);
  padding-left: var(--s3);
}
.lg-boundary a { color: var(--text-1); }

/* ── ranked lists (readers, constellation, money) ───────────────────── */

.lg-list { display: flex; flex-direction: column; }
.lg-row {
  display: grid;
  grid-template-columns: var(--lg-row-cols, minmax(0, 1fr) 84px auto);
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}
.lg-row:last-child { border-bottom: 0; }
.lg-row .lg-k {
  font-size: 0.88rem;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lg-row .lg-k b { color: var(--text); font-weight: 600; }
.lg-row .lg-n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: right;
  white-space: nowrap;
}
.lg-row .lg-bar { height: 6px; background: var(--bg-3); position: relative; min-width: 0; }
.lg-row .lg-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); display: block; }
.lg-row .lg-bar.cool i { background: var(--data); }
.lg-row .lg-bar.mute i { background: var(--line-2); }

.lg-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: var(--s4) 0 var(--s2);
  padding-bottom: var(--s1);
  border-bottom: 1px solid var(--line);
}

/* ── the core: one tag, three months, one change ──────────────────── */

.lg-row.core { --lg-row-cols: 1fr repeat(3, 84px) 58px; }
.lg-row.core .lg-bar { height: 8px; }
.lg-row.core.head { padding-bottom: var(--s1); border-bottom: 1px solid var(--line-2); }
.lg-row.core.head .lg-n {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-align: center;
}
.lg-row.core.head .lg-n:last-child { text-align: right; }
.lg-row.core .lg-n { text-align: center; }
.lg-row.core .lg-n:last-child { text-align: right; }

/* ── splits inside a panel ─────────────────────────────────────────── */

.lg-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.lg-split3 { display: grid; grid-template-columns: 1.35fr 1fr 1.15fr; gap: var(--s5); }
.lg-tickers { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.lg-stats.lg-inline { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3) var(--s4); }
.lg-stats.lg-inline .lg-stat { border-bottom: 0; padding-bottom: 0; }

/* ── the verdict: a null result, stated plainly ─────────────────────── */

.lg-verdict {
  border: 1px solid var(--line-2);
  padding: var(--s4);
  background: var(--bg-1);
}
.lg-verdict h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s2);
  font-weight: 400;
}
.lg-verdict p { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--text-1); }
.lg-verdict p b { color: var(--text); }
.lg-verdict p .up { color: var(--accent-ink); }
.lg-verdict p .dn { color: var(--data); }

/* ── per-source check table ─────────────────────────────────────────── */

.lg-check { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.78rem; }
.lg-check th {
  text-align: left;
  font-weight: 400;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 var(--s2) var(--s1) 0;
  border-bottom: 1px solid var(--line-2);
}
.lg-check td {
  padding: var(--s1) var(--s2) var(--s1) 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.lg-check td:first-child { font-family: var(--font-sans); font-size: 0.82rem; color: var(--text); }
/* The sample sizes under the two hype# figures: a delta without them is a
   number the reader cannot check. */
.lg-check td small {
  display: block;
  font-size: 0.66rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
/* Up and down are shown by brightness, not by hue. Saffron and blue belong
   to mean hype# and mean lean# in the arc legend; reusing them here made
   "rose" read as "hot". */
/* Up and down are shown by brightness, not by hue. Saffron and blue belong
   to mean hype# and mean lean# in the arc legend; reusing them here made
   "rose" read as "hot". These were scoped to .lg-check, so the same
   classes on the core rows did nothing at all. */
.lg-delta-up { color: var(--text-1); }
.lg-delta-dn { color: var(--text-3); }
.lg-delta-none { color: var(--text-3); }
.lg-check tr:last-child td { border-bottom: 0; }

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .lg-col-4, .lg-col-5, .lg-col-7, .lg-col-8 { grid-column: span 12; }
  .lg-mast { grid-template-columns: 1fr; gap: var(--s4); }
  .lg-split3 { grid-template-columns: 1fr 1fr; }
  .lg-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3) var(--s5); }
  .lg-stat { border-bottom: 0; }
  /* The band has to be told separately: it carries two classes, so it
     out-specifies the rule above and would stay five across on a phone. */
  .lg-stats.lg-band { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--s4); }
  .lg-stats.lg-band .lg-stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 var(--s2);
  }
  /* Five cells in three columns leaves one empty cell. The last stat
     takes the row instead of leaving the grid to invent the space. */
  .lg-stats.lg-band .lg-stat:last-child { grid-column: span 2; }
}

@media (max-width: 640px) {
  .lg-page { padding: var(--s4) var(--s3) var(--s7); }
  .lg-grid { gap: var(--s5) var(--s3); }
  .lg-mast h1 { font-size: 2.4rem; }
  .lg-split, .lg-split3, .lg-tickers { grid-template-columns: 1fr; gap: var(--s4); }
  .lg-stats { grid-template-columns: 1fr; gap: var(--s2); }
  .lg-stat { border-bottom: 1px solid var(--line); padding-bottom: var(--s2); }
  .lg-stat:last-child { border-bottom: 0; }
  .lg-stats.lg-band { grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); }
  .lg-stats.lg-band .lg-stat { border-bottom: 1px solid var(--line); padding: 0 0 var(--s2); }
  .lg-stats.lg-band .lg-stat:last-child { grid-column: 1 / -1; }
  /* On a phone the bar goes under its own label rather than being
     squeezed into a column too narrow to read. */
  .lg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lg-row .lg-bar { grid-column: 1 / -1; }
  .lg-row.core { grid-template-columns: minmax(0, 1fr) repeat(3, 1fr); }
  .lg-row.core .lg-bar { display: none; }
  .lg-row.core .lg-n { text-align: center; }
  .lg-row.core .lg-n:last-child { text-align: right; }
  .lg-check { font-size: 0.72rem; }
  .lg-check td:first-child { font-size: 0.76rem; }
}

/* ── a stack of panels inside one grid column ──────────────────────── */

.lg-stack { display: flex; flex-direction: column; gap: var(--s6); min-width: 0; }

/* ── the charts come in two geometries ────────────────────────────────
   A 900-unit-wide viewBox scaled into a 342px phone renders its 10px
   labels at 4px. So the charts are drawn twice — once wide, once
   compact — and the CSS picks one. Same numbers, readable type. */

.lg-chart-compact { display: none; }

@media (max-width: 760px) {
  .lg-chart-wide { display: none; }
  .lg-chart-compact { display: block; }
}
