/* ==========================================================================
   Base: a minimal reset, document defaults, the type scale and .prose for
   editor content. Element selectors stop at the reset; everything else in the
   theme is class-based so styles never leak into unrelated markup.
   ========================================================================== */

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

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + var(--sp-5));
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--c-white);
	color: var(--c-text);
	font-family: var(--font-sans);
	font-size: var(--fs-body);
	font-weight: var(--fw-regular);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
h4 {
	color: var(--c-ink);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-heading);
	text-wrap: balance;
}

p,
li,
dd {
	text-wrap: pretty;
}

/* Zero specificity so any component class can set its own spacing. */
:where(ul[class], ol[class]) {
	margin: 0;
	padding: 0;
	list-style: none;
}

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

img,
video {
	height: auto;
}

/* Moved here from WordPress's inline style for sizes="auto" images. */
img:is([sizes="auto" i], [sizes^="auto," i]) {
	contain-intrinsic-size: 3000px 1500px;
}

address {
	font-style: normal;
}

a {
	color: inherit;
}

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

button {
	cursor: pointer;
}

[hidden] {
	display: none !important;
}

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

::selection {
	background: var(--c-brand-tint);
	color: var(--c-brand-deep);
}

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

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

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

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

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

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--sp-4);
	z-index: 1000;
	padding: 0.75rem 1rem;
	border-radius: var(--r-sm);
	background: var(--c-ink);
	color: var(--c-white);
	font-weight: var(--fw-semibold);
	text-decoration: none;
}

.skip-link:focus {
	top: var(--sp-3);
}

/* Type scale --------------------------------------------------------------- */

.t-display {
	font-size: var(--fs-display);
	line-height: var(--lh-display);
	letter-spacing: var(--tr-display);
}

.t-h1 {
	font-size: var(--fs-h1);
	line-height: 1.08;
	letter-spacing: var(--tr-h1);
}

.t-h2 {
	font-size: var(--fs-h2);
	line-height: var(--lh-heading);
	letter-spacing: var(--tr-h2);
}

.t-h3 {
	font-size: var(--fs-h3);
	line-height: var(--lh-snug);
	letter-spacing: var(--tr-h3);
}

.t-lead {
	font-size: var(--fs-lead);
	line-height: 1.55;
	letter-spacing: -0.005em;
}

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

.t-muted {
	color: var(--c-muted);
}

.tabular {
	font-variant-numeric: tabular-nums;
}

/* Prose: WordPress editor content (legal pages, case-study evidence, posts) - */

.prose {
	max-width: 68ch;
	color: var(--c-text);
}

.prose > * + * {
	margin-top: 1.1em;
}

.prose h2 {
	margin-top: 2.2em;
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
	letter-spacing: -0.02em;
	scroll-margin-top: calc(var(--header-h) + var(--sp-5));
}

.prose h3 {
	margin-top: 1.8em;
	font-size: 1.1875rem;
	letter-spacing: var(--tr-h3);
}

.prose h2 + *,
.prose h3 + * {
	margin-top: 0.6em;
}

.prose a {
	color: var(--c-brand);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.prose a:hover {
	color: var(--c-brand-strong);
}

.prose strong {
	color: var(--c-ink);
	font-weight: var(--fw-semibold);
}

.prose ul,
.prose ol {
	padding-left: 1.25em;
}

.prose li + li {
	margin-top: 0.45em;
}

.prose li::marker {
	color: var(--c-brand);
}

.prose blockquote {
	padding-left: 1em;
	border-left: 2px solid var(--c-brand);
	color: var(--c-ink);
}

.prose hr {
	margin-block: 2.5em;
	border: 0;
	border-top: 1px solid var(--c-line);
}

.prose img,
.prose video {
	border-radius: var(--r-md);
}

.prose figcaption {
	margin-top: 0.5em;
	color: var(--c-muted);
	font-size: var(--fs-small);
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-small);
}

.prose th,
.prose td {
	padding: 0.6em 0.8em;
	border-bottom: 1px solid var(--c-line);
	text-align: left;
	vertical-align: top;
}

.prose .lead {
	color: var(--c-text);
	font-size: var(--fs-lead);
	line-height: 1.55;
}

.prose .toc {
	padding: var(--sp-5);
	border: 1px solid var(--c-line);
	border-radius: var(--r-md);
	background: var(--c-surface);
}

.prose .toc__title {
	margin-bottom: var(--sp-3);
	color: var(--c-muted);
	font-size: var(--fs-eyebrow);
	font-weight: var(--fw-semibold);
	letter-spacing: var(--tr-eyebrow);
	text-transform: uppercase;
}

.prose .toc ol {
	margin: 0;
	padding-left: 1.25em;
	columns: 2;
	column-gap: var(--sp-6);
}

.prose .toc li {
	margin: 0 0 0.35em;
	break-inside: avoid;
}

@media (max-width: 39.99rem) {
	.prose .toc ol {
		columns: 1;
	}
}

/* Editor palette (theme.json) so block colour choices render on the front end. */
.has-brand-color { color: var(--c-brand); }
.has-ink-color { color: var(--c-ink); }
.has-text-color { color: var(--c-text); }
.has-muted-color { color: var(--c-muted); }
.has-white-color { color: var(--c-white); }
.has-brand-background-color { background-color: var(--c-brand); }
.has-ink-background-color { background-color: var(--c-ink); }
.has-surface-background-color { background-color: var(--c-surface); }
.has-white-background-color { background-color: var(--c-white); }
.has-small-font-size { font-size: var(--fs-small); }
.has-body-font-size { font-size: var(--fs-body); }
.has-lead-font-size { font-size: var(--fs-lead); }
