/*
 * WRRS base styles: root size, focus, skip link, layout primitives.
 * Font faces come from theme.json (settings.typography.fontFamilies[].fontFace).
 */

html {
	/* 1.25rem = 20px at default browser settings; steps to 24px / 28px via the
	   text size control (see tokens.css). Everything else is em/rem, so the whole
	   page scales together. */
	font-size: var(--wrrs-text);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--wrrs-bg);
	color: var(--wrrs-ink);
	overflow-wrap: break-word;
}

img {
	max-width: 100%;
	height: auto;
}

/* ---------- Focus: always visible, never hover-only ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 0.2em solid var(--wrrs-focus-color, var(--wrrs-ink));
	outline-offset: 0.2em;
	box-shadow: var(--wrrs-focus-glow, 0 0 0 0.4em var(--wrrs-gold));
}

/* Dark surfaces (player bar, footer): gold outline, no outer glow. */
.wrrs-pbar,
.wrrs-footer {
	--wrrs-focus-color: var(--wrrs-gold);
	--wrrs-focus-glow: none;
}

/* ---------- Skip link ---------- */

.wrrs-skip {
	position: absolute;
	left: 1em;
	top: -6em;
	z-index: 1000;
	padding: 0.7em 1.1em;
	border-radius: var(--wrrs-radius-sm);
	background: var(--wrrs-gold);
	color: var(--wrrs-black);
	font-weight: 800;
	text-decoration: none;
}

.wrrs-skip:focus {
	top: 1em;
}

/* ---------- Utilities ---------- */

.wrrs-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Controls that need JavaScript stay hidden until JS has marked the page. */
html:not(.wrrs-js) .wrrs-needs-js {
	display: none !important;
}

/* ---------- Layout ---------- */

.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > footer {
	margin-top: auto;
}

/* Reset the block gap WordPress adds between top-level parts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

.wrrs-container {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wrrs-container);
	margin-inline: auto;
	padding-inline: var(--wrrs-gutter);
}

.wrrs-main {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wrrs-container);
	margin-inline: auto;
	padding: 3rem var(--wrrs-gutter) 4rem;
	display: flex;
	flex-direction: column;
	gap: 4rem;
}

@media (max-width: 52em) {
	.wrrs-main {
		padding-block: 1.6rem 2.4rem;
		gap: 2.4rem;
	}
}

/* Links in running text keep an underline; nav, buttons and knobs opt out. */
a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.09em;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* Direct children of the page containers are spaced by flex gap, not block margins. */
.wrrs-main > * {
	margin: 0;
}
