/*
Theme Name:   Nexus KB
Theme URI:    https://github.com/oxfordinternational/nexus-kb-theme
Description:  Child theme for the Nexus Knowledge Base. Quiet, dense and built for reading. Accessibility is the design, not a compliance layer bolted on: visible two-layer focus, honoured user font sizes, full keyboard operation, high-contrast and forced-colours support, and reduced motion respected throughout.
Author:       Oxford International Education Group — Digital Products
Template:     twentytwentyone
Version:      1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  nexus-kb-theme
Tags:         accessibility-ready, one-column, custom-menu, documentation
*/

/**
 * This file carries the theme header and the design tokens only.
 * All component styles live in assets/css/theme.css so they can be
 * versioned and cached independently.
 *
 * Token rules for this theme:
 *
 * 1. No px on anything typographic. Everything scales from the reader's
 *    own browser font size, which many people with low vision have already
 *    set. A theme that overrides it in px is telling them they were wrong.
 * 2. Every foreground/background pair here clears WCAG AA, and body text
 *    clears AAA (7:1) on the default surface.
 * 3. Every colour has a dark-mode counterpart. Dark mode is not a
 *    preference here, it is an accessibility need for some readers.
 */

:root {
	/* Ink and surface */
	--nkbt-ink: #16191d;          /* 15.8:1 on paper */
	--nkbt-ink-soft: #4a525c;     /*  7.6:1 on paper */
	--nkbt-ink-faint: #636b75;    /*  5.4:1 on paper, 5.0:1 on wash */
	--nkbt-paper: #ffffff;
	--nkbt-wash: #f4f6f8;
	--nkbt-rule: #dde2e7;
	--nkbt-rule-strong: #b9c1ca;

	/* Brand and action */
	--nkbt-navy: #002147;         /* 16.4:1 on paper */
	--nkbt-link: #0b5cad;         /*  6.4:1 on paper */
	--nkbt-link-hover: #073f78;
	--nkbt-visited: #5a3a91;      /*  7.2:1 on paper */

	/* Focus — the signature. Two layers so it survives any background. */
	--nkbt-focus-inner: #002147;
	--nkbt-focus-outer: #ffd166;
	--nkbt-focus-width: 0.1875rem;

	/* Status */
	--nkbt-ok-bg: #e4f1e2;
	--nkbt-ok-fg: #1f5218;
	--nkbt-warn-bg: #fbeed6;
	--nkbt-warn-fg: #6f4404;
	--nkbt-stop-bg: #fae7e7;
	--nkbt-stop-fg: #8a1f1f;

	/* Type */
	--nkbt-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--nkbt-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--nkbt-scale-xs: 0.8125rem;
	--nkbt-scale-sm: 0.875rem;
	--nkbt-scale-base: 1rem;
	--nkbt-scale-lg: 1.125rem;
	--nkbt-scale-xl: 1.375rem;
	--nkbt-scale-2xl: 1.75rem;
	--nkbt-scale-3xl: 2.25rem;

	--nkbt-measure: 68ch;
	--nkbt-radius: 0.375rem;
	--nkbt-tap: 2.75rem;
}

/**
 * Dark mode lives in assets/css/dark.css and is opt-in, not automatic.
 *
 * Following prefers-color-scheme sounds right and is wrong here: the
 * knowledge base plugin paints its own light surfaces, so an automatic dark
 * theme produced a half-dark page with navy headings on a near-black
 * background. Turn it on in Appearance → Customise → Nexus KB once both
 * layers agree, and it applies to the plugin too.
 */

/**
 * Readers who ask for more contrast get it. This is a separate query from
 * dark mode — the two are unrelated needs and conflating them is a common
 * mistake.
 */
@media ( prefers-contrast: more ) {
	:root {
		--nkbt-ink-soft: var(--nkbt-ink);
		--nkbt-ink-faint: var(--nkbt-ink);
		--nkbt-rule: var(--nkbt-ink);
		--nkbt-rule-strong: var(--nkbt-ink);
		--nkbt-link: #063a70;
	}
}
