/**
 * Kestara — light/dark scheme layer.
 *
 * The palette stays the single source of colour identity (theme.json or a
 * style variation). The mode is a second axis: `data-kestara-scheme` on <html>
 * swaps the preset values, so template parts and every `has-*-color` class
 * follow without duplicated markup. The generated overrides live in
 * `inc/scheme.php`; this file only adds the role tokens and the few fixes that
 * cannot be expressed by swapping presets.
 *
 * Role tokens:
 *   --k-on-dark  bright ink, for copy sitting on photos or dark surfaces
 *   --k-deep     deep ink, for scrims and overlays over media
 * Both are "the lightest / darkest colour of the current palette", so they keep
 * working when base and contrast are swapped in dark mode.
 */

:root {
	--k-on-dark: var(--wp--preset--color--base);
	--k-deep: var(--wp--preset--color--contrast);
	color-scheme: light;
}

html[data-kestara-scheme="dark"] {
	--k-on-dark: var(--wp--preset--color--contrast);
	--k-deep: var(--wp--preset--color--base);
	color-scheme: dark;
}

/* ---- Logo -------------------------------------------------------------- */
/* Core prints the light lockup; inc/logo.php appends the dark one inside the
   same link. Only one of the two is ever laid out. */

.kestara-logo--dark {
	display: none;
}

html[data-kestara-scheme="dark"] .kestara-logo--dark {
	display: inline-block;
}

html[data-kestara-scheme="dark"] .custom-logo-link .custom-logo:not(.kestara-logo--dark) {
	display: none;
}

/* ---- Proof band -------------------------------------------------------- */
/* Logos are dark ink on a light band. In dark mode they must be light, and the
   hover tint is a fixed brand purple that only reads on a light band. */

html[data-kestara-scheme="dark"] .proof-band .wrap .proof-logo img {
	filter: grayscale(1) invert(1);
}

html[data-kestara-scheme="dark"] .proof-band .wrap .proof-logo a:hover img,
html[data-kestara-scheme="dark"] .proof-band .wrap .proof-logo a:focus-visible img {
	filter: grayscale(1) invert(1) brightness(1.08);
}

/* ---- Shadows ----------------------------------------------------------- */
/* theme.json shadows are tuned for a light page; on dark they read as halos. */

html[data-kestara-scheme="dark"] {
	--wp--custom--shadow--sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--wp--custom--shadow--md: 0 8px 24px rgba(0, 0, 0, 0.45);
	--wp--custom--shadow--lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}
