/**
 * MOF design tokens.
 *
 * Dark is the DEFAULT theme — the palette values in theme.json are the dark values,
 * so the site renders dark with no attribute present. The light theme is opt-in:
 * the toggle sets `data-theme="light"` on <html>, which overrides the generated
 * `--wp--preset--color--*` custom properties below. Every component in app.css reads
 * those preset variables, so the whole UI re-themes from this one block.
 */

:root {
	color-scheme: dark;

	--mof-radius-sm: 2px;
	--mof-radius-md: 6px;
	--mof-radius-lg: 12px;
	--mof-hairline: 1px solid var(--wp--preset--color--hairline);
	--mof-maxw: 1200px;
	--mof-transition: 160ms ease;

	/* The plum surfaces (#54263f) are the same colour in both themes, so the
	   brass that sits ON them must be too: the light theme's brass (#785d31)
	   is 2:1 against plum. #C39A62 (the dark brass) is 4.7:1 on plum in both
	   themes and 6.4:1 on the ink-deep band, so it is the AA brass for every
	   dark surface the theme puts brass on. */
	--mof-brass-aa: #c39a62;
	/* Outline buttons in dark mode: accent-plum (#9a6480) is 3.9:1 on the dark
	   page background; this lift clears 4.5:1 (AA) with the same hue. */
	--mof-outline-on-dark: #a87794;
	/* Text selection: plum with light text, 6:1, in both themes (the dark theme's
	   plum-soft is a pale pink, which would fail under light text). */
	--mof-selection-bg: #7e4a63;
	--mof-selection-fg: #f4f1ec;
}

::selection { background: var(--mof-selection-bg); color: var(--mof-selection-fg); }
input,
textarea { caret-color: var(--wp--preset--color--brass); }
html { scrollbar-color: var(--wp--preset--color--line-strong) var(--wp--preset--color--bone); }

/* Light theme — overrides only the preset colour variables. */
:root[data-theme="light"] {
	color-scheme: light;

	--wp--preset--color--bone: #f4f1ec;
	--wp--preset--color--paper: #fbfaf7;
	--wp--preset--color--ink-deep: #211e1c;
	--wp--preset--color--plum-bg: #54263f;
	--wp--preset--color--ink: #242120;
	--wp--preset--color--ink-muted: #6e665f;
	--wp--preset--color--ink-soft: #6f6659;
	--wp--preset--color--on-dark: #f4f1ec;
	--wp--preset--color--on-plum: #f0e6ec;
	--wp--preset--color--hairline: #ded7cb;
	--wp--preset--color--line-strong: #c9c0b2;
	--wp--preset--color--accent-plum: #54263f;
	--wp--preset--color--plum-soft: #7e4a63;
	--wp--preset--color--brass: #785d31;
	--wp--preset--color--white: #ffffff;
}

/* Smooth the theme switch, but never for users who ask for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
	html { transition: none; }
	body,
	.mof-card,
	.mof-record,
	.wp-block-button__link { transition: background-color var(--mof-transition), color var(--mof-transition), border-color var(--mof-transition); }
}
