/*
 * Base styles.
 *
 * theme.json supplies the design tokens as --wp--preset--* custom properties.
 * This file covers only what sits underneath every page: fonts, document
 * defaults, focus visibility, long-form prose and the contact form.
 *
 * Site chrome lives in chrome.css; page sections live in sections.css.
 */

/* ---------------------------------------------------------------- fonts -- */
/*
 * Source Sans 3 (Adobe's Source Sans Pro) carries the whole site — headings
 * and body. Self-hosted, latin subset, so the site issues no third-party
 * requests and nothing blocks the first paint.
 */
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/source-sans-400.woff2") format("woff2");
}

@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/source-sans-600.woff2") format("woff2");
}

@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/source-sans-700.woff2") format("woff2");
}

/* --------------------------------------------------------------- basics -- */

/*
 * Border-box everywhere. WordPress's block reset does not set this globally,
 * and the layout relies on padding sitting inside declared widths.
 */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

/* Keyboard users must always be able to see where they are. */
:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Inline SVG icons inherit their colour from the element around them. */
.gvd-svg { flex-shrink: 0; }

/* -------------------------------------------------------- scroll reveal -- */
/*
 * Progressive enhancement: elements only start hidden once theme.js confirms
 * scripting is available, so a JS failure can never leave content invisible.
 */
.gvd-js .gvd-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gvd-js .gvd-reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.gvd-js .gvd-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ------------------------------------------------------------------ form -- */

.gvd-form__row {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.gvd-form__row { grid-template-columns: 1fr 1fr; }
}

.gvd-form__field {
	display: grid;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
}

.gvd-form__field label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--wp--preset--color--text);
}

.gvd-form__field input,
.gvd-form__field textarea {
	width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.625rem;
	background: #fff;
	font: inherit;
	font-size: 0.95rem;
	color: var(--wp--preset--color--text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gvd-form__field input:focus,
.gvd-form__field textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.gvd-form__field textarea { resize: vertical; min-height: 8rem; }

.gvd-form__actions button { width: 100%; }

/*
 * The honeypot must be unreachable for humans but not display:none, which
 * some bots detect. Position it out of the viewport instead.
 */
.gvd-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.gvd-form__notice {
	margin-bottom: 1.5rem;
	padding: 0.9rem 1rem;
	border: 1px solid;
	border-radius: 0.625rem;
	font-size: 0.9rem;
}


.gvd-form__notice--error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

/* ------------------------------------------------------------ thank you -- */

.gvd-thanks {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-block: 1.5rem;
	text-align: center;
}

.gvd-thanks__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 1.25rem;
	border-radius: 9999px;
	background: #ecfdf5;
	color: #059669;
}

.gvd-thanks__title {
	margin: 0 0 0.75rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wp--preset--color--text);
}

.gvd-thanks__text {
	max-width: 26rem;
	margin: 0 0 0.75rem;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.9375rem;
	line-height: 1.65;
}

.gvd-thanks__text--muted { font-size: 0.875rem; }

.gvd-thanks__actions { margin: 1.25rem 0 0; }

/* ----------------------------------------------------------------- prose -- */

.gvd-prose :where(h2) { margin-top: 2.5rem; }

.gvd-prose :where(p, li) { color: var(--wp--preset--color--text-muted); }

.gvd-prose :where(table) {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.925rem;
}

.gvd-prose :where(th, td) {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	text-align: left;
}

.gvd-prose :where(th) {
	background: var(--wp--preset--color--secondary);
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

/* Wide content must scroll inside itself, never the page body. */
.gvd-prose :where(table, pre) {
	display: block;
	overflow-x: auto;
	max-width: 100%;
}
