/*
  Theme + palette overrides. Single source of truth for both axes.

  How it works:
   - :root in styles.css holds the *defaults* (Light Mode, Normal palette).
   - Each block below declares its display name via --theme-name / --palette-name
     and (optionally) overrides any of the colour variables.
   - The settings panel enumerates these blocks at runtime by scanning
     document.styleSheets for selectors matching html[data-theme="…"] /
     html[data-palette="…"], reading --theme-name / --palette-name for the
     label. So adding a new option = appending one block here.
   - The two axes compose: theme overrides surface colours (bg/text/border),
     palette overrides signal colours (accent/now/recurring/later/danger).
     Where they touch (--accent under dark mode), palettes win because their
     blocks appear later in the file (CSS source order).
*/

/* ============================== THEMES ============================== */

html[data-theme="light"] {
  --theme-name: "Light Mode";
  /* no overrides — :root already is light */
}

html[data-theme="dark"] {
  --theme-name: "Dark Mode";
  --bg:           #1a1726;
  --surface:      #242038;
  --sidebar-bg:   #15132a;
  --border:       #3a3550;
  --text:         #d6d1e8;
  --text-muted:   #8a85a3;
  --text-light:   #5a5572;
  --accent:       #4cb5b5;
  --accent-hover: #6cc9c9;
  --accent-light: #1f3a3a;
}

/* ============================== PALETTES ============================ */

html[data-palette="normal"] {
  --palette-name: "Normal";
  /* no overrides — :root already is normal */
}

/* --- Red-weak (most common after deuteranomaly). Avoid pure reds; lean blue/orange/yellow. --- */
html[data-palette="protanomaly"] {
  --palette-name: "Protanomaly";
  --accent:       #2e8fb5;
  --accent-hover: #246e8f;
  --accent-light: #e3eff5;
  --now:          #2e8fb5;
  --recurring:    #6a72cd;
  --later:        #c4a03e;
  --someday:      #9b9085;
  --danger:       #d56e00;
}

html[data-palette="protanopia"] {
  --palette-name: "Protanopia";
  --accent:       #1f7aa3;
  --accent-hover: #185f80;
  --accent-light: #dceaf2;
  --now:          #1f7aa3;
  --recurring:    #4c56c4;
  --later:        #d4a82a;
  --someday:      #9b9085;
  --danger:       #e07e10;
}

/* --- Green-weak (most common form of CB). Use Okabe-Ito blue / orange / reddish purple. --- */
html[data-palette="deuteranomaly"] {
  --palette-name: "Deuteranomaly";
  --accent:       #0072b2;
  --accent-hover: #005a8e;
  --accent-light: #d8e8f3;
  --now:          #0072b2;
  --recurring:    #cc79a7;
  --later:        #e69f00;
  --someday:      #9b9085;
  --danger:       #d55e00;
}

html[data-palette="deuteranopia"] {
  --palette-name: "Deuteranopia";
  --accent:       #005c92;
  --accent-hover: #00466e;
  --accent-light: #d2e2ee;
  --now:          #005c92;
  --recurring:    #b35a8a;
  --later:        #f2a900;
  --someday:      #9b9085;
  --danger:       #c44500;
}

/* --- Blue-weak (rare). Avoid blue/yellow distinctions; lean teal / pink / red. --- */
html[data-palette="tritanomaly"] {
  --palette-name: "Tritanomaly";
  --accent:       #2d8d6a;
  --accent-hover: #226e52;
  --accent-light: #dfeee7;
  --now:          #2d8d6a;
  --recurring:    #b85a8a;
  --later:        #c44b2e;
  --someday:      #9b9085;
  --danger:       #8a2018;
}

html[data-palette="tritanopia"] {
  --palette-name: "Tritanopia";
  --accent:       #1e7256;
  --accent-hover: #155640;
  --accent-light: #d9e9e1;
  --now:          #1e7256;
  --recurring:    #a04275;
  --later:        #b03a1e;
  --someday:      #9b9085;
  --danger:       #6e1610;
}

/* --- Total colour blindness — vary only luminance. --- */
html[data-palette="achromatopsia"] {
  --palette-name: "Achromatopsia";
  --accent:       #4a4a4a;
  --accent-hover: #2f2f2f;
  --accent-light: #e2e2e2;
  --now:          #4a4a4a;
  --recurring:    #8a8a8a;
  --later:        #6b6b6b;
  --someday:      #a8a8a8;
  --danger:       #1f1f1f;
}
