/* ============================================================
   TUDOTYPE — Dark Mode Overrides
   Applied when body.dark-mode is active.
   Accent colours remain constant — only surface, ink, and
   border tokens are overridden.
   ============================================================ */

/* Match on both html.dark-mode (set before body exists to prevent flash)
   and body.dark-mode (set after DOMContentLoaded for JS compat).
   Also a dark island in either mode: an article whose ground is a dark fixed-background
   clock (ARTICLE in components.css) takes the same tokens, so its text turns light.
   The inbox (INBOX in components.css) is always dark, so the components inside it are too. */
:is(html, body).dark-mode,
.tudotype-inbox,
.tudo-article:has(> .tudo-article__body > .telex-p5-clock-fixed-bg.is-dark-face) {
  /* Ink — inverts with surface */
  --wp--preset--color--ink-primary:    #F2F1ED;
  --wp--preset--color--ink-body:       #D2D1CE; /* body copy: ink-primary at 85 % over surface-base */
  --wp--preset--color--ink-muted:      #969696;
  --wp--preset--color--ink-subtle:     #B0B0B0;

  /* Surface — inverts with ink */
  --wp--preset--color--surface-base:   #1D1D1D;
  --wp--preset--color--surface-white:  #2B2B2B;
  --wp--preset--color--surface-dark:   #F2F1ED;
  --wp--preset--color--surface-light:  #333333;
  --wp--preset--color--surface-border: #4F4F4F;

  /* Accent soft variants — dark tinted equivalents (accent base colours do NOT flip) */
  --wp--preset--color--accent-amber-soft: #3D2800;
  --wp--preset--color--accent-red-soft:   #3D1200;
  --wp--preset--color--accent-green-soft: #0D2610;

  /* Disabled states — adjust for dark canvas (theme.json's names; they lacked "color--" until
     2026-10-18, so they never applied: the Licensing page's disabled "add to cart" is the first user) */
  --wp--preset--color--state-fg-disabled:     #5A5A5A;
  --wp--preset--color--state-bg-disabled:     #2B2B2B;
  --wp--preset--color--state-border-disabled: #3D3D3D;
}
