/*
 * Moderna color palettes: the classic styles (t_styles 1-8) as full-page color modes of the Moderna
 * layout. Loaded after tokens.css by the modern theme only (never the admin). <html data-palette="..."> picks one;
 * "moderna" (the default, ES red, light/dark/system) has no block here, it is tokens.css as is.
 * Who gets which palette: app/lib/theme.php es_theme_palette(); guide: docs/design/README.md "Palettes".
 *
 * Every other palette is ONE fixed mode, taken from its stylesheet's real rules (www/images/static/css/stil*.css:
 * body, #header, td.cat, td.title, msg1/msg2, the post box, links, inputs). The server always writes
 * data-scheme="light" (or "dark" for Crna) with it, so tokens.css supplies the matching base set and the OS
 * preference and the es_scheme cookie do not apply; the block below wins over that base by file order (same
 * specificity). Colors that failed WCAG AA in the old style were nudged as little as possible (see the docs).
 *
 * Tokens beyond tokens.css (the CSS reads them with a fallback, so Moderna itself is unchanged):
 *   --post-bg                         post card (topic.css)
 *   --cat-bg / --cat-text             category bands: .cat-head, .list-group-head (old td.cat)
 *   --head-bg / --head-text           table heads: .topic-row-head (old td.title)
 *   --field-bg / --field-text / --field-border / --placeholder    form fields and the composer
 *   --chrome-field-bg / -border / -border-strong / -text / -placeholder   header search field
 *   --chrome-ink / --chrome-hover-strong / --chrome-press                  popups on the chrome color (composer)
 * Every palette also sets the palette-hued semantic tokens of tokens.css: --info/--info-soft, --staff/--staff-soft,
 * --on-link, --on-danger (docs/design/README.md "Palette-hued tokens"); check with dev/palette-contrast.py.
 */

/* the logo mark sits on the accent: its text follows the accent, not the (possibly dark) header text */
:root[data-palette]:not([data-palette="moderna"]) .site-logo-mark { color: var(--on-accent); }
:root[data-palette]:not([data-palette="moderna"]) ::placeholder { color: var(--placeholder); opacity: 1; }
:root[data-palette]:not([data-palette="moderna"]) .site-search input::placeholder { color: var(--chrome-field-placeholder); }
/* Plava: the old page texture (classic stil3.css body background-image, palette-blue-bg.gif) */
:root[data-palette="blue"] body { background-image: url(palette-blue-bg.gif); }

/* Originalna: classic style 1 (stil1b.css), light */
:root[data-palette="original"] {
  --bg: #eeeeee;
  --surface: #eeeef0;
  --surface-2: #d9d9dd;
  --post-bg: #f7f7f8;
  --border: #b4b4ba;
  --border-strong: #808080;
  --text: #111111;
  --text-2: #333333;
  --muted: #505058;
  --accent: #335780;
  --accent-hover: #284566;
  --accent-soft: #e3e9f1;
  --on-accent: #fafafa;
  --link: #225577;
  --link-soft: #e3e9f1;
  --unread: #447799;
  --ok: #176238;
  --warn: #7a4800;
  --danger: #a01029;
  --info: #225577;
  --info-soft: #dde6f0;
  --staff: #335780;
  --staff-soft: #e3e9f1;
  --on-link: #ffffff;
  --on-danger: #ffffff;
  --chrome-bg: #d9d9dd;
  --chrome-text: #2b2b30;
  --chrome-strong: #111111;
  --chrome-line: #808080;
  --chrome-hover: #eeeeee;
  --chrome-active: #ffffff;
  --chrome-field-bg: #ffffff;
  --chrome-field-border: #808080;
  --chrome-field-border-strong: #808080;
  --chrome-field-text: #111111;
  --chrome-field-placeholder: #505058;
  --chrome-ink: #111111;
  --chrome-hover-strong: #eeeeee;
  --chrome-press: #ffffff;
  --cat-bg: #96aeca;
  --cat-text: #111111;
  --head-bg: #335780;
  --head-text: #fafafa;
  --field-bg: #ffffff;
  --field-text: #111111;
  --field-border: #808080;
  --placeholder: #505058;
  --quote-bg: #f7f7f8;
  --quote-line: #bbbbbb;
  --code-bg: #ffffff;
  color-scheme: light;
}

/* Narandžasta: classic style 2 (stil2.css), light */
:root[data-palette="orange"] {
  --bg: #fff9f0;
  --surface: #fff9f0;
  --surface-2: #f9e8cf;
  --post-bg: #fffcf7;
  --border: #e5b08c;
  --border-strong: #885000;
  --text: #111111;
  --text-2: #3d2a1a;
  --muted: #694a2e;
  --accent: #722e00;
  --accent-hover: #5a2400;
  --accent-soft: #ffe3bb;
  --on-accent: #fafafa;
  --link: #885000;
  --link-soft: #ffe3bb;
  --unread: #885000;
  --ok: #176238;
  --warn: #7a4800;
  --danger: #a01029;
  --info: #7a4400;
  --info-soft: #ffe3bb;
  --staff: #722e00;
  --staff-soft: #ffe3bb;
  --on-link: #ffffff;
  --on-danger: #ffffff;
  --chrome-bg: #f9e8cf;
  --chrome-text: #722e00;
  --chrome-strong: #4a1e00;
  --chrome-line: #885000;
  --chrome-hover: #ffe3bb;
  --chrome-active: #fff9f0;
  --chrome-field-bg: #ffffff;
  --chrome-field-border: #722e00;
  --chrome-field-border-strong: #885000;
  --chrome-field-text: #111111;
  --chrome-field-placeholder: #694a2e;
  --chrome-ink: #4a1e00;
  --chrome-hover-strong: #ffe3bb;
  --chrome-press: #fff9f0;
  --cat-bg: #e5b08c;
  --cat-text: #722e00;
  --head-bg: #722e00;
  --head-text: #fafafa;
  --field-bg: #ffffff;
  --field-text: #111111;
  --field-border: #722e00;
  --placeholder: #694a2e;
  --quote-bg: #ffffff;
  --quote-line: #885000;
  --code-bg: #ffffff;
  color-scheme: light;
}

/* Plava: classic style 3 (stil3.css), light */
:root[data-palette="blue"] {
  --bg: #e8f0f3;
  --surface: #dbe4ea;
  --surface-2: #cbd8e0;
  --post-bg: #f3f7f9;
  --border: #ffffff;
  --border-strong: #9eb1bf;
  --text: #111111;
  --text-2: #303030;
  --muted: #46525c;
  --accent: #4e6878;
  --accent-hover: #3f5562;
  --accent-soft: #ebf0f3;
  --on-accent: #ffffff;
  --link: #225577;
  --link-soft: #e8f0f3;
  --unread: #447799;
  --ok: #145c34;
  --warn: #6e4100;
  --danger: #8f0e25;
  --info: #225577;
  --info-soft: #d3e1ea;
  --staff: #3f5562;
  --staff-soft: #ebf0f3;
  --on-link: #ffffff;
  --on-danger: #ffffff;
  --field-border: #464c50;
  --chrome-bg: #cbd8e0;
  --chrome-text: #24313b;
  --chrome-strong: #111111;
  --chrome-line: #ffffff;
  --chrome-hover: #e8f0f3;
  --chrome-active: #f3f7f9;
  --chrome-field-bg: #99a0a4;
  --chrome-field-border: #808080;
  --chrome-field-border-strong: #6b7276;
  --chrome-field-text: #111111;
  --chrome-field-placeholder: #1f262b;
  --chrome-ink: #111111;
  --chrome-hover-strong: #e8f0f3;
  --chrome-press: #f3f7f9;
  --cat-bg: #9eb1bf;
  --cat-text: #111111;
  --head-bg: #70777d;
  --head-text: #ffffff;
  --field-bg: #99a0a4;
  --field-text: #111111;
  --placeholder: #1f262b;
  --quote-bg: #ffffff;
  --quote-line: #9eb1bf;
  --code-bg: #f7f7f7;
  color-scheme: light;
}

/* Zelena: classic style 5 (stil5.css), light */
:root[data-palette="green"] {
  --bg: #e1e9e1;
  --surface: #e4e9e4;
  --surface-2: #c0d0c0;
  --post-bg: #edf1ed;
  --border: #ffffff;
  --border-strong: #a0b1a0;
  --text: #111111;
  --text-2: #2c382c;
  --muted: #435243;
  --accent: #536e53;
  --accent-hover: #445a44;
  --accent-soft: #edf1ed;
  --on-accent: #fafafa;
  --link: #3c573c;
  --link-soft: #edf1ed;
  --unread: #507550;
  --ok: #135530;
  --warn: #6a3f00;
  --danger: #8f0e25;
  --info: #3c573c;
  --info-soft: #d2e0d2;
  --staff: #445a44;
  --staff-soft: #edf1ed;
  --on-link: #ffffff;
  --on-danger: #ffffff;
  --chrome-bg: #c0d0c0;
  --chrome-text: #283428;
  --chrome-strong: #111111;
  --chrome-line: #ffffff;
  --chrome-hover: #e1e9e1;
  --chrome-active: #e9efe9;
  --chrome-field-bg: #557755;
  --chrome-field-border: #557755;
  --chrome-field-border-strong: #c0d0c0;
  --chrome-field-text: #ffffff;
  --chrome-field-placeholder: #ffffff;
  --chrome-ink: #111111;
  --chrome-hover-strong: #e1e9e1;
  --chrome-press: #e9efe9;
  --cat-bg: #96a896;
  --cat-text: #111111;
  --head-bg: #647864;
  --head-text: #fafafa;
  --field-bg: #e1e9e1;
  --field-text: #111111;
  --field-border: #557755;
  --placeholder: #435243;
  --quote-bg: #ffffff;
  --quote-line: #a0b1a0;
  --code-bg: #f5f5f5;
  color-scheme: light;
}

/* Crna: classic style 6 (stil6.css), dark */
:root[data-palette="black"] {
  --bg: #1e2323;
  --surface: #282a2b;
  --surface-2: #141618;
  --post-bg: #2b2f32;
  --border: #333333;
  --border-strong: #454e55;
  --text: #b4b4b4;
  --text-2: #a2a2a2;
  --muted: #959595;
  --accent: #9dad09;
  --accent-hover: #b3c412;
  --accent-soft: #2c3110;
  --on-accent: #141616;
  --link: #d6d6d6;
  --link-soft: #333333;
  --unread: #9dad09;
  --info: #c5d36a;
  --info-soft: #2c3110;
  --staff: #9dad09;
  --staff-soft: #2c3110;
  --on-link: #141616;
  --on-danger: #141616;
  --mark: #3d3208;
  --chrome-bg: #141616;
  --chrome-text: #a3a3a3;
  --chrome-strong: #ffffff;
  --chrome-line: #333333;
  --chrome-hover: #222222;
  --chrome-active: #333333;
  --chrome-field-bg: #29292d;
  --chrome-field-border: #454e55;
  --chrome-field-border-strong: #454e55;
  --chrome-field-text: #dddddd;
  --chrome-field-placeholder: #999999;
  --chrome-ink: #e3e6ed;
  --chrome-hover-strong: #333333;
  --chrome-press: #3f4346;
  --cat-bg: #3f4346;
  --cat-text: #fafafa;
  --head-bg: #2b2f32;
  --head-text: #fafafa;
  --field-bg: #29292d;
  --field-text: #dddddd;
  --field-border: #77828a;
  --placeholder: #999999;
  --quote-bg: #232628;
  --quote-line: #5a6268;
  --code-bg: #3f4346;
  color-scheme: dark;
}

/* Ljubičasta: classic style 7 (stil7.css), light */
:root[data-palette="violet"] {
  --bg: #ebdbeb;
  --surface: #dfc6df;
  --surface-2: #d7b8d7;
  --post-bg: #f3e9f3;
  --border: #ffffff;
  --border-strong: #bb87bb;
  --text: #111111;
  --text-2: #3a283a;
  --muted: #523952;
  --accent: #794479;
  --accent-hover: #61365f;
  --accent-soft: #f3e9f3;
  --on-accent: #ffffff;
  --link: #6a386a;
  --link-soft: #f3e9f3;
  --unread: #884d88;
  --ok: #0f4a2a;
  --warn: #5c3600;
  --danger: #7c0c20;
  --info: #5e315e;
  --info-soft: #f3e9f3;
  --staff: #794479;
  --staff-soft: #f3e9f3;
  --on-link: #ffffff;
  --on-danger: #ffffff;
  --chrome-bg: #c79cc7;
  --chrome-text: #341c34;
  --chrome-strong: #111111;
  --chrome-line: #ffffff;
  --chrome-hover: #ebdbeb;
  --chrome-active: #f3e9f3;
  --chrome-field-bg: #9d599d;
  --chrome-field-border: #c79cc7;
  --chrome-field-border-strong: #f3e9f3;
  --chrome-field-text: #ffffff;
  --chrome-field-placeholder: #ffffff;
  --chrome-ink: #111111;
  --chrome-hover-strong: #ebdbeb;
  --chrome-press: #f3e9f3;
  --cat-bg: #975497;
  --cat-text: #fafafa;
  --head-bg: #874e87;
  --head-text: #fafafa;
  --field-bg: #9d599d;
  --field-text: #ffffff;
  --field-border: #f3e9f3;
  --placeholder: #ffffff;
  --quote-bg: #ffffff;
  --quote-line: #a45fa4;
  --code-bg: #f5f5f5;
  color-scheme: light;
}

/* Siva: classic style 8 (stil8.css), light; also style 4 Gray-lite (stil4.css, same colors) */
:root[data-palette="gray"] {
  --bg: #8f8f8f;
  --surface: #cccccc;
  --surface-2: #bbbbbb;
  --post-bg: #dddddd;
  --border: #ffffff;
  --border-strong: #666666;
  --text: #000000;
  --text-2: #111111;
  --muted: #262626;
  --accent: #565656;
  --accent-hover: #444444;
  --accent-soft: #dddddd;
  --on-accent: #f2f2f2;
  --link: #1f1f1f;
  --link-soft: #dddddd;
  --unread: #1f1f1f;
  --ok: #0b4024;
  --warn: #4d2e00;
  --danger: #6e0a1c;
  --info: #1f1f1f;
  --info-soft: #e6e6e6;
  --staff: #444444;
  --staff-soft: #e6e6e6;
  --on-link: #ffffff;
  --on-danger: #ffffff;
  --chrome-bg: #bbbbbb;
  --chrome-text: #1a1a1a;
  --chrome-strong: #000000;
  --chrome-line: #ffffff;
  --chrome-hover: #cccccc;
  --chrome-active: #dddddd;
  --chrome-field-bg: #999999;
  --chrome-field-border: #808080;
  --chrome-field-border-strong: #666666;
  --chrome-field-text: #000000;
  --chrome-field-placeholder: #141414;
  --chrome-ink: #000000;
  --chrome-hover-strong: #cccccc;
  --chrome-press: #dddddd;
  --cat-bg: #666666;
  --cat-text: #f2f2f2;
  --head-bg: #555555;
  --head-text: #f2f2f2;
  --field-bg: #d9d9dd;
  --field-text: #000000;
  --field-border: #555555;
  --placeholder: #333333;
  --quote-bg: #dddddd;
  --quote-line: #aaaaaa;
  --code-bg: #ffffff;
  color-scheme: light;
}

/* picker swatches (partials/palette-picker.twig): header / page / accent */
.pal-swatch[data-pal="moderna"] { --sw-chrome: #14171d; --sw-bg: #f4f5f7; --sw-accent: #b3122e; }
.pal-swatch[data-pal="original"] { --sw-chrome: #d9d9dd; --sw-bg: #eeeeee; --sw-accent: #335780; }
.pal-swatch[data-pal="orange"] { --sw-chrome: #f9e8cf; --sw-bg: #fff9f0; --sw-accent: #722e00; }
.pal-swatch[data-pal="blue"] { --sw-chrome: #cbd8e0; --sw-bg: #e8f0f3; --sw-accent: #4e6878; }
.pal-swatch[data-pal="green"] { --sw-chrome: #c0d0c0; --sw-bg: #e1e9e1; --sw-accent: #536e53; }
.pal-swatch[data-pal="black"] { --sw-chrome: #141616; --sw-bg: #1e2323; --sw-accent: #9dad09; }
.pal-swatch[data-pal="violet"] { --sw-chrome: #c79cc7; --sw-bg: #ebdbeb; --sw-accent: #794479; }
.pal-swatch[data-pal="gray"] { --sw-chrome: #bbbbbb; --sw-bg: #8f8f8f; --sw-accent: #565656; }
