/*
 * techrahal Route: the dark theme ("Night").
 *
 * The site follows the reader's system setting until they press the switch
 * in the header. The switch sets data-theme on <html> and keeps the choice in
 * localStorage under th-theme, the key the site has used since its first
 * theme, so a choice made before the redesign still holds. A script in the
 * head applies a saved choice before the first paint.
 *
 * Only tokens change here; every component reads them. The two blocks below
 * must stay identical: the first follows the system setting, the second the
 * switch. Both are for screens only, so paper always prints in the light
 * theme. Loaded on the front end only, so the editors stay light.
 *
 * Contrast (WCAG 2.2): ink 16.7, ink-soft 12.1 and ink-muted 7.7 on ground;
 * 15.3, 11.1 and 7.1 on panel; accent as text 7.9 on ground and 7.3 on panel;
 * on-accent on accent 7.9; text on the deep band 13.7; dark text on the go,
 * limit and stop tags 8.2, 10.2 and 8.2; field 4.6 on ground and 4.2 on
 * panel. The logo turns to its reversed form (white tile, cobalt route), as
 * the design system asks on night grounds.
 */

@media screen and (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--wp--preset--color--ground: #0B1220;
		--wp--preset--color--panel: #121B2D;
		--wp--preset--color--line: #263450;
		--wp--preset--color--field: #6E7E9E;
		--wp--preset--color--ink: #EEF2F9;
		--wp--preset--color--ink-soft: #C6D0E2;
		--wp--preset--color--ink-muted: #9AA7C0;
		--wp--preset--color--accent: #85A6FF;
		--wp--preset--color--on-accent: #0B1220;
		--wp--preset--color--accent-tint: #1A2848;
		--wp--preset--color--night: #14234A;
		--wp--preset--color--go: #46C08A;
		--wp--preset--color--limit: #F2B544;
		--wp--preset--color--stop: #FF8B7E;
		--wp--custom--tools--on-limit: #0B1220;
		--wp--custom--tools--checked-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 18 18'%3E%3Cpath d='M3 8.4 6.4 11.8 13 4.6' fill='none' stroke='%2385A6FF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		--th-on-night: #EEF2F9;
		--th-on-night-muted: #C6D3F2;
		--th-on-go: #0B1220;
		--th-on-stop: #0B1220;
		--th-on-limit: #0B1220;
		--th-mark-tile: #FFFFFF;
		--th-mark-route: #1F4FD8;
		color-scheme: dark;
	}
}

@media screen {
	:root[data-theme="dark"] {
		--wp--preset--color--ground: #0B1220;
		--wp--preset--color--panel: #121B2D;
		--wp--preset--color--line: #263450;
		--wp--preset--color--field: #6E7E9E;
		--wp--preset--color--ink: #EEF2F9;
		--wp--preset--color--ink-soft: #C6D0E2;
		--wp--preset--color--ink-muted: #9AA7C0;
		--wp--preset--color--accent: #85A6FF;
		--wp--preset--color--on-accent: #0B1220;
		--wp--preset--color--accent-tint: #1A2848;
		--wp--preset--color--night: #14234A;
		--wp--preset--color--go: #46C08A;
		--wp--preset--color--limit: #F2B544;
		--wp--preset--color--stop: #FF8B7E;
		--wp--custom--tools--on-limit: #0B1220;
		--wp--custom--tools--checked-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 18 18'%3E%3Cpath d='M3 8.4 6.4 11.8 13 4.6' fill='none' stroke='%2385A6FF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		--th-on-night: #EEF2F9;
		--th-on-night-muted: #C6D3F2;
		--th-on-go: #0B1220;
		--th-on-stop: #0B1220;
		--th-on-limit: #0B1220;
		--th-mark-tile: #FFFFFF;
		--th-mark-route: #1F4FD8;
		color-scheme: dark;
	}
}

:root[data-theme="light"] {
	color-scheme: light;
}
