/* Design tokens: palettes, type, measures, and the 61 motif.
 *
 * Shared by the back office and the public site. Nothing here styles a
 * component; it only names the values the components are drawn from, so a
 * second surface can adopt the whole system by loading this file first.
 */

:root {
  color-scheme: light;

  --ground: #eef1f3;
  --surface: #ffffff;
  --surface-sunken: #e3e9ec;
  --ink: #16202b;
  --muted: #4a5764;
  --rule: #c7d1d9;
  --bloc-a: #0b6e6e;
  --bloc-b: #96600a;
  --bloc-c: #6b3fa0;
  --unaffiliated: #5f6b78;
  --alert: #a3231b;
  --majority: #16202b;
  /* Party steps move away from the page: darker on light, lighter on dark. */
  --shade-toward: #000000;

  /* Three families, three jobs, and the split is the point: the argument is
     set in a serif, the apparatus in a grotesque, the data in mono.
     Newsreader carries the sentences a reader has to weigh -- the verdict, the
     headings, the caveats -- and has a real optical-size axis, so display and
     body sizes are drawn for their size rather than scaled. Archivo carries
     the figures and the chrome; its width axis lets a seat count be set the
     way broadcast election graphics and printed results tables have always set
     them. Plex Mono keeps the tables aligned. */
  --prose: Newsreader, Georgia, serif;
  --display: Archivo, "Helvetica Neue", sans-serif;
  --body: Archivo, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* The 61 rule, drawn the same way in every chart. */
  --majority-dash: 5 4;
  --majority-width: 1.5px;

  --page: 1420px;
  --rail: 19rem;
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ground: #101619;
    --surface: #182126;
    --surface-sunken: #131b1f;
    --ink: #e8eef1;
    --muted: #a2b3be;
    --rule: #2a3940;
    --bloc-a: #3aada7;
    --bloc-b: #d69a3c;
    --bloc-c: #a988e0;
    --unaffiliated: #8697a6;
    --alert: #e8776d;
    --majority: #e8eef1;
    --shade-toward: #ffffff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ground: #101619;
  --surface: #182126;
  --surface-sunken: #131b1f;
  --ink: #e8eef1;
  --muted: #a2b3be;
  --rule: #2a3940;
  --bloc-a: #3aada7;
  --bloc-b: #d69a3c;
  --bloc-c: #a988e0;
  --unaffiliated: #8697a6;
  --alert: #e8776d;
  --majority: #e8eef1;
  --shade-toward: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-variation-settings: "wdth" 100;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }


/* ---- Hebrew ------------------------------------------------------------ */

/* Two families, chosen to sit together rather than merely to exist.
 *
 * Frank Ruhl Libre is the Hebrew publication serif -- Frank-Rühl has set
 * Hebrew newspapers since 1908 -- so it takes the prose role Newsreader has in
 * Latin. Assistant takes the chrome and the figures: it is the sans most
 * Israeli publishing and interface work is set in, and unlike the alternatives
 * it carries the full weight range this design uses.
 *
 * The stacks are ordered so the *fallback chain does the translating*. Latin
 * faces come first and have no Hebrew glyphs, so Latin numerals still render
 * in Archivo and Plex Mono while every Hebrew character falls through to the
 * Hebrew face. That is what fixes the third font nobody chose: `--mono` had no
 * Hebrew at all, so a Hebrew figure label was being set by whatever the
 * operating system happened to offer.
 */
[lang="he"] {
  --prose: "Frank Ruhl Libre", Georgia, serif;
  --display: Archivo, Assistant, "Helvetica Neue", sans-serif;
  --body: Assistant, system-ui, sans-serif;
  --mono: "IBM Plex Mono", Assistant, ui-monospace, monospace;
}

/* Hebrew reads smaller than Latin at the same nominal size: the letterforms
   are uniform in height, with no ascenders or descenders to give a word its
   silhouette, so the eye has less to work with. It wants a step up and more
   leading, not the step down this file used to apply. */
[lang="he"] body { font-size: 17px; line-height: 1.7; }
[lang="he"] .prose { font-size: 1.16rem; line-height: 1.85; }
[lang="he"] .plate .rail p { font-size: 1rem; line-height: 1.7; }
[lang="he"] .card .dek,
[lang="he"] .article-head .dek { line-height: 1.6; }

/* The mono role is a Latin convention -- tabular figures and small caps. In
   Hebrew there are no capitals to letter-space and no monospaced tradition, so
   Hebrew set in that role drops the tracking and the uppercasing rather than
   faking them. */
[lang="he"] .band-label { font-size: 14px; }
[lang="he"] .majority-label { font-size: 13px; letter-spacing: 0; text-transform: none; }

[lang="he"] th,
[lang="he"] .eyebrow,
[lang="he"] .kicker,
[lang="he"] .figures span,
[lang="he"] .coal-stats span,
[lang="he"] .section-head h2,
[lang="he"] .plate .rail h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}

[dir="rtl"] .num,
[dir="rtl"] .mono-ltr { direction: ltr; unicode-bidi: isolate; }
