/* The dark theme's rules that a token cannot express. Every selector here starts with :root[data-theme="dark"], so nothing in this file can touch the light theme
   (the default for everybody; tests/test_theme.py checks it). The colours themselves are tokens in tokens.css (the palette: an evening kitchen, see the comment there). */

/* Grandma and the other drawings are black ink on a transparent background, and the ink vanishes on a dark page. A thin cut-out edge in the ink colour, like a sticker, brings it back.
   On the home page: the logo on the black strip, the wordmark and the cookie in the masthead and the waving Grandma on the sheet. */
:root[data-theme="dark"] :is(.fig img, .gz-brand img, .gz-nameplate img, .gz-motto img, .gz-wave) {
  filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink));
}

/* The home page's newspaper under a lamp: a halftone portrait is a light print pasted on the dark sheet (it multiplies into the paper by day, which would make it vanish). */
:root[data-theme="dark"] .gz-print { background: color-mix(in srgb, var(--clip), black 12%); mix-blend-mode: normal; }

/* A sticky note stays a light pastel note with dark ink on a dark page (softened a shade, tokens.css). Text colour is inherited from the page, so every surface that has a pastel
   background is listed here and is handed the note tokens: the light theme's own kind of page and ink, in the dark palette's soft pastels (and its scribble colours: `initial`
   makes annotations.js fall back to the template's colours). Anything inside a note, a text box, a nested card, a link, looks as it does in the light theme. A new note, chip or
   stamp with a pastel background must be added to this list: tests/test_theme.py reads the stylesheets and fails when one is missing. :where() keeps the specificity at zero, so
   a component's own colours still win. */
:where(:root[data-theme="dark"]) :where(
  .btn:not(.btn--plain), .btn--plain:hover, .countdown, .oops, .num,
  .note, .stage-note, .sticky, .clip, .callout, .demand, .g-toc, .slot[data-tier], .slot:hover, .sticker[aria-pressed="true"], .sticker:hover:not(.is-auto),
  .dash-flash, .dash-note, .mini, .shortcut, .slip, .stamp, .order-fact:nth-child(2), .order-fact:nth-child(3), .order-sums, .sum-warn,
  .error-note, .error-hint, .dnote-body, .project-status, .share-note, .pub-card, .pub-note, .pub-row, .pub-stamp,
  .badge--kind, .badge--out, .badge--ribbon, .badge--stock, .guest-note, .howto-note, .price-tag, .shelf-label,
  .submit-note, .submit-checks, .check, .sug-flash, .sug-mystery, .sug-jar, .sug-sort:hover, .sug-sort[aria-current], .sug-state--voted, .sug-top, .pick,
  .prose :not(pre) > code, .prose th, .prose .slack-name, .prose a:hover, .g-nav a[aria-current="page"], .g-nav li a:hover, .faq-item summary:hover,
  .gz-p1, .gz-p2, .gz-p3, .gz-cap, .gz-cut, .gz-hl
) {
  color-scheme: light;
  color: var(--ink);
  --canvas: var(--note-canvas);
  --ink: var(--note-ink);
  --link: var(--note-link);
  --red: var(--note-red);
  --ribbon: var(--note-ribbon);
  --on-fill: var(--note-on-fill);
  --placeholder: var(--note-placeholder);
  --rule-line: var(--note-rule);
  --mark-highlight: initial;
  --mark-underline: initial;
  --mark-circle: initial;
  --mark-strike-through: initial;
}
