/*
 * DuoTeX palette: the one place to change colours.
 *
 * The editor (css/main.css) and the home page (css/site/site.css) only map
 * these values onto their own variable names. Change a value here and both
 * follow. The names keep two slots: "dark" and "light". Which slot the editor
 * uses is set by data-ui-theme on <html>; which colours fill the slot is set
 * by data-ui-palette. Without data-ui-palette (home page, first paint) the
 * dark slot is Carbon and the light slot is Paper.
 *
 * The accent, the page background and the overlay are written as "R, G, B"
 * because the styles also need them half transparent.
 */
:root {
	/* ── Dark slot, default: Carbon ── */
	--pal-dark-accent-rgb: 194, 63, 24;         /* #c23f18  buttons, selection, focus */
	--pal-dark-accent-hover-rgb: 169, 53, 18;   /* #a93512 */
	--pal-dark-on-accent: #fff4ec;              /* text on an accent button */
	--pal-dark-accent-text: #ff8a66;            /* accent used as text: links, headings */

	--pal-dark-bg-rgb: 46, 44, 41;              /* #2e2c29  page and editor background */
	--pal-dark-sunken: #1c1a19;                 /* wells below the page background */
	--pal-dark-surface: #262422;                /* panels, cards */
	--pal-dark-surface-alt: #2b2927;            /* header, raised cards */
	--pal-dark-hover: #35322e;
	--pal-dark-active: #3a3733;
	--pal-dark-border: #3d3a36;
	--pal-dark-border-subtle: #33302c;

	--pal-dark-text: #ede7db;
	--pal-dark-text-secondary: #bdb6a8;
	--pal-dark-text-muted: #a09988;
	--pal-dark-overlay-rgb: 255, 255, 255;      /* tint for hover and pressed states */

	/* ── Light slot, default: Paper ── */
	--pal-light-accent-rgb: 184, 58, 18;        /* #b83a12 */
	--pal-light-accent-hover-rgb: 156, 47, 12;  /* #9c2f0c */
	--pal-light-on-accent: #fff8f0;
	--pal-light-accent-text: #b83a12;

	--pal-light-bg-rgb: 251, 250, 246;          /* #fbfaf6 */
	--pal-light-sunken: #e3ded1;
	--pal-light-surface: #efebe2;
	--pal-light-surface-alt: #f4f1ea;
	--pal-light-hover: #e9e4d8;
	--pal-light-active: #e5dfd1;
	--pal-light-border: #ddd7ca;
	--pal-light-border-subtle: #e6e1d5;

	--pal-light-text: #1d1b17;
	--pal-light-text-secondary: #555045;
	--pal-light-text-muted: #6e685c;
	--pal-light-overlay-rgb: 29, 27, 23;

	/* Background of the classic "Overleaf Dark" editor theme (monaco-editor.js). */
	--pal-classic-dark-bg-rgb: 14, 18, 22;

	/* ── Messages (editor dialogs and reference pages) and code on the LaTeX
	   reference pages (reference/assets/reference.css) ── */
	--pal-light-warn: #8a5300;
	--pal-light-error: #a4262c;
	--pal-light-success: #1f6f3f;
	--pal-light-code-key: #7b2fa3;             /* \commands */
	--pal-light-code-comment: #6e685c;
	--pal-light-code-brace: #8a5300;
	--pal-dark-warn: #f0b45a;
	--pal-dark-error: #ff8f8f;
	--pal-dark-success: #7fd99a;
	--pal-dark-code-key: #c792ea;
	--pal-dark-code-comment: #a09988;
	--pal-dark-code-brace: #e2b86b;

	/* A printed page. The same in both slots, because the pictures of compiled
	   LaTeX on the reference pages are black on a transparent background. */
	--pal-paper: #ffffff;

	/* ── Type ── */
	--pal-font-brand: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
}

/* ── Dark palettes ── */
:root[data-ui-palette="blueprint"] {
	--pal-dark-accent-rgb: 241, 235, 221;       /* #f1ebdd */
	--pal-dark-accent-hover-rgb: 255, 250, 240;
	--pal-dark-on-accent: #14213d;
	--pal-dark-accent-text: #8fc1ff;
	--pal-dark-bg-rgb: 26, 42, 76;              /* #1a2a4c */
	--pal-dark-sunken: #0e1830;
	--pal-dark-surface: #14213d;
	--pal-dark-surface-alt: #182745;
	--pal-dark-hover: #213258;
	--pal-dark-active: #243862;
	--pal-dark-border: #2c3f68;
	--pal-dark-border-subtle: #223258;
	--pal-dark-text: #eaf0fa;
	--pal-dark-text-secondary: #b9c6e0;
	--pal-dark-text-muted: #8c9dc0;
}

:root[data-ui-palette="blackboard"] {
	--pal-dark-accent-rgb: 242, 212, 107;       /* #f2d46b */
	--pal-dark-accent-hover-rgb: 247, 224, 140;
	--pal-dark-on-accent: #1b2412;
	--pal-dark-accent-text: #f2d46b;
	--pal-dark-bg-rgb: 36, 51, 46;              /* #24332e */
	--pal-dark-sunken: #141d1a;
	--pal-dark-surface: #1b2824;
	--pal-dark-surface-alt: #1f2d29;
	--pal-dark-hover: #2a3b35;
	--pal-dark-active: #2e4039;
	--pal-dark-border: #33443e;
	--pal-dark-border-subtle: #2a3a34;
	--pal-dark-text: #e9ede4;
	--pal-dark-text-secondary: #b7c4bc;
	--pal-dark-text-muted: #8fa097;
}

:root[data-ui-palette="highlighter-night"] {
	--pal-dark-accent-rgb: 242, 194, 48;        /* #f2c230 */
	--pal-dark-accent-hover-rgb: 247, 210, 96;
	--pal-dark-on-accent: #161616;
	--pal-dark-accent-text: #f2c230;
	--pal-dark-bg-rgb: 39, 39, 38;              /* #272726 */
	--pal-dark-sunken: #151514;
	--pal-dark-surface: #1f1f1e;
	--pal-dark-surface-alt: #232322;
	--pal-dark-hover: #323230;
	--pal-dark-active: #3b3620;
	--pal-dark-border: #383836;
	--pal-dark-border-subtle: #2e2e2c;
	--pal-dark-text: #f2eee3;
	--pal-dark-text-secondary: #bdb9ad;
	--pal-dark-text-muted: #9a968a;
}

/* ── Light palettes ── */
:root[data-ui-palette="cobalt"] {
	--pal-light-accent-rgb: 35, 71, 216;        /* #2347d8 */
	--pal-light-accent-hover-rgb: 27, 56, 178;
	--pal-light-on-accent: #ffffff;
	--pal-light-accent-text: #2347d8;
	--pal-light-bg-rgb: 255, 255, 255;
	--pal-light-sunken: #e5e9f0;
	--pal-light-surface: #f0f2f6;
	--pal-light-surface-alt: #f7f8fa;
	--pal-light-hover: #e8ecf3;
	--pal-light-active: #e2e8f7;
	--pal-light-border: #dadfe8;
	--pal-light-border-subtle: #e6eaf1;
	--pal-light-text: #14181f;
	--pal-light-text-secondary: #454d5b;
	--pal-light-text-muted: #5d6675;
	--pal-light-overlay-rgb: 20, 24, 31;
}

:root[data-ui-palette="sage"] {
	--pal-light-accent-rgb: 47, 93, 70;         /* #2f5d46 */
	--pal-light-accent-hover-rgb: 36, 74, 55;
	--pal-light-on-accent: #f3f6ee;
	--pal-light-accent-text: #2f5d46;
	--pal-light-bg-rgb: 248, 249, 244;          /* #f8f9f4 */
	--pal-light-sunken: #dadfd0;
	--pal-light-surface: #e5e8dd;
	--pal-light-surface-alt: #eceee6;
	--pal-light-hover: #dfe4d5;
	--pal-light-active: #d9dfcd;
	--pal-light-border: #cfd4c4;
	--pal-light-border-subtle: #dce0d3;
	--pal-light-text: #1e241d;
	--pal-light-text-secondary: #485143;
	--pal-light-text-muted: #5c6655;
	--pal-light-overlay-rgb: 30, 36, 29;
}

:root[data-ui-palette="highlighter"] {
	--pal-light-accent-rgb: 242, 194, 48;       /* #f2c230 */
	--pal-light-accent-hover-rgb: 230, 180, 30;
	--pal-light-on-accent: #161616;
	--pal-light-accent-text: #7a5c00;
	--pal-light-bg-rgb: 255, 253, 247;          /* #fffdf7 */
	--pal-light-sunken: #e9e4d5;
	--pal-light-surface: #f3efe2;
	--pal-light-surface-alt: #faf7ee;
	--pal-light-hover: #eee9d9;
	--pal-light-active: #f6e7a8;
	--pal-light-border: #e2dccb;
	--pal-light-border-subtle: #ebe6d8;
	--pal-light-text: #161616;
	--pal-light-text-secondary: #4a463d;
	--pal-light-text-muted: #6b665b;
	--pal-light-overlay-rgb: 22, 22, 22;
}

/* ── Classic: the colours before the DuoTeX themes. Used with the classic
   editor themes (Overleaf, Solarized, GitHub, ...), so they look as before. ── */
:root[data-ui-palette="classic"] {
	--pal-dark-accent-rgb: 65, 199, 218;        /* #41c7da */
	--pal-dark-accent-hover-rgb: 122, 218, 232;
	--pal-dark-on-accent: #05242a;
	--pal-dark-accent-text: #41c7da;
	--pal-dark-bg-rgb: 14, 18, 22;
	--pal-dark-sunken: #0a0d10;
	--pal-dark-surface: #141a20;
	--pal-dark-surface-alt: #1a2129;
	--pal-dark-hover: #232c36;
	--pal-dark-active: #2e3945;
	--pal-dark-border: #26303a;
	--pal-dark-border-subtle: #1c242c;
	--pal-dark-text: #e6eaee;
	--pal-dark-text-secondary: #a3adb8;
	--pal-dark-text-muted: #7a8591;

	--pal-light-accent-rgb: 14, 116, 144;       /* #0e7490 */
	--pal-light-accent-hover-rgb: 11, 93, 116;
	--pal-light-on-accent: #ffffff;
	--pal-light-accent-text: #0e7490;
	--pal-light-bg-rgb: 250, 249, 246;
	--pal-light-sunken: #f1efe9;
	--pal-light-surface: #ffffff;
	--pal-light-surface-alt: #f1efe9;
	--pal-light-hover: #e8e5dc;
	--pal-light-active: #dedbd2;
	--pal-light-border: #dedbd2;
	--pal-light-border-subtle: #e8e5dc;
	--pal-light-text: #1a1d21;
	--pal-light-text-secondary: #555b66;
	--pal-light-text-muted: #6f7580;
	--pal-light-overlay-rgb: 26, 29, 33;
}
