/*
 * Global element defaults — port of src/styles/global.css from the Astro
 * reference theme. Tokens come from theme.json (--wp--preset--* and
 * --wp--custom--*); only non-tokenizable base rules live here.
 */

html {
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
	scroll-behavior: smooth;
}

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

/* In-page anchors (Chapters nav, TOC) land below the sticky header. */
:where(h1, h2, h3, h4, h5, h6)[id],
[id].scroll-anchor {
	scroll-margin-top: var(--wp--custom--header--scroll-margin, 90px);
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

main.gow-main {
	flex: 1;
}

a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* One consistent keyboard-focus ring across interactive chrome (a11y + polish).
   :where() keeps specificity 0 so components with their own :focus-visible
   (search, language pills) still win; shows on keyboard focus only. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
	border-radius: 4px;
}

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

/* Layout container utility — body content capped at 1200px. */
.container-page {
	width: 100%;
	max-width: var(--wp--custom--width--container, 1200px);
	margin-inline: auto;
	padding-inline: clamp(16px, 3vw, 40px);
}

/* Shared button + chip conventions (hover-lift tiers: -1px inline, -2px chips, -3px cards). */
.gow-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--wp--custom--radius--pill, 999px);
	border: 1px solid var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.gow-button:hover {
	transform: translateY(-1px);
	box-shadow: var(--wp--custom--shadow--soft);
	color: var(--wp--preset--color--surface);
}

.gow-button--secondary {
	background: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--border);
	color: var(--wp--preset--color--contrast);
}

.gow-button--secondary:hover {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--contrast);
}

.gow-eyebrow {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--contrast-2);
}

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

.screen-reader-text:focus {
	clip-path: none;
	display: block;
	height: auto;
	left: 5px;
	top: 5px;
	width: auto;
	z-index: 100000;
	background: var(--wp--preset--color--surface);
	padding: 12px 18px;
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--custom--shadow--raised);
}
