/**
 * Design-token layer (light mode / default values) + base typography.
 *
 * Brand tokens (primary/secondary/accent/success/warning/danger/info,
 * spacing, font sizes, radius, shadow, transition, container) all come
 * from theme.json and are already available as
 * var(--wp--preset--color--*), var(--wp--preset--spacing--*),
 * var(--wp--preset--font-size--*) and var(--wp--custom--*) — see
 * theme.json for the source of truth. Do not redefine those here.
 *
 * What theme.json CANNOT express is a *second*, dark-mode value for a
 * token. So the handful of tokens that need to flip between light and
 * dark (surface, background, foreground, border) are defined as our own
 * semantic custom properties here, in one place, and every component
 * reads only these semantic names — never a raw hex, never a
 * light-mode-only preset — so dark mode (base/_dark-mode.css) can
 * override them globally with zero component-level changes.
 *
 * Reference breakpoints (kept in sync with theme.json settings.custom.breakpoint;
 * media queries cannot consume CSS custom properties, so these are the
 * literal values every component/layout file should use):
 *   sm: 480px   md: 768px   lg: 1024px   xl: 1280px   xxl: 1536px
 */

:root {
	/* Semantic surface tokens — light mode defaults. Dark overrides in _dark-mode.css. */
	--color-bg: var(--wp--preset--color--background);
	--color-fg: var(--wp--preset--color--foreground);
	--color-surface: var(--wp--preset--color--surface);
	--color-border: var(--wp--preset--color--border);
	--color-fg-muted: #4a5361;

	/* Focus ring, shared by every interactive component. */
	--color-focus-ring: var(--wp--preset--color--secondary);
}

html {
	background-color: var(--color-bg);
	color-scheme: light dark;
}

body {
	background-color: var(--color-bg);
	color: var(--color-fg);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.6;
	transition: background-color var(--wp--custom--transition--base), color var(--wp--custom--transition--base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.25;
	color: var(--color-fg);
}

p {
	max-width: 70ch;
}

a {
	color: var(--wp--preset--color--primary);
	text-decoration-thickness: from-font;
}

a:hover,
a:focus-visible {
	color: var(--wp--preset--color--primary-dark);
}

:focus-visible {
	outline: 2px solid var(--color-focus-ring);
	outline-offset: 2px;
}

/* Screen-reader-only text (WordPress convention: .screen-reader-text). */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--color-surface);
	border-radius: var(--wp--custom--radius--sm);
	box-shadow: var(--wp--custom--shadow--md);
	clip: auto !important;
	clip-path: none;
	color: var(--color-fg);
	display: block;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: var(--wp--preset--spacing--2xs) var(--wp--preset--spacing--xs);
	top: 5px;
	width: auto;
	z-index: 100000;
}

.skip-link {
	position: absolute;
	top: -1000px;
	left: 0;
}

.skip-link:focus {
	top: 0;
	z-index: 100000;
}

::selection {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}
