/**
 * Base layer: reset, typography, layout primitives, utilities.
 */

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

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

body {
	margin: 0;
	background: var(--p-bg);
	color: var(--p-text);
	font-family: var(--p-font-sans);
	font-size: var(--p-text-body);
	line-height: var(--p-leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

body.is-locked {
	overflow: hidden;
}

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

h1, h2, h3, h4 {
	margin: 0;
	font-family: var(--p-font-serif);
	font-weight: 400;
	line-height: var(--p-leading-snug);
	letter-spacing: -0.01em;
}

p {
	margin: 0;
}

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

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

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

s {
	text-decoration-thickness: 1px;
}

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

:focus-visible {
	outline: 2px solid var(--p-gold-500);
	outline-offset: 2px;
	border-radius: var(--p-radius-sm);
}

.p-skip {
	position: absolute;
	top: -100px;
	left: var(--p-space-4);
	z-index: 999;
	padding: var(--p-space-3) var(--p-space-5);
	background: var(--p-green-700);
	color: var(--p-white);
	border-radius: var(--p-radius-pill);
	font-size: var(--p-text-small);
	transition: top var(--p-dur-ui) var(--p-ease);
}

.p-skip:focus {
	top: var(--p-space-4);
}

/*
 * `.p-sr` is the theme's own hide-visually class. `screen-reader-text` is the
 * name WordPress and WooCommerce emit in markup this theme does not author —
 * cart quantity labels, pagination, form hints. Woo's stylesheet, which would
 * normally define it, is dequeued in inc/woocommerce/setup.php, so without this
 * alias that text renders as visible body copy.
 */
.p-sr,
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Layout primitives ------------------------------------------------ */

.p-container {
	width: 100%;
	max-width: var(--p-container);
	margin-inline: auto;
	padding-inline: var(--p-gutter);
}

.p-main {
	display: block;
	min-height: 40vh;
	/*
	 * The header is fixed, so it no longer takes up space in the flow. Ordinary
	 * pages get that space back; the immersive front page deliberately does not,
	 * because its hero is meant to run under the header to the top of the window.
	 */
	padding-top: var(--p-header-h);
}

.p-body--immersive .p-main {
	padding-top: 0;
}

.p-section {
	padding-block: var(--p-section-y);
	position: relative;
}

.p-section--space-compact {
	padding-block: var(--p-section-y-compact);
}

.p-section--muted {
	background: var(--p-ivory-200);
}

.p-section--white {
	background: var(--p-white);
}

.p-section--dark {
	background: var(--p-green-900);
	color: var(--p-ivory-100);
}

.p-section--dark .p-eyebrow {
	color: var(--p-gold-500);
}

.p-section--dark .p-sechead__sub {
	color: rgba(248, 246, 241, 0.72);
}

.p-grid {
	display: grid;
	gap: var(--p-space-5);
}

@media (min-width: 768px) {
	.p-grid--3 {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--p-space-6);
	}
}

/* ---- Type helpers ----------------------------------------------------- */

.p-eyebrow {
	font-size: var(--p-text-micro);
	font-weight: 500;
	letter-spacing: var(--p-track-label);
	text-transform: uppercase;
	color: var(--p-green-500);
	margin-bottom: var(--p-space-3);
}

.p-note {
	margin-top: var(--p-space-5);
	font-size: var(--p-text-small);
	color: var(--p-text-muted);
	text-align: center;
}

.p-prose {
	max-width: var(--p-measure);
	margin-inline: auto;
}

.p-prose > * + * {
	margin-top: var(--p-space-4);
}

.p-prose h2 {
	font-size: var(--p-text-h2);
	margin-top: var(--p-space-7);
}

.p-prose h3 {
	font-size: var(--p-text-h3);
	margin-top: var(--p-space-6);
}

.p-prose a {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--p-gold-500);
}

.p-page-head {
	text-align: center;
	margin-bottom: var(--p-space-7);
}

.p-page-head__title {
	font-size: var(--p-text-h1);
}

/* ---- Section heading -------------------------------------------------- */

.p-sechead {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--p-space-4);
	/* Closer to the content it introduces — a heading floating a long way
	   above its own cards reads as two separate things. */
	margin-bottom: var(--p-space-5);
}

/*
 * The centred head — the reviews wall and anything else that owns the full
 * width. Its eyebrow and title were `--p-space-4` apart and stacked, which put
 * the title lower on screen than it needed to be; a tighter pair reads as one
 * unit and lifts the whole block.
 */
.p-sechead--center {
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--p-space-2);
}

/* Fractionally larger where the head is centred and carrying the section on
   its own. */
.p-sechead--center .p-sechead__title {
	font-size: calc(var(--p-text-h2) * 1.05);
}

.p-sechead__text {
	max-width: 44ch;
}

.p-sechead--center .p-sechead__text {
	max-width: 52ch;
}

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

.p-sechead__sub {
	margin-top: var(--p-space-3);
	color: var(--p-text-muted);
	font-size: var(--p-text-small);
	line-height: 1.6;
}

/* ---- Utilities -------------------------------------------------------- */

@media (max-width: 767px) {
	.p-hide-sm {
		display: none !important;
	}
}

/* ---- Reveal animation ------------------------------------------------- */

.js [data-reveal] {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 600ms var(--p-ease), transform 600ms var(--p-ease);
}

.js [data-reveal].is-in {
	opacity: 1;
	transform: none;
}

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

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.js [data-reveal] {
		opacity: 1;
		transform: none;
	}
}
