/*
 * base.css — typography defaults, resets, focus, motion, and the
 * dark-mode token layer. Loaded after critical.css (which already
 * declares the root tokens for the first paint) so it's safe to
 * extend without re-declaring the palette.
 */

/* Selection styling */
::selection {
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--text-strong);
}

/* Default link in body content (overrides theme.json's element link
   declaration only on the front end). */
body a { transition: color 120ms cubic-bezier(0.4, 0, 0.2, 1); }

/* Heading top margins — theme.json sets sizes; we set rhythm here. */
h1, h2, h3, h4, h5, h6 { margin-block: 0; }

/* Lists in prose contexts get balanced rhythm. */
ul, ol { padding-inline-start: 1.5rem; }
li { margin-block: 0.25em; }

/* Tables: by default WP block tables render OK; we just tighten lines. */
table { border-collapse: collapse; width: 100%; }

/* Forms: ensure inputs inherit body font and have a visible focus ring. */
input, textarea, select, button {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
}

/* hr defaults */
hr { border: 0; border-top: 1px solid var(--wp--preset--color--border); margin-block: 2em; }

/* Reduced motion enforcement repeats from critical.css for the
   case where critical.css fails to load. */
@media (prefers-reduced-motion: reduce) {
	html:focus-within { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Visually hide but keep accessible to screen readers. */
.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;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	background-color: var(--wp--preset--color--surface);
	clip: auto !important;
	clip-path: none;
	color: var(--wp--preset--color--text);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 1rem 1.5rem;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}
