/*
 * Base styles: global foundation only. No page sections or blocks.
 * Loaded after GeneratePress so equal-specificity rules here take precedence.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	/* Anchored sections clear the compact sticky header (and the WordPress admin bar when logged in). */
	scroll-padding-top: calc(var(--header-height-compact) + var(--wp-admin--admin-bar--height, 0px));
}

body {
	margin: 0;
	background-color: var(--colour-white);
	color: var(--colour-text-secondary);
	font-family: var(--font-body);
	font-size: var(--text-body);
	font-weight: var(--weight-regular);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ---- Headings ---------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--space-5);
	color: var(--colour-text);
	font-family: var(--font-heading);
	font-weight: var(--weight-semibold);
	line-height: var(--lh-heading);
}

h1 {
	font-size: var(--text-h1);
	line-height: var(--lh-display);
}

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

h1,
h2,
h3,
h4 {
	text-wrap: pretty; /* avoids a single-word last line */
}

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

h4 {
	font-size: var(--text-h4);
	line-height: var(--lh-snug);
}

h5,
h6 {
	font-size: var(--text-body);
	line-height: var(--lh-snug);
}

/* ---- Text -------------------------------------------------------------------------- */

p {
	margin: 0 0 var(--space-4);
}

strong,
b {
	font-weight: var(--weight-semibold);
}

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

/* ---- Links ------------------------------------------------------------------------- */

a {
	color: var(--colour-text);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--transition-fast);
}

a:hover {
	color: var(--colour-red-text);
}

/* ---- Lists ------------------------------------------------------------------------- */

ul,
ol {
	margin: 0 0 var(--space-4);
	padding-left: 1.25em;
}

li > ul,
li > ol {
	margin-bottom: 0;
}

/* ---- Media ------------------------------------------------------------------------- */

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

/* ---- Buttons and forms (unstyled globals; the visual button is .pw-button) ---------- */

button,
input,
select,
textarea {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

button {
	cursor: pointer;
}

label {
	display: block;
	margin-bottom: var(--space-2);
	color: var(--colour-text);
	font-weight: var(--weight-semibold);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
	display: block;
	width: 100%;
	min-height: 3rem;
	padding: var(--space-3) var(--space-4);
	border: var(--border);
	border-radius: var(--radius);
	background-color: var(--colour-white);
	color: var(--colour-text);
}

textarea {
	min-height: 9rem;
}

/* ---- Focus ------------------------------------------------------------------------- */

:focus-visible {
	outline: 3px solid var(--colour-focus);
	outline-offset: 2px;
}

/* ---- Smooth scrolling: same-page anchor jumps only; none for reduced-motion users -------- */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ---- Reduced motion ---------------------------------------------------------------- */

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

/* ---- Accessibility helpers ---------------------------------------------------------- */

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

.pw-skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 1000;
	padding: var(--space-3) var(--space-5);
	background-color: var(--colour-charcoal);
	color: var(--colour-white);
	font-weight: var(--weight-semibold);
	transform: translateY(-200%);
}

.pw-skip-link:focus {
	transform: none;
	color: var(--colour-white);
	outline-color: var(--colour-red);
}

.pw-main:focus {
	outline: none;
}

.pw-lead {
	font-size: var(--text-lead);
	line-height: var(--lh-lead);
}
