/**
 * Base: reset, document defaults, typography and accessibility primitives.
 */

/* --- Reset ----------------------------------------------------------- */

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
	margin: 0;
}

ul[class],
ol[class] {
	margin: 0;
	padding: 0;
	list-style: none;
}

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

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

/* --- Document -------------------------------------------------------- */

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

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

body {
	margin: 0;
	background-color: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-body);
	font-size: var(--fs-base);
	font-weight: var(--fw-regular);
	line-height: var(--lh-base);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* Inter ships contextual alternates and tabular figures; cv11 gives the
	   single-storey 'a' used across this category's UI type. */
	font-feature-settings: "cv11", "ss01";
	font-variant-numeric: tabular-nums;
}

/* --- Typography ------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
	color: var(--c-heading);
	font-family: var(--font-heading);
	font-weight: var(--fw-bold);
	line-height: var(--lh-tight);
	/* Negative tracking is what makes a grotesque read as display type
	   rather than enlarged body copy. Tightened further on the largest
	   sizes, where the optical gap between letters grows. */
	letter-spacing: var(--ls-heading);
	text-wrap: balance;
}

h1 {
	font-size: var(--fs-3xl);
	font-weight: var(--fw-black);
	letter-spacing: var(--ls-display);
}

h2 {
	font-size: var(--fs-2xl);
	font-weight: var(--fw-black);
	letter-spacing: var(--ls-display);
}

h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h5 { font-size: var(--fs-md); line-height: var(--lh-snug); }
h6 {
	font-size: var(--fs-sm);
	line-height: var(--lh-snug);
	letter-spacing: var(--ls-caps);
	text-transform: uppercase;
}

/* The scale is fluid via clamp(), so no breakpoint overrides are needed. */

/* Eyebrow label above a heading. Used across the competitive set to
   categorise a section without spending a heading level on it. */
.eyebrow {
	display: block;
	margin-bottom: var(--sp-2xs);
	color: var(--c-brand);
	font-family: var(--font-heading);
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-caps);
	text-transform: uppercase;
}

.has-overlay .eyebrow,
.bg-inverse .eyebrow {
	color: var(--c-accent);
}

p {
	text-wrap: pretty;
}

p + p,
p + ul,
p + ol,
ul + p,
ol + p {
	margin-top: var(--sp-sm);
}

h2 + *,
h3 + *,
h4 + * {
	margin-top: var(--sp-xs);
}

a {
	color: var(--c-link);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	transition: color var(--dur-fast) var(--ease);
}

a:hover {
	color: var(--c-link-hover);
}

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

small { font-size: var(--fs-sm); }

hr {
	height: 1px;
	margin: var(--sp-lg) 0;
	border: 0;
	background-color: var(--c-border);
}

blockquote {
	margin: var(--sp-md) 0;
	padding-left: var(--sp-md);
	border-left: 4px solid var(--c-brand);
	color: var(--c-text-muted);
	font-size: var(--fs-md);
}

/* Prose lists inside editor content keep their markers. */
.prose ul,
.prose ol {
	margin: var(--sp-sm) 0;
	padding-left: var(--sp-md);
}

.prose li + li {
	margin-top: var(--sp-3xs);
}

.prose > * + * {
	margin-top: var(--sp-sm);
}

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

img {
	height: auto;
}

figure {
	margin: var(--sp-md) 0;
}

figcaption {
	margin-top: var(--sp-2xs);
	color: var(--c-text-muted);
	font-size: var(--fs-sm);
}

/* Responsive embeds for iframes dropped into editor content. */
.embed-responsive {
	position: relative;
	aspect-ratio: 16 / 9;
}

.embed-responsive iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --- Tables ---------------------------------------------------------- */

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

.prose table {
	margin: var(--sp-md) 0;
	font-size: var(--fs-sm);
}

.prose th,
.prose td {
	padding: var(--sp-2xs) var(--sp-xs);
	border: 1px solid var(--c-border);
	text-align: left;
	vertical-align: top;
}

.prose th {
	background-color: var(--c-bg-subtle);
	font-weight: var(--fw-bold);
}

/* Wide tables scroll rather than breaking the layout. */
.table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

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

/**
 * Visible focus indicator.
 *
 * Applied via :focus-visible so it appears for keyboard users without
 * showing a ring on every mouse click. The :focus fallback covers browsers
 * without :focus-visible support. Never remove these without an equally
 * visible replacement: WCAG 2.2 AA, 2.4.7 Focus Visible and 2.4.11 Focus
 * Not Obscured.
 */
:focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
	/* Fills the outline-offset gap with the dark inner ring, so the
	   indicator reads against light and dark surfaces alike. */
	box-shadow: 0 0 0 var(--focus-offset) var(--c-focus-inner);
	border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
	outline: none;
}

/* Browsers without :focus-visible still get a ring. */
@supports not selector(:focus-visible) {
	:focus {
		outline: var(--focus-ring);
		outline-offset: var(--focus-offset);
		box-shadow: 0 0 0 var(--focus-offset) var(--c-focus-inner);
	}
}

/**
 * Visually hidden, still announced by screen readers.
 */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/**
 * Skip link.
 *
 * Hidden until focused, then pinned to the top of the viewport. The previous
 * theme hid this permanently with visibility:hidden, which fails WCAG 2.4.1
 * Bypass Blocks. It must be reachable by keyboard.
 */
.skip-link {
	position: absolute;
	top: 0;
	left: var(--sp-sm);
	z-index: var(--z-skiplink);
	padding: var(--sp-2xs) var(--sp-sm);
	transform: translateY(-120%);
	background-color: var(--c-white);
	color: var(--c-brand-dark);
	font-weight: var(--fw-bold);
	text-decoration: none;
	border: 2px solid var(--c-brand);
	border-radius: 0 0 var(--radius-md) var(--radius-md);
	box-shadow: var(--shadow-md);
	transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus {
	transform: translateY(0);
}

/* Give in-page anchor targets room below a sticky header. */
:target {
	scroll-margin-top: var(--sp-2xl);
}

/* Respect reduced motion for any decorative animation. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* --- Print ----------------------------------------------------------- */

@media print {
	.site-header,
	.site-footer,
	.skip-link,
	.scroll-to-top {
		display: none !important;
	}

	body {
		color: #000;
		font-size: 12pt;
	}
}
