/*
 * Dark mode. <html data-theme="dark"> is set from the user's setting or the system preference
 * (see layouts/application.html.erb). The components use the palette below for their roles
 * (--white = raised surface, --blue-main = ink, …), so redefining it switches the whole app.
 */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* Brand */
  --blue-main: #e4e8f5; /* ink */
  --blue-accent: #4d9dff;
  --blue-light: #17294a; /* selected */

  /* Neutral */
  --white: #161b26; /* cards, sidebars, inputs */
  --black: #ffffff;
  --gray-soft: #0e1219; /* canvas */
  --gray-surface: #1d2330;
  --gray-border: #2b3343;
  --gray-muted: #9aa3b6;

  /* Status colors */
  --green-main: #3ccf8a;
  --green-light: #10291f;
  --yellow-main: #e3ad5c;
  --yellow-light: #2c2312;
  --green-highlight: #133224;
  --yellow-highlight: #3a2d10;
  --red-main: #ff6b8a;
  --red-light: #331620;

  /* Text on accent/ink backgrounds (buttons, flash) */
  --color-ink-inverted: #0e1219;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 10px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 24px rgb(0 0 0 / 0.6);

  /* Lexxy editor */
  --lexxy-color-ink: #e4e8f5;
  --lexxy-color-ink-medium: #b8bfd0;
  --lexxy-color-ink-light: #8b93a6;
  --lexxy-color-ink-lighter: #3a4254;
  --lexxy-color-ink-lightest: #1d2330;
  --lexxy-color-ink-inverted: #161b26;
  --lexxy-color-accent-dark: #6aadff;
  --lexxy-color-accent-medium: #3b78c9;
  --lexxy-color-accent-light: #22385c;
  --lexxy-color-accent-lightest: #1a2a45;
}

/* The logo is a single dark color */
:root[data-theme="dark"] img[src*="logo"] {
  filter: brightness(0) invert(0.92);
}
