/*
 * Direction: Refined editorial.
 *
 * A rulebook that has been properly typeset. Warm paper and a text serif for
 * the rules themselves, with everything that is not the rules — titles,
 * headings, navigation, labels — in a plain gothic. Colour is rationed: it
 * marks cross-references and bookmarks and does nothing else.
 *
 * Everything here is a token override — no component knows which direction is
 * running.
 */

:root[data-design="editorial"] {
  --font-serif: "Literata", var(--fallback-serif);
  --font-sans: "Libre Franklin", var(--fallback-sans);
  --font-mono: var(--fallback-mono);
  /*
   * Headings are the sans, not a display serif. Two serifs were tried above
   * this line and neither held up: Fraunces was too mannered for a page of
   * rules, and Literata — the body face heavier — left a title reading as a
   * bold paragraph rather than a title.
   *
   * A serif for the rules and a gothic for everything around them is how a
   * reference book has always been set. The change of species is what makes a
   * heading legible as a heading at a glance, which is the whole job here: at
   * a table nobody reads a title, they look for one.
   */
  --font-display: var(--font-sans);
  --font-ui: var(--font-sans);

  /* The default body face; a reader preference overrides it. */
  --font-body-default: var(--font-serif);

  --body-weight: 400;
  --display-weight: 700;
  --display-tracking: -0.014em;
  --ui-weight: 600;

  /* Literata runs large for its point size; ease the scale back a little. */
  --scale: 0.97;

  /* Nominated, not set: the reader's line-spacing control scales this. */
  --leading-normal-default: 1.66;

  /* Paper, warmed further. */
  --surface: #fcfaf6;
  --surface: light-dark(#fcfaf6, #17150f);
  --surface-sunken: #f2ede1;
  --surface-sunken: light-dark(#f2ede1, #100e0a);
  --surface-inset: #e9e2d0;
  --surface-inset: light-dark(#e9e2d0, #2a2619);

  --line: #e0d8c6;
  --line: light-dark(#e0d8c6, #342f22);

  --radius: 8px;
  --radius-lg: 16px;
}

:root[data-design="editorial"][data-density="compact"] {
  --scale: 0.91;
}

:root[data-design="editorial"][data-density="spacious"] {
  --scale: 1.06;
}

/* An old-style figure set suits running rules text; the UI wants lining. */
[data-design="editorial"] .prose {
  font-variant-numeric: oldstyle-nums proportional-nums;
}

[data-design="editorial"] .prose table,
[data-design="editorial"] .nav-tab,
[data-design="editorial"] .toc,
[data-design="editorial"] .sidebar {
  font-variant-numeric: lining-nums tabular-nums;
}

/* The editorial direction earns a rule under section headings. */
[data-design="editorial"] .section-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-3);
}
