/* ==========================================================================
   PRISTORA — promotional banners

   Loaded only on a request that actually puts a campaign on the page, so a
   homepage with no campaign running costs nothing at all for this file.

   Three variants, one set of parts:

     showcase   the homepage composition below the hero, sized from the media
     band       a compact strip above the product grid on Shop and category
     notice     one quiet line above the basket

   On typography: theme.json sets a 17px / 1.6 body, which is right for running
   prose and too loose for a promotional composition. Every text element below
   therefore states its own size and leading, exactly as the other PRISTORA
   sections do, rather than inheriting and drifting.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. The section
   -------------------------------------------------------------------------- */

/*
 * The homepage showcase keeps the colour the brand introduction had in this
 * slot, so the page's rhythm — dark hero, light second section, sage flavour
 * showcase — is exactly as approved. Replacing the section did not recolour
 * the page.
 */
.pr-promo--showcase {
	position: relative;
	overflow: hidden;
	padding-block: clamp(64px, 8vw, 118px);
	background: linear-gradient(180deg, var(--pr-cream) 0%, var(--pr-cream-soft) 100%);
}

.pr-promo--band {
	margin-bottom: clamp(26px, 4vw, 42px);
}

.pr-promo--band .pr-promo__shell,
.pr-promo--notice .pr-promo__shell {
	max-width: 1200px;
	margin-inline: auto;
}

.pr-promo--notice {
	margin-bottom: clamp(18px, 3vw, 28px);
}

.pr-promo--notice .pr-promo__shell {
	max-width: 1240px;
}

/*
 * The stack is one grid cell that every slide shares, so a rotation cannot
 * change the section's height as it advances and nothing below it moves.
 */
.pr-promo__stack {
	display: grid;
	grid-template-areas: "slide";
}

.pr-promo__slide {
	grid-area: slide;
	min-width: 0;
}

/*
 * A slide that is not the current one carries the `hidden` attribute. That one
 * attribute keeps it out of the accessibility tree and the tab order, and stops
 * its video playing. This rule only makes sure a stylesheet cannot undo it.
 *
 * The descendant `.pr-promo` is carrying weight, not tidiness. Each variant
 * below sets its own `display` on `.pr-promo--<variant> .pr-promo__slide`, which
 * is exactly as specific as a bare `.pr-promo__slide[hidden]` and comes later in
 * this file, so the plain guard lost on source order and every campaign in a
 * placement painted on top of the current one. Qualifying it carries the rule
 * past all three variants whatever order they are written in.
 */
.pr-promo .pr-promo__slide[hidden] {
	display: none;
}

.pr-promo__slide.is-current {
	animation: pr-fade 0.5s var(--pr-ease) both;
}

/* --------------------------------------------------------------------------
   2. The showcase composition — intrinsic media proportions
   -------------------------------------------------------------------------- */

.pr-promo--showcase .pr-promo__slide {
	display: grid;
	gap: clamp(28px, 3.4vw, 56px);
	align-items: center;
}

/*
 * The renderer supplies bounded track weights from attachment dimensions.
 * Text and media can shrink within their tracks without overflowing the shell.
 */
@media (min-width: 1024px) {
	.pr-promo--showcase .pr-promo__slide {
		grid-template-columns: minmax(0, var(--video-track, 1fr)) minmax(0, var(--image-track, 1fr));
	}
}

/* Large desktop: the same ratio, with the composition allowed to breathe. */
@media (min-width: 1280px) {
	.pr-promo--showcase .pr-promo__slide {
		gap: clamp(40px, 3.6vw, 64px);
	}
}

/* --------------------------------------------------------------------------
   3. The media area
   -------------------------------------------------------------------------- */

/*
 * The aspect ratio is declared, not discovered. The slot reserves its height
 * before a single byte of the image or the film has arrived, so nothing on the
 * page moves when it lands — and the forest surface underneath means a video
 * that is still loading shows a brand colour rather than a white rectangle.
 */
.pr-promo__frame-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 20px;
	background: linear-gradient(150deg, var(--pr-forest-deep) 0%, #1b2a3f 60%, var(--pr-plum) 100%);
	box-shadow: 0 26px 60px rgba(23, 63, 53, 0.22);
}

.pr-promo__frame-media:not(.pr-promo__frame-media--video) {
	background: var(--pr-cream, #fbf8f0);
}

.pr-promo__frame-media img.pr-promo__img,
.pr-promo__video {
	display: block;
	width: 100%;
	height: 100%;
}

.pr-promo__frame-media img.pr-promo__img {
	object-fit: contain;
}

.pr-promo__video {
	object-fit: cover;
}

/* <picture> is a wrapper with no box of its own; the image inside is the box. */
.pr-promo__frame-media picture {
	display: block;
	width: 100%;
	height: 100%;
}

/* What a browser that cannot play the file shows, inside the dark frame. */
.pr-promo__video-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 24px;
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
	color: var(--pr-cream);
}

.pr-promo__video-fallback a {
	color: var(--pr-gold);
}

/* --- The honest empty state, where media has not been supplied yet -------- */

/*
 * No placeholder artwork, no stand-in photograph and no claim. A visitor sees
 * the brand mark on the brand surface; the layout is the approved layout and
 * nothing suggests a film exists. The administrator note is printed by PHP for
 * administrators only and is never published copy.
 */
.pr-promo__pending {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	aspect-ratio: 16 / 9;
	padding: clamp(24px, 4vw, 48px);
	overflow: hidden;
	border-radius: 20px;
	background:
		radial-gradient(60% 60% at 50% 45%, rgba(214, 168, 75, 0.16), transparent 68%),
		linear-gradient(150deg, var(--pr-forest-deep) 0%, #1b2a3f 60%, var(--pr-plum) 100%);
	box-shadow: 0 26px 60px rgba(23, 63, 53, 0.22);
}

.pr-promo__pending-mark {
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	border: 1.5px solid rgba(214, 168, 75, 0.6);
	transform: rotate(45deg);
}

/*
 * An asset that would not load. assets/js/promo.js puts this class on the frame
 * and adds the brand mark, so a visitor sees the same quiet panel as a campaign
 * whose media was never supplied — never a broken player, and never a browser's
 * own missing-image glyph.
 */
.pr-promo__frame-media--failed {
	display: flex;
	align-items: center;
	justify-content: center;
}

.pr-promo__frame-media--failed video,
.pr-promo__frame-media--failed img,
.pr-promo__frame-media--failed picture,
.pr-promo__frame-media--failed .pr-promo__player-controls {
	display: none;
}

.pr-promo__pending-note {
	max-width: 46ch;
	margin: 0;
	font-family: var(--pr-font-body);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.55;
	text-align: center;
	color: rgba(247, 242, 231, 0.76);
}

/* --------------------------------------------------------------------------
   4. Player controls
   -------------------------------------------------------------------------- */

/*
 * Explicit, labelled buttons rather than the browser's own control bar, so they
 * can sit in the approved design. They are drawn by PHP whenever there is a
 * video, which means a visitor is never left with a film and no way to start or
 * stop it — including anyone whose device has asked for less motion, for whom
 * nothing autoplays at all.
 */
/*
 * Hidden until the script says it has taken over. Until then the browser's own
 * control bar is what a visitor has, and showing both at once would be two sets
 * of controls for one film. assets/js/promo.js removes the native bar and adds
 * `is-ready` in the same pass, so exactly one set is ever present.
 *
 * On a long page the native bar can be painted for a frame or two before the
 * footer script runs. That is a brief flicker inside the dark frame, and it is
 * the price of a video that a visitor without JavaScript can still play.
 */
.pr-promo__player-controls {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 2;
	display: none;
	flex-wrap: wrap;
	gap: 8px;
}

.pr-promo.is-ready .pr-promo__player-controls {
	display: flex;
}

.pr-promo__pbtn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid rgba(247, 242, 231, 0.3);
	border-radius: 999px;
	background: rgba(18, 25, 26, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	font-family: var(--pr-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1;
	color: var(--pr-cream);
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.pr-promo__pbtn:hover {
	background: rgba(18, 25, 26, 0.78);
	border-color: var(--pr-gold);
}

.pr-promo__pbtn-icon {
	width: 10px;
	height: 12px;
	flex-shrink: 0;
	background: currentcolor;
}

/* A triangle while paused. */
.pr-promo__pbtn--play .pr-promo__pbtn-icon {
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/*
 * Two bars while playing. The second bar is a hard box-shadow offset from the
 * first rather than a second element, so one span draws both glyphs and
 * aria-pressed stays the single source of the state.
 */
.pr-promo__pbtn--play[aria-pressed="true"] .pr-promo__pbtn-icon {
	width: 4px;
	clip-path: none;
	box-shadow: 7px 0 0 0 currentcolor;
}

.pr-promo__pbtn--sound .pr-promo__pbtn-icon {
	clip-path: polygon(0 32%, 36% 32%, 70% 2%, 70% 98%, 36% 68%, 0 68%);
	width: 12px;
}

.pr-promo__pbtn--sound[aria-pressed="false"] .pr-promo__pbtn-icon {
	opacity: 0.55;
}

/* --------------------------------------------------------------------------
   5. The supporting content area
   -------------------------------------------------------------------------- */

.pr-promo__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(14px, 1.6vw, 20px);
	min-width: 0;
}

.pr-promo__title {
	margin: 0;
	font-family: var(--pr-font-display);
	font-weight: 700;
	font-size: clamp(1.9rem, 2.9vw, 2.9rem);
	line-height: 1.12;
	letter-spacing: -0.4px;
	color: var(--pr-forest);
	text-wrap: balance;
}

.pr-promo__lede {
	margin: 0;
	max-width: 46ch;
	font-family: var(--pr-font-body);
	font-size: clamp(0.98rem, 1.1vw, 1.1rem);
	font-weight: 400;
	line-height: 1.6;
	color: var(--pr-slate);
}

.pr-promo__support {
	width: 100%;
	max-width: 420px;
	overflow: hidden;
	border-radius: 16px;
	background: var(--pr-white);
	box-shadow: 0 14px 32px rgba(23, 63, 53, 0.12);
}

.pr-promo__support-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: contain;
}

.pr-promo__ctas {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-top: 4px;
}

.pr-promo__cta {
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   6. Rotation controls
   -------------------------------------------------------------------------- */

.pr-promo__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: clamp(22px, 2.6vw, 34px);
}

.pr-promo__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(23, 63, 53, 0.22);
	border-radius: 50%;
	background: var(--pr-white);
	color: var(--pr-forest);
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--pr-ease);
}

.pr-promo__nav:hover {
	border-color: var(--pr-gold);
	color: var(--pr-leaf-deep);
	transform: translateY(-2px);
}

.pr-promo__dots {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pr-promo__dot {
	position: relative;
	width: 9px;
	height: 9px;
	padding: 0;
	border: 1px solid rgba(23, 63, 53, 0.4);
	background: transparent;
	transform: rotate(45deg);
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

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

.pr-promo__dot.is-current {
	border-color: var(--pr-forest);
	background: var(--pr-forest);
}

/*
 * The dots are 9px, which is smaller than a comfortable target. The hit area is
 * enlarged without changing the diamond, so a thumb has something to land on.
 */
.pr-promo__dot::after {
	content: "";
	position: absolute;
	inset: -11px;
}

/* --------------------------------------------------------------------------
   7. The band — Shop and category
   -------------------------------------------------------------------------- */

.pr-promo--band .pr-promo__slide {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(18px, 2.4vw, 32px);
	padding: clamp(18px, 2.2vw, 26px);
	border: 1px solid rgba(23, 63, 53, 0.12);
	border-radius: 18px;
	background: var(--pr-white);
	text-align: left;
}

.pr-promo--band .pr-promo__frame-media,
.pr-promo--band .pr-promo__pending {
	flex: 0 0 auto;
	width: clamp(140px, 22vw, 230px);
	aspect-ratio: 4 / 3;
	border-radius: 14px;
	box-shadow: none;
}

.pr-promo--band .pr-promo__copy {
	flex: 1 1 260px;
	gap: 10px;
}

.pr-promo--band .pr-promo__title {
	font-size: clamp(1.3rem, 1.9vw, 1.7rem);
}

.pr-promo--band .pr-promo__lede {
	font-size: 15px;
	max-width: 62ch;
}

/* A band is a strip, not a gallery: the supporting image is not drawn in it. */
.pr-promo--band .pr-promo__support {
	display: none;
}

.pr-promo--band .pr-promo__ctas {
	flex: 0 0 auto;
	margin-top: 0;
}

.pr-promo--band .pr-promo__controls {
	margin-top: 14px;
}

/* The band's player controls sit inside a small frame, so they shrink with it. */
.pr-promo--band .pr-promo__pbtn-label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pr-promo--band .pr-promo__pbtn {
	padding: 7px;
	gap: 0;
}

.pr-promo--band .pr-promo__player-controls {
	left: 8px;
	bottom: 8px;
}

/* --------------------------------------------------------------------------
   8. The notice — Cart
   -------------------------------------------------------------------------- */

.pr-promo--notice .pr-promo__slide {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 14px;
	padding: 14px 18px;
	border: 1px solid rgba(214, 168, 75, 0.38);
	border-left: 4px solid var(--pr-gold);
	border-radius: 12px;
	background: var(--pr-cream);
}

.pr-promo__notice-text {
	margin: 0;
	font-family: var(--pr-font-body);
	font-size: 14.5px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--pr-forest);
}

.pr-promo__notice-text strong {
	font-weight: 700;
}

.pr-promo__notice-link {
	font-family: var(--pr-font-body);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--pr-leaf-deep);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pr-promo__notice-link:hover {
	color: var(--pr-forest);
}

.pr-promo--notice .pr-promo__controls {
	margin-top: 10px;
}

/* --------------------------------------------------------------------------
   9. Responsive — laptop, tablet, mobile
   -------------------------------------------------------------------------- */

/*
 * Below 1024px the showcase becomes a stack: the
 * media first, then the words. The desktop ratio is never forced onto a narrow
 * screen, which is what would crop the media or squeeze the headline into a
 * column too narrow to read.
 */
@media (max-width: 1023px) {
	.pr-promo--showcase {
		padding-block: clamp(48px, 7vw, 76px);
	}

	.pr-promo--showcase .pr-promo__copy {
		align-items: flex-start;
	}

	.pr-promo--showcase .pr-promo__support {
		max-width: 100%;
	}

	.pr-promo--showcase .pr-promo__support-img {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 900px) {
	.pr-promo--band .pr-promo__slide {
		flex-direction: column;
		align-items: stretch;
		text-align: left;
	}

	.pr-promo--band .pr-promo__frame-media,
	.pr-promo--band .pr-promo__pending {
		width: 100%;
		aspect-ratio: 16 / 9;
	}

	.pr-promo--band .pr-promo__ctas {
		margin-top: 4px;
	}
}

@media (max-width: 640px) {
	.pr-promo--showcase {
		padding-block: clamp(40px, 11vw, 60px);
	}

	.pr-promo--showcase .pr-promo__slide {
		gap: 24px;
	}

	/*
	 * A 16:9 frame on a 360px screen is 200px tall, which is a letterbox. 4:3
	 * gives the media room without making the section tall enough to push the
	 * words off the screen entirely.
	 */
	.pr-promo--showcase .pr-promo__frame-media,
	.pr-promo--showcase .pr-promo__pending {
		aspect-ratio: 4 / 3;
		border-radius: 16px;
	}

	.pr-promo__title {
		font-size: clamp(1.6rem, 7.4vw, 2.1rem);
	}

	.pr-promo__lede {
		font-size: 15px;
	}

	.pr-promo__ctas {
		gap: 12px;
	}

	/* A full-width primary button is easier to hit than a centred pill. */
	.pr-promo__ctas .pr-btn--lime {
		width: 100%;
		justify-content: center;
		padding-inline: 20px;
	}

	.pr-promo__pending-note {
		font-size: 12px;
	}

	.pr-promo__player-controls {
		left: 10px;
		bottom: 10px;
	}

	.pr-promo--notice .pr-promo__slide {
		padding: 12px 14px;
	}
}

/* Stable image stage: a 4:3 and a widescreen asset can share it without cropping. */
.pr-promo__gallery { width: 100%; min-width: 0; }
.pr-promo__art { position: relative; aspect-ratio: var(--image-ratio); }
/* The tallest artwork reserves the stacked stage so even its text gets the full phone width. */
@media (max-width: 1023px) {
	.pr-promo__art { aspect-ratio: var(--stacked-image-ratio); }
}
.pr-promo__art > a { display: block; width: 100%; height: 100%; }
.pr-promo__art img {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.pr-promo__art img.leaving { z-index: 1; animation: pr-promo-image-out .3s ease forwards; pointer-events: none; }
@keyframes pr-promo-image-out { to { opacity: 0; } }
.pr-promo__image-controls { display: none; }
.pr-promo.is-ready .pr-promo__image-controls {
	display: flex; gap: .35rem; align-items: center; justify-content: center; flex-wrap: wrap;
	padding-top: .4rem; font-size: .85rem; color: var(--pr-forest);
}
.pr-promo__image-controls button {
	min-height: 36px; padding: .25em .75em; border: 1px solid currentColor; border-radius: 2em;
	font: inherit; color: inherit; background: transparent; cursor: pointer;
}
.pr-promo__gallery :focus-visible { outline: 3px solid var(--pr-forest); outline-offset: 2px; }
.pr-promo--showcase .pr-promo__slide--artwork {
	gap: clamp(12px, 1.6vw, 24px); align-items: start;
}
.pr-promo--showcase .pr-promo__slide--artwork .pr-promo__frame-media {
	aspect-ratio: var(--video-ratio); box-shadow: none; border-radius: 0;
}
.pr-promo--showcase video[data-tracks], .pr-promo__slide--artwork video { object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .pr-promo__art img.leaving { animation: none; opacity: 0; } }

/* --------------------------------------------------------------------------
   10. Device visibility

   1023/1024 is the boundary the header and the announcement bar already use,
   so "desktop" and "mobile" mean the same thing across the whole shell. A
   campaign that is hidden at the current width is skipped by the rotation
   rather than counted as a slide nobody can see — see assets/js/promo.js.
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
	.pr-promo .pr-promo__slide--desktop {
		display: none !important;
	}
}

@media (min-width: 1024px) {
	.pr-promo .pr-promo__slide--mobile {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
   11. Reduced motion

   base.css already turns off every animation and transition for anybody who
   has asked their device for less motion. What is left to say here is about
   video, which is content rather than decoration: nothing autoplays, the
   poster is what shows, and the play button is how a visitor asks for the
   film. assets/js/promo.js makes the same decision, so this is not the only
   thing standing between a reduced-motion visitor and a moving picture.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.pr-promo__slide.is-current {
		animation: none;
	}
}
