/*
 * WRRS design tokens.
 *
 * Source of truth: design/Main.dc.html (foundations) and the `renderVals`
 * theme objects in design/Home*.dc.html. theme.json maps its palette onto these
 * custom properties, so the colors flip with the visitor's appearance choice
 * (Auto / Light / Dark) without any editor-level style variation.
 *
 * How modes resolve:
 *   - :root                                      light values (default)
 *   - @media (prefers-color-scheme: dark)        dark values, unless the visitor chose Light
 *   - :root[data-theme="dark"]                   dark values, when the visitor chose Dark
 *
 * KEEP THE TWO DARK BLOCKS IDENTICAL. tools/contrast.mjs checks that they are,
 * and checks WCAG contrast for every text pairing in both modes.
 */

:root {
	color-scheme: light;

	/* Mode-dependent */
	--wrrs-bg: #f7f5ef;
	--wrrs-surface: #ffffff;
	--wrrs-line: #d9d6ce;
	--wrrs-ink: #121314;
	--wrrs-ink-2: #2b2f33;
	--wrrs-accent: #005a8c;
	--wrrs-on-accent: #ffffff;
	--wrrs-header-bg: #ffffff;
	--wrrs-footer-bg: #121314;
	--wrrs-shadow: rgba(18, 19, 20, 0.25);
	--wrrs-now-bg: #121314;
	--wrrs-now-ink: #f3efe6;
	--wrrs-now-time: #e3b14b;
	--wrrs-tag-bg: #e3b14b;
	--wrrs-tag-ink: #121314;
	--wrrs-time-ink: #005a8c;
	--wrrs-plate: none;
	--wrrs-band-ring: none;

	/* Mode-independent brand colors */
	--wrrs-gold: #e3b14b;
	--wrrs-deep-gold: #8a6514;
	--wrrs-logo-blue: #005a8c;
	--wrrs-sky-blue: #6cb8e6;
	--wrrs-silver: #c4c9cf;
	--wrrs-steel: #4a4f55;
	--wrrs-black: #121314;
	--wrrs-paper: #f7f5ef;
	--wrrs-cream: #f3efe6;
	--wrrs-bar-bg: #0e0f10;
	--wrrs-bar-panel-bg: #1a1c1f;
	--wrrs-bar-line: #3a3e43;
	--wrrs-bar-muted: #d8d4cb;
	--wrrs-footer-link: #6cb8e6;

	/* Text size steps (1 = standard, 2 = large, 3 = largest). Rem-based, so they
	   also respect the browser's own text-size setting: 20 / 24 / 28px at default. */
	--wrrs-text: 1.25rem;

	/* Radii */
	--wrrs-radius-sm: 0.5em;
	--wrrs-radius-md: 1em;
	--wrrs-radius-lg: 1.6em;
	--wrrs-radius-pill: 2em;

	/* Layout */
	--wrrs-container: 1320px;
	--wrrs-gutter: 2rem;
}

:root[data-text="2"] {
	--wrrs-text: 1.5rem;
}

:root[data-text="3"] {
	--wrrs-text: 1.75rem;
}

@media (max-width: 52em) {
	:root {
		--wrrs-gutter: 0.9rem;
	}
}

/* Dark values: device preference, unless the visitor explicitly chose Light. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--wrrs-bg: #121314;
		--wrrs-surface: #1d2023;
		--wrrs-line: #3a3e43;
		--wrrs-ink: #f3efe6;
		--wrrs-ink-2: #d8d4cb;
		--wrrs-accent: #6cb8e6;
		--wrrs-on-accent: #121314;
		--wrrs-header-bg: #1a1c1f;
		--wrrs-footer-bg: #0a0b0c;
		--wrrs-shadow: rgba(0, 0, 0, 0.55);
		--wrrs-now-bg: #e3b14b;
		--wrrs-now-ink: #121314;
		--wrrs-now-time: #121314;
		--wrrs-tag-bg: #121314;
		--wrrs-tag-ink: #e3b14b;
		--wrrs-time-ink: #e3b14b;
		--wrrs-plate: 0 0 0 0.2em #c4c9cf, 0 0 0 0.32em #121314, 0 0 0 0.42em #7c8288;
		--wrrs-band-ring: inset 0 0 0 2px #2f7aaa;
	}
}

/* Dark values: the visitor explicitly chose Dark. */
:root[data-theme="dark"] {
	color-scheme: dark;
	--wrrs-bg: #121314;
	--wrrs-surface: #1d2023;
	--wrrs-line: #3a3e43;
	--wrrs-ink: #f3efe6;
	--wrrs-ink-2: #d8d4cb;
	--wrrs-accent: #6cb8e6;
	--wrrs-on-accent: #121314;
	--wrrs-header-bg: #1a1c1f;
	--wrrs-footer-bg: #0a0b0c;
	--wrrs-shadow: rgba(0, 0, 0, 0.55);
	--wrrs-now-bg: #e3b14b;
	--wrrs-now-ink: #121314;
	--wrrs-now-time: #121314;
	--wrrs-tag-bg: #121314;
	--wrrs-tag-ink: #e3b14b;
	--wrrs-time-ink: #e3b14b;
	--wrrs-plate: 0 0 0 0.2em #c4c9cf, 0 0 0 0.32em #121314, 0 0 0 0.42em #7c8288;
	--wrrs-band-ring: inset 0 0 0 2px #2f7aaa;
}
