/*
 * edusys design tokens — the contract Tasks 3 (components + styleguide) and
 * 4 (tests/design.sh) consume VERBATIM: the property NAMES below (task-2-
 * brief.md), and the ratio numbers in every color token's comment, which
 * Task 4's own suite re-computes from THIS live file — a wrong number here
 * reddens there (that pair of computations is the red-proof chain).
 *
 * Palette + WCAG discipline verbatim from docs/client-decisions-demo.md S1
 * (client-side decisions, demo environment, 2026-09-04 — "you become Inesa"
 * ruling): the black/white base carries all body text; every accent color's
 * approved pairing is stated AT the token, ratios computed against both
 * white and black grounds — never inferred from a screenshot. Rule, quoted:
 * "identitetas: monochrominė dominantė + akcentai, kurie niekada patys
 * neneša teksto ant balto."
 *
 * NO !important anywhere in this file — Task 1's override map
 * (docs/design-surface.md §1.8) proved every surface this system needs to
 * win is EQUAL specificity, won by enqueue-after source order
 * (Design\Module::enqueue(), priority 20 on wp_enqueue_scripts).
 *
 * Marker comments (=== EDUSYS-TOKENS:*-BEGIN/END ===) delimit the four
 * blocks tests/unit/design_module.test.php parses by exact marker, not by
 * brace-counting — do not remove or rename them without updating that file.
 */

/* === EDUSYS-TOKENS:ROOT-BEGIN === */
:root {
	/* Color — every value here is text-capable; each carries its approved
	   pairing AT the token, per the Global Constraints' S1-is-LAW rule. */
	--edusys-color-ink: #000000; /* Pagrindinis tekstas/fonas — juoda/balta bazė, 21.0:1. Tekstui saugu visada. */
	--edusys-color-paper: #ffffff; /* Pagrindinis fonas/tekstas — juoda/balta bazė, 21.0:1. Tekstui saugu visada. */
	--edusys-color-accent-yellow: #F9ED58; /* TIK fonas; tekstas ant jo — TIK --edusys-color-ink (17.3:1). Ant balto NIEKADA (1.22:1). */
	--edusys-color-accent-green: #2BB673; /* TIK grafika/dideli dekoratyviniai elementai; NIEKADA tekstas normaliame režime — taisyklė galioja neatsižvelgiant į skaičius: balta ant žalios 2.61:1 (neatitinka 4.5:1), juoda ant žalios 8.04:1 (SKAIČIUS atitiktų 4.5:1, bet S1 taisyklė vis tiek draudžia — tekstui skirtas tik HC režimo patamsintas #1B7449, žr. žemiau). */
	--edusys-color-accent-pink: #f473d0; /* Fonas su JUODU tekstu (8.21:1) arba grafika; ant balto teksto NIEKADA nešti (2.56:1). */

	/* Type — fallback chains proven LT-diacritics-complete and vendored
	   (docs/design-surface.md §M2); font files served by
	   edusys_design_fonts (Design\Module::FONTS_HANDLE). */
	--edusys-font-display: "Bodoni Moda", "Playfair Display", Georgia, "Times New Roman", serif;
	--edusys-font-body: "Inter", "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

	--edusys-type-s: 0.875rem;
	--edusys-type-m: 1rem;
	--edusys-type-l: 1.25rem;
	--edusys-type-xl: 1.75rem;
	--edusys-type-xxl: 2.5rem;

	/* Space — 4/8px-derived scale, used by Task 3's components.css and its
	   mobile-first breakpoints (req 81). */
	--edusys-space-1: 4px;
	--edusys-space-2: 8px;
	--edusys-space-3: 16px;
	--edusys-space-4: 24px;
	--edusys-space-5: 32px;
	--edusys-space-6: 48px;
}
/* === EDUSYS-TOKENS:ROOT-END === */

/*
 * High-contrast token set — activated BOTH by the OS-level
 * `prefers-contrast: more` media query AND by the `[data-edusys-contrast=
 * "high"]` attribute the footer toggle (Design\Module::renderContrastToggle())
 * sets on <html> and persists to localStorage, so a visitor can opt in even
 * when their OS never reports the preference — and a visitor whose OS
 * already reports it gets the exact SAME token set, not a second value that
 * could drift from this one.
 *
 * COLOR TOKENS ONLY, by construction: both blocks below list precisely the
 * 5 --edusys-color-* custom properties from :root above and nothing else —
 * no --edusys-font-*/--edusys-space-*/--edusys-type-* property is ever
 * redefined here (pinned by tests/unit/design_module.test.php's property-
 * name-set diff against :root).
 *
 * Only --edusys-color-accent-green actually changes value. --edusys-color-
 * ink/-paper are already at the theoretical maximum (21.0:1) and -accent-
 * yellow/-accent-pink's approved BACKGROUND+ink pairings (17.3:1, 8.21:1)
 * already clear WCAG AA (4.5:1) with wide margin, so restating them
 * unchanged is not decoration — it is what "redefines ONLY color tokens,
 * property-name-set otherwise identical" requires: the SAME 5 names appear
 * in both places. Green is the one accent the normal palette forbids from
 * EVER carrying text regardless of the numbers: white-on-green fails
 * outright (2.61:1, below 4.5:1); black-on-green would numerically PASS
 * (8.04:1, above 4.5:1) but S1's rule is a flat ban, not a threshold check —
 * green stays graphics-only in normal mode either way — so high-contrast
 * mode substitutes a darkened green FOR TEXT USE instead of reusing either
 * normal-mode pairing.
 *
 * Computed at authoring time (HSL lightness 0.44 -> 0.28, same hue 151°/
 * same saturation 62%, so the darkened value still reads as "the same
 * green"), WCAG relative-luminance formula, sRGB:
 *   #1B7449 on --edusys-color-paper (#ffffff): 5.77:1  (>= 4.5:1 — safe as TEXT)
 *   #1B7449 on --edusys-color-ink   (#000000): 3.64:1  (< 4.5:1 — do NOT use
 *     as a background under text; text-on-paper is the only approved use)
 * tests/unit/design_module.test.php re-derives both ratios independently
 * from this file's own hex value (not from this comment) as its red-proof.
 */
@media (prefers-contrast: more) {
	/* === EDUSYS-TOKENS:HC-MEDIA-BEGIN === */
	:root {
		--edusys-color-ink: #000000;
		--edusys-color-paper: #ffffff;
		--edusys-color-accent-yellow: #F9ED58;
		--edusys-color-accent-green: #1B7449; /* Darkened for TEXT use — 5.77:1 on --edusys-color-paper, 3.64:1 on --edusys-color-ink (never as a text background). */
		--edusys-color-accent-pink: #f473d0;
	}
	/* === EDUSYS-TOKENS:HC-MEDIA-END === */
}

/* === EDUSYS-TOKENS:HC-ATTR-BEGIN === */
[data-edusys-contrast="high"] {
	--edusys-color-ink: #000000;
	--edusys-color-paper: #ffffff;
	--edusys-color-accent-yellow: #F9ED58;
	--edusys-color-accent-green: #1B7449; /* Darkened for TEXT use — 5.77:1 on --edusys-color-paper, 3.64:1 on --edusys-color-ink (never as a text background). */
	--edusys-color-accent-pink: #f473d0;
}
/* === EDUSYS-TOKENS:HC-ATTR-END === */
