/* Palette for rbx-cli's documentation site.
 *
 * Additive, on top of mdBook's own themes rather than replacing them: this
 * file only sets variables, so an mdBook upgrade that changes a layout rule
 * still applies and nothing here has to be re-synced. Removing it is deleting
 * two lines from book.toml.
 *
 * Every pair below is at least 4.5:1 (WCAG AA), including the two cases a
 * palette usually misses: a link sitting on a code background, and table
 * borders on a page that is mostly tables.
 *
 * Three decisions worth stating, because they are the ones somebody would
 * otherwise "fix":
 *
 * 1. Links stay blue. Every paragraph on this site carries two or three
 *    cross-references, so link colour is read more often than anything else
 *    here and a learned affordance is worth more than novelty. Identity does
 *    not go here.
 * 2. The identity is one copper accent, used in three places only: the active
 *    sidebar entry, the blockquote rule, the search mark. Spent anywhere else
 *    it becomes a second link colour and the first stops meaning anything.
 * 3. Inline code is terracotta rather than the body colour, so `--place-id`
 *    and a link are told apart without clicking. On pages where the two sit in
 *    the same sentence constantly, that is the difference worth paying for.
 */

/* ── Light ─────────────────────────────────────────────────────────────── */
.light,
html:not(.js) {
  /* Off-white and near-black rather than #fff on #000: the pair still measures
   * 15.5:1, without the glare that makes long prose tiring. */
  --bg: #fdfdfc;
  --fg: #1f2328;

  --links: #0b5fa5; /* 6.46:1 on bg, 5.80:1 on the code background */
  --inline-code-color: #8a3a1e; /* 6.85:1 on the code background */

  --sidebar-bg: #f5f6f4;
  --sidebar-fg: #2b3038;
  --sidebar-active: #a34e12; /* the copper, one of three uses */
  --sidebar-non-existant: #9aa0a6;
  --sidebar-spacer: #e6e8e3;
  --sidebar-header-border-color: #e0e2dd;

  /* A 1.03:1 step off the page. Enough to read a block as a block; not enough
   * to become a slab on pages that are half code. */
  --quote-bg: #f0f1ee;
  --quote-border: #a34e12; /* copper, use two of three */

  --table-border-color: #d5d8d2; /* 1.41:1 — visible in a dense table, not noise */
  --table-header-bg: #eceee8;
  --table-alternate-bg: #f7f8f5;

  --searchbar-bg: #ffffff;
  --searchbar-fg: #1f2328;
  --searchbar-border-color: #d5d8d2;
  --searchresults-border-color: #e0e2dd;
  --searchresults-li-bg: #f7f8f5;
  --searchresults-header-fg: #5c6370;
  --search-mark-bg: #f3d9b8; /* copper, use three of three */

  --icons: #6b7280;
  --icons-hover: #1f2328;
  --scrollbar: #c2c6bd;
  --theme-popup-bg: #ffffff;
  --theme-popup-border: #d5d8d2;
  --theme-hover: #eceee8;
  --overlay-bg: rgba(31, 35, 40, 0.4);
  --warning-border: #a34e12;
}

/* ── Dark ──────────────────────────────────────────────────────────────── */
.ayu,
.coal,
.navy {
  --bg: #14171a;
  --fg: #c9d1d9; /* 11.66:1 */

  --links: #6cb6ff; /* 8.37:1 on bg, 7.55:1 on the code background */
  --inline-code-color: #e8a87c; /* 7.97:1 on the code background */

  --sidebar-bg: #0e1114;
  --sidebar-fg: #b3bcc5;
  --sidebar-active: #d98b4a;
  --sidebar-non-existant: #5b636b;
  --sidebar-spacer: #1e2429;
  --sidebar-header-border-color: #232a30;

  --quote-bg: #1c2126;
  --quote-border: #d98b4a;

  --table-border-color: #2a3038; /* 1.35:1 */
  --table-header-bg: #1c2126;
  --table-alternate-bg: #181c21;

  --searchbar-bg: #1c2126;
  --searchbar-fg: #c9d1d9;
  --searchbar-border-color: #2a3038;
  --searchresults-border-color: #232a30;
  --searchresults-li-bg: #181c21;
  --searchresults-header-fg: #8b949e;
  --search-mark-bg: #5a3d22;

  --icons: #7d868f;
  --icons-hover: #c9d1d9;
  --scrollbar: #3a424a;
  --theme-popup-bg: #1c2126;
  --theme-popup-border: #2a3038;
  --theme-hover: #232a30;
  --overlay-bg: rgba(0, 0, 0, 0.55);
  --warning-border: #d98b4a;
}
