/**
 * Base / reset layer.
 * Modern, minimal reset + base typography wired to tokens.css.
 * Loaded after tokens.css (see inc/enqueue.php dependency chain).
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Dark is the only theme — this tells the browser to render its
	 * own native UI (scrollbars, form control chrome, etc.) in dark
	 * mode too, so nothing looks like a stray light-mode leftover. */
	color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

html,
body {
	max-width: 100%;
	overflow-x: hidden;
}

body {
	font-family: var(--font-body);
	font-size: var(--text-body);
	line-height: var(--leading-normal);
	color: var(--color-text);
	background-color: var(--color-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	line-height: var(--leading-tight);
	color: var(--color-text);
	font-weight: 700;
	text-wrap: balance;
}

h1 {
	font-size: var(--text-h1);
}

h2 {
	font-size: var(--text-h2);
}

h3 {
	font-size: var(--text-h3);
	font-weight: 600;
}

h4,
h5,
h6 {
	font-size: var(--text-h4);
	font-weight: 600;
}

p {
	text-wrap: pretty;
}

a {
	color: var(--color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--color-primary-hover);
}

ul,
ol {
	padding-left: var(--space-5);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
	background: none;
	border: none;
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* ---------------------------------------------------------------
 * Accessibility utilities
 * ----------------------------------------------------------------- */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: -100px;
	left: var(--space-4);
	z-index: 10000;
	background: var(--color-secondary);
	color: #fff;
	padding: var(--space-3) var(--space-5);
	border-radius: var(--radius-sm);
	transition: top 0.15s ease;
}

.skip-link:focus {
	top: var(--space-4);
	position: fixed;
	width: auto;
	height: auto;
	clip: auto;
	overflow: visible;
}

/* Consistent, visible focus state for every interactive element —
 * required for WCAG keyboard-navigation compliance. Uses :focus-visible
 * so mouse clicks don't show a ring, only keyboard/AT navigation does. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------
 * Layout primitive used by every template
 * ----------------------------------------------------------------- */

.container {
	max-width: var(--content-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}
