/* ==========================================================================
   PRISTORA — base tokens, resets, shared primitives, motion
   ========================================================================== */

:root {
	/* Core brand palette */
	--pr-forest: #173f35;
	--pr-leaf: #6f8f3d;
	--pr-lime: #b7e33b;
	--pr-cream: #f7f2e7;
	--pr-gold: #d6a84b;
	--pr-coral: #f06f52;
	--pr-ink: #18201d;
	--pr-white: #fff;

	/* Supporting tones taken from the approved design */
	--pr-forest-deep: #12352b;
	--pr-forest-soft: #1d4f43;
	--pr-cream-soft: #fbf8f0;
	--pr-cream-warm: #f1e8d6;
	--pr-leaf-deep: #4d6b2e;
	--pr-leaf-ink: #3f5c22;
	--pr-gold-deep: #b7842f;
	--pr-coral-deep: #c0432a;
	--pr-plum: #241436;
	--pr-midnight: #0a2a49;
	--pr-slate: #3a453f;
	--pr-night: #12191a;

	/*
	 * Typography. theme.json is the source of truth; these aliases keep the
	 * brand fonts working even if the preset variables are unavailable (for
	 * example inside an isolated iframe or a stripped-down render).
	 */
	--pr-font-body: var(--wp--preset--font-family--body, Manrope, system-ui, -apple-system, "Segoe UI", sans-serif);
	--pr-font-display: var(--wp--preset--font-family--display, Cardo, Georgia, "Times New Roman", serif);

	/* Layout */
	--pr-shell-max: 1340px;
	--pr-gutter: clamp(20px, 5vw, 64px);
	--pr-section-y: clamp(64px, 8vw, 110px);

	/* Motion */
	--pr-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--pr-marquee-duration: 40s;
}

/* --- Resets / global -------------------------------------------------- */

/*
 * Border-box sizing.
 *
 * This is the approved design's own first rule (`* { box-sizing: border-box }`
 * in Pristora Home.dc.html) and every measurement in this stylesheet assumes
 * it: `.pr-shell` is `max-width: 1340px` WITH `padding-inline` inside that
 * 1340px, section min-heights include their padding, and cards at `width: 100%`
 * are meant to fill their track rather than overflow it by their own padding.
 *
 * It was missing from the conversion, and nothing else in the stack supplies it
 * — not Twenty Twenty-Five, not WordPress core. The consequence was that every
 * `.pr-shell` rendered its gutter OUTSIDE the viewport: 360px wide on a 320px
 * screen. `overflow-x: clip` below then turned that 40px into the right-side
 * clipping seen on the Quality and Partner sections instead of a scrollbar.
 *
 * Restoring it fixes the overflow at its source and brings the desktop shell
 * back to the approved 1340px total / 1212px content.
 */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--pr-font-body);
	background: var(--pr-cream-soft);
	color: var(--pr-ink);
	/*
	 * Defensive only. The sizing above is what keeps content inside the
	 * viewport; this is a backstop against a decorative bleed or a future
	 * addition, never the fix for a section that is too wide.
	 */
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.wp-site-blocks {
	overflow-x: clip;
}

/*
 * Root padding is zero in theme.json so the Pristora sections can run
 * edge-to-edge. Give templates inherited from the parent theme their gutter
 * back, so nothing touches the screen edge on small viewports.
 */
.wp-site-blocks > main:not(.pr-main) {
	padding-inline: var(--pr-gutter);
}

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

/* Framed foreground artwork must show its whole canvas. Each component still
   owns its box size, spacing and animation. Decorative backgrounds and
   explicitly cropped WordPress Cover blocks keep their own framing. */
body img.pr-fit-content,
body :is(.pr-phero__frame, .pr-mcard__media, .pr-lead__media, .pr-result__media,
	.pr-ql-theme__frame, .pr-ql-step, .pr-os-hero__crop, .pr-story__frame,
	.pr-jr-hero__frame, .pr-jr-card__media, .pr-jr-ahero__frame,
	.custom-logo-link, .wp-block-site-logo, .wp-block-image, .woocommerce-product-gallery__image,
	.wc-block-components-product-image, .wc-block-cart-item__image,
	.wc-block-components-order-summary-item__image, .wc-block-grid__product-image) img,
body img:is(.pr-promo__img, .pr-promo__support-img, .custom-logo) {
	object-fit: contain;
	object-position: center;
}

::selection {
	background: rgba(183, 227, 59, 0.35);
}

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--pr-gold);
	outline-offset: 3px;
	border-radius: 4px;
}

.pr-on-dark :where(a, button, input, [tabindex]):focus-visible {
	outline-color: var(--pr-lime);
}

.pr-skip-target:focus {
	outline: 3px solid var(--pr-gold);
}

/* --- Shared primitives -------------------------------------------------- */

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

.pr-section {
	position: relative;
	overflow: hidden;
	padding-block: var(--pr-section-y);
}

.pr-diamond {
	width: 7px;
	height: 7px;
	flex-shrink: 0;
	background: currentcolor;
	transform: rotate(45deg);
	display: inline-block;
}

.pr-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-family: var(--pr-font-body);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--pr-forest);
}

.pr-eyebrow--gold {
	color: var(--pr-gold);
}

.pr-eyebrow--leaf {
	color: var(--pr-leaf-deep);
}

.pr-eyebrow--lime .pr-diamond {
	color: var(--pr-lime);
}

.pr-eyebrow--coral {
	color: var(--pr-coral-deep);
}

.pr-title {
	margin: 18px 0 0;
	font-family: var(--pr-font-display);
	font-weight: 700;
	font-size: clamp(2.1rem, 4.6vw, 3.5rem);
	line-height: 1.1;
	letter-spacing: -0.4px;
	color: var(--pr-forest);
	text-wrap: balance;
}

.pr-lede {
	margin: 18px 0 0;
	font-size: clamp(1rem, 1.3vw, 1.15rem);
	line-height: 1.6;
	color: var(--pr-slate);
}

.pr-em {
	font-style: italic;
	color: var(--pr-leaf);
}

/* Buttons ---------------------------------------------------------------- */

.pr-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 32px;
	border: 1px solid transparent;
	border-radius: 12px;
	font-family: var(--pr-font-body);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.3px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.25s var(--pr-ease), box-shadow 0.25s, background 0.25s, color 0.25s;
}

.pr-btn:hover {
	transform: translateY(-3px);
}

.pr-btn--lime {
	background: var(--pr-lime);
	color: var(--pr-ink);
	padding: 18px 40px;
	border-radius: 14px;
	font-size: 16px;
	box-shadow: 0 14px 34px rgba(183, 227, 59, 0.26);
}

.pr-btn--lime:hover {
	background: #c4ec55;
	color: var(--pr-ink);
	box-shadow: 0 18px 40px rgba(183, 227, 59, 0.36);
}

.pr-btn--forest {
	background: var(--pr-forest);
	color: var(--pr-cream);
}

.pr-btn--forest:hover {
	background: var(--pr-forest-soft);
	color: var(--pr-cream);
	box-shadow: 0 16px 34px rgba(23, 63, 53, 0.3);
}

.pr-btn--gradient {
	background: linear-gradient(135deg, #c8f04a 0%, var(--pr-lime) 55%, #a3d12a 100%);
	color: #0f2f27;
	padding: 14px 28px;
	font-weight: 800;
	box-shadow: inset 0 0 0 1.5px var(--pr-forest), 0 12px 26px rgba(23, 63, 53, 0.3);
}

.pr-btn--gradient:hover {
	background: #0f2f27;
	color: var(--pr-lime);
	box-shadow: inset 0 0 0 1.5px var(--pr-lime), 0 16px 34px rgba(15, 47, 39, 0.38);
}

/* Underlined text link ---------------------------------------------------- */

.pr-textlink {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding-bottom: 4px;
	border-bottom: 1px solid rgba(23, 63, 53, 0.35);
	color: var(--pr-forest);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	transition: color 0.2s, border-color 0.2s;
}

.pr-textlink:hover {
	color: var(--pr-leaf);
	border-color: var(--pr-leaf);
}

.pr-textlink--light {
	color: var(--pr-cream);
	border-bottom-color: rgba(247, 242, 231, 0.4);
}

.pr-textlink--light:hover {
	color: var(--pr-gold);
	border-color: var(--pr-gold);
}

/* Screen-reader only ------------------------------------------------------ */

.pr-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Motion -------------------------------------------------------------- */

@keyframes pr-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@keyframes pr-float-a {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-16px); }
}

@keyframes pr-float-b {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(13px); }
}

@keyframes pr-glow {
	0%, 100% { opacity: 0.72; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.07); }
}

@keyframes pr-reveal {
	from { opacity: 0; transform: translateY(24px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes pr-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pr-menu-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/*
 * Scroll reveal. JS adds .pr-reveal-ready once IntersectionObserver is wired
 * up, so the content stays visible if JS never runs.
 */
.pr-reveal-ready [data-pr-reveal] {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.8s var(--pr-ease), transform 0.8s var(--pr-ease);
}

.pr-reveal-ready [data-pr-reveal].is-revealed {
	opacity: 1;
	transform: none;
}

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

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

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