/*
 * Design tokens and shared rules for the wwd- blocks. The tokens are --wwd- prefixed custom properties, so they
 * change nothing on the rest of the site; the rules are scoped to .wwd. Values come from the HTML designs
 * (Oxygen 300/400/700, navy/teal, 100px/120px desktop padding). Use a token whenever a value is already in this
 * list; add a new one only when the value is used in more than one place.
 */
:root {
	/* Colours */
	--wwd-white: #fff;
	--wwd-navy: #0b4a66;
	--wwd-navy-deep: #0a2540;
	--wwd-ink: #0b1926;
	--wwd-deep: #0b2533;
	--wwd-teal: #0089a6;
	--wwd-teal-text: #00728a;
	--wwd-teal-alt: #00877c;
	--wwd-cyan: #00a9c9;
	--wwd-light: #ecf8fb;
	--wwd-pale: #e3f3f8;
	--wwd-grey: #f0f4f5;
	--wwd-border: #d6e2e8;
	--wwd-line: #b9d3dd;
	--wwd-accent: #ff5c00;
	--wwd-yellow: #ffc629;
	--wwd-text: var(--wwd-ink);
	--wwd-body: #3d5260;
	--wwd-note: #4f6573;
	--wwd-muted: #5b6b73;
	--wwd-slate: #718096;
	--wwd-link-hover: #00708a;

	/* Error & Validation tokens matching theme accent */
	--wwd-error: #d9381e;
	--wwd-error-dark: #9e2310;
	--wwd-error-bg: #fff5f2;
	--wwd-error-border: #f8c9be;
	--wwd-error-border-soft: #fbd6ce;
	--wwd-error-ring: rgba(217, 56, 30, 0.15);

	/* Type sizes (px), named by role */
	--wwd-fs-xxs: 13px;
	--wwd-fs-xs: 14px;
	--wwd-fs-sm: 15px;
	--wwd-fs-md: 16px;
	--wwd-fs-body: 17px;
	--wwd-fs-lead: 18px;
	--wwd-fs-h4: 20px;
	--wwd-fs-h3: 24px;
	--wwd-fs-h2: 30px;
	--wwd-fs-h1: 46px;

	/* Space (px), named by size */
	--wwd-space-8: 8px;
	--wwd-space-10: 10px;
	--wwd-space-12: 12px;
	--wwd-space-14: 14px;
	--wwd-space-16: 16px;
	--wwd-space-20: 20px;
	--wwd-space-24: 24px;
	--wwd-space-40: 40px;

	/* Panel padding: boxes, callouts and cards */
	--wwd-pad-card: 32px 36px;
	--wwd-pad-card-sm: 24px 20px;
	--wwd-pad-card-phone: 22px 20px 24px;
}

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

/* Offset for in-page anchors so content doesn't hide behind sticky jump navigation */
.wwd[id],
section[id],
div[id].wwd {
	scroll-margin-top: 60px;
}

@media (min-width: 1025px) {
	.wwd[id],
	section[id],
	div[id].wwd {
		scroll-margin-top: 76px;
	}
}

.admin-bar .wwd[id],
.admin-bar section[id],
.admin-bar div[id].wwd {
	scroll-margin-top: 92px;
}

@media (min-width: 1025px) {
	.admin-bar .wwd[id],
	.admin-bar section[id],
	.admin-bar div[id].wwd {
		scroll-margin-top: 108px;
	}
}

.wwd {
	--wwd-pad-y: 56px;
	--wwd-pad-x: 20px;
	--wwd-max: 1200px;
	--wwd-radius: 4px;

	box-sizing: border-box;
	padding: var(--wwd-pad-y) var(--wwd-pad-x);
	color: var(--wwd-ink);
	font-family: Oxygen, sans-serif;
	font-weight: 300;
	line-height: 1.6;
}

/* The parent theme colours every p grey; the designs use the colour of the block. Zero specificity beyond the element, so any block rule wins. */
:where(.wwd) p:is(p) {
	color: inherit;
}

.wwd *,
.wwd *::before,
.wwd *::after {
	box-sizing: inherit;
}

@media (min-width: 1024px) {
	.wwd {
		--wwd-pad-y: 100px;
		--wwd-pad-x: 120px;

		/* Wider than 1440px the content stays 1200px and centred; the background still runs edge to edge. */
		padding-left: max(var(--wwd-pad-x), calc((100% - var(--wwd-max)) / 2));
		padding-right: max(var(--wwd-pad-x), calc((100% - var(--wwd-max)) / 2));
	}
}

.wwd--bg-light { background: var(--wwd-light); }
.wwd--bg-grey { background: var(--wwd-grey); }
.wwd--bg-navy { background: var(--wwd-navy); color: var(--wwd-white); }

.wwd--space-no-top { padding-top: 0; }
.wwd--space-no-bottom { padding-bottom: 0; }
.wwd--space-compact { --wwd-pad-y: 32px; }

/* The notice a block shows in the editor when it has no content yet. */
.wwd__empty {
	padding: var(--wwd-space-40);
	text-align: center;
	color: var(--wwd-muted);
}

.wwd__inner {
	max-width: var(--wwd-max);
	margin: 0 auto;
}

.wwd__eyebrow {
	margin: 0 0 12px;
	color: var(--wwd-teal-text);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .02em;
}

@media (min-width: 1025px) {
	.wwd__eyebrow {
		font-size: var(--wwd-fs-lead);
	}
}

.wwd--bg-navy .wwd__eyebrow { color: var(--wwd-yellow); }

/* Section heading (h2): 30px on phones, 46px from 1025px. The colour is left to the block. */
.wwd__h2 {
	margin: 0;
	font-size: var(--wwd-fs-h2);
	font-weight: 300;
	letter-spacing: -.025em;
	line-height: 1.15;
}

@media (min-width: 1025px) {
	.wwd__h2 {
		font-size: var(--wwd-fs-h1);
		letter-spacing: -.03em;
		line-height: 1.12;
	}
}

/*
 * Pills, as in the designs: 16px bold capitals, 56px tall (52px on phones, small 46px / 44px on phones). Fill,
 * outline, white, ghost and yellow variants. On phones the outline, white and ghost pills get a 2px yellow border,
 * as the phone designs do.
 */
.wwd-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wwd-space-10);
	min-height: 52px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: 60px;
	font: 700 14px/1 Oxygen, sans-serif;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s, color .15s, border-color .15s;
}

.wwd-pill--small { min-height: 44px; padding: 0 20px; font-size: var(--wwd-fs-xxs); }
.wwd-pill--yellow { background: var(--wwd-yellow); border-color: var(--wwd-yellow); color: var(--wwd-ink); }
.wwd-pill--yellow:hover { background: #ffd257; border-color: #ffd257; color: var(--wwd-ink); }
.wwd-pill--navy { background: var(--wwd-navy); border-color: var(--wwd-navy); color: var(--wwd-white); }
.wwd-pill--navy:hover { background: #083a50; border-color: #083a50; color: var(--wwd-white); }
.wwd-pill--white { background: var(--wwd-white); border-color: var(--wwd-white); color: var(--wwd-navy); }
.wwd-pill--white:hover { background: var(--wwd-light); color: var(--wwd-navy); }
.wwd-pill--outline { background: var(--wwd-white); border-color: #d6dfe4; color: var(--wwd-navy); }
.wwd-pill--outline:hover { border-color: var(--wwd-navy); }
.wwd-pill--ghost { background: transparent; border-color: rgba(255, 255, 255, .7); color: var(--wwd-white); }
.wwd-pill--ghost:hover { background: rgba(255, 255, 255, .12); color: var(--wwd-white); }

/* As in the designs, at every width: the outline, white and ghost pills have a 2px yellow border. */
.wwd-pill--outline,
.wwd-pill--white,
.wwd-pill--ghost { border: 2px solid var(--wwd-yellow); }
.wwd-pill--outline:hover { border-color: var(--wwd-navy); }

@media (min-width: 768px) {
	.wwd-pill { min-height: 56px; padding: 0 36px; font-size: var(--wwd-fs-md); }
	.wwd-pill--small { min-height: 46px; padding: 0 24px; font-size: var(--wwd-fs-xs); }
}

.wwd-pill:focus-visible { outline: 3px solid var(--wwd-accent); outline-offset: 2px; }

.wwd-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/*
 * Form Control Appearance Fixes
 * Overrides parent styles.css `input { -webkit-appearance: none; }` which stripped native radio & checkbox controls.
 */
input[type="radio"],
.gform_wrapper input[type="radio"],
.gfield-choice-input[type="radio"] {
	-webkit-appearance: radio !important;
	appearance: auto !important;
}

input[type="checkbox"],
.gform_wrapper input[type="checkbox"],
.gfield-choice-input[type="checkbox"] {
	-webkit-appearance: checkbox !important;
	appearance: auto !important;
}

