/*
 * Flavour Discovery R4 — Shop by taste rail
 * (design-lab/final/flavour-r4/LOCKED-SPEC.md, HUMAN LOCK 2026-09-11 —
 * F2 Richer Colour, A/E hybrid; supersedes the R3.6 card presentation
 * recorded in HOMEPAGE-VISUAL-SYSTEM-LOCK.md v2.0 — see v2.4).
 *
 * The R4 contract: Deep Navy section band (#142F51 via .pp-home-band--navy,
 * home-page.css), integrated Navy cards on --pp-navy-hover (#0E2440) — the
 * EXACT surface every Navy-baked artwork is normalized to, so image and
 * card meet seamlessly (this surface may never change, or the opaque
 * artwork rectangle seams). ONE horizontal rail at every responsive size;
 * the rail owns horizontal overflow (the document never does); cards NEVER
 * wrap or stack — the human-locked mobile behaviour is a native horizontal
 * swipe rail with ~2.15 cards visible at 390px and the partial next card
 * as the discovery cue. flex-wrap stays untouched (initial nowrap) and no
 * grid template exists here, so no breakpoint can reintroduce stacking.
 *
 * Exactly TWO media queries govern geometry (RESPONSIVE-CONTRACT):
 * min-width:1025px reveals the nav row; max-width:767px is the mobile
 * system. The R3.6 tablet 232px step is deleted per human decision D1 —
 * 268.4px runs from desktop down to 768, and the resulting large tablet
 * peek is the locked reference's own behaviour.
 *
 * Aura (LOCKED-SPEC §6): the artwork is opaque, so the localized
 * flavour aura paints ABOVE it and BELOW the footer scrim — a
 * screen-blended radial core plus a wide low-alpha wash. The BASE
 * declaration is the proven no-blend fallback (plain radial, alpha ×.82);
 * @supports upgrades to the screen blend. Opacity-only transitions.
 * Per-family values arrive as custom properties from the registry
 * (inc/flavour-visual.php) — this stylesheet has ZERO per-flavour rules.
 * Custom-property defaults (VISUAL-METADATA §5): scale 1.25, x/y 0%,
 * aura centre 50%/40%, alphas .19/.095 → .29/.135.
 *
 * Interaction (LOCKED-SPEC §11): hover and focus-visible share one
 * grammar — aura raise, border strengthen, artwork -3px lift, arrow white
 * fill, Shop-line underline. The Strength-Signal Rule keeps Electric Lime
 * away from this component entirely; the aura hues are flavour-artwork
 * presentation metadata (DESIGN.md v1.6 Flavour-Aura Separation Note).
 * Focus uses the theme's on-dark ring via .pp-navy-surface
 * (design-system.css §9).
 */

/* ---------- The section (external vertical rhythm: home-page.css .pp-home-section--flavour_tiles role) ---------- */
.pp-home-flavour .pp-home-head { margin-bottom: 14px; }

/* ---------- Rail navigation — R4: small on-dark pair ABOVE the rail.
 * MUST stay inside .pp-home-rail-wrap: the shared rail controller
 * (home-page.js) resolves [data-rail-prev/next] as wrap descendants and
 * silently disables itself otherwise. Flavour opts OUT of the shared
 * .pp-home-rail-nav/.pp-icon-btn chain (44px light theme, absolute over
 * the artwork) into this self-contained on-dark treatment; the product
 * rails keep theirs untouched. Pointer-only tier (hidden ≤1024, where
 * native swipe owns the rail): 30px clears WCAG 2.2 AA target size. */
.pp-home-flavour-nav { display: none; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.pp-home-flavour-nav-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; padding: 0; border-radius: 50%;
	background: rgba(255, 255, 255, 0.08); /* HS.1 S1: one Navy-band ghost family (.08 fill / .35 border) */
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #fff; cursor: pointer;
	transition: background-color var(--pp-motion-micro) var(--pp-ease-out),
	            border-color var(--pp-motion-micro) var(--pp-ease-out),
	            color var(--pp-motion-micro) var(--pp-ease-out);
}
.pp-home-flavour-nav-btn .pp-i { width: 14px; height: 14px; }
/* HS.1 S1: one Navy-band hover language — white fill + Navy ink (card-arrow canon). */
.pp-home-flavour-nav-btn:hover { background: #fff; border-color: #fff; color: var(--pp-navy); }
.pp-home-flavour-nav-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
@media (min-width: 1025px) {
	.pp-home-flavour-nav { display: flex; }
}

/* ---------- The rail: one row, every viewport ---------- */
.pp-home-flavour-rail {
	display: flex;                    /* single row; wrap is never enabled */
	gap: 12px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;    /* soft guidance, never a card trap */
	scroll-padding-left: var(--pp-gutter);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	/* Full-bleed scroll area: cards crop on the container edge (the peek
	   cue) while content stays on the homepage gutter grid. The R4 4.59
	   density and 166px half-card peek at 1440 are EMERGENT from this
	   bleed + the 268.4px flex-basis — no counting mechanism exists. */
	margin-inline: calc(var(--pp-gutter) * -1);
	padding-inline: var(--pp-gutter);
	/* Focus-ring headroom: the on-dark ring (--pp-focus-ring-on-dark,
	   design-system.css §9) paints 4px OUTSIDE the card box, and a scroll
	   container clips everything beyond its padding box — vertically too.
	   6px block padding keeps the full ring visible on all four sides
	   (inline padding is the gutter, already ample); the compensating
	   negative block margins give back exactly the added space, so the
	   section's approved vertical rhythm is unchanged (net 0 above the
	   cards, net 4px below). Preserve verbatim. */
	padding-block: 6px;
	margin-block: -6px -2px;
}
.pp-home-flavour-rail::-webkit-scrollbar { display: none; }

/* ---------- The card: R4 integrated Navy shell ---------- */
.pp-home-flavour-card {
	position: relative;
	display: flex; flex-direction: column; justify-content: flex-end;
	flex: 0 0 268.4px;               /* (1256 content − 4×12 gap) / 4.5 */
	min-height: 240px;               /* min-height: long names grow the card */
	scroll-snap-align: start;
	background: var(--pp-navy-hover);          /* #0E2440 — artwork touching surface */
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 12px;
	overflow: hidden;
	color: #fff; text-decoration: none;
	transition: border-color var(--pp-motion-micro) var(--pp-ease-out),
	            transform var(--pp-motion-press-out) var(--pp-ease-out);
}
/* Top light — depth layer (z2, above the artwork, below the footer). */
.pp-home-flavour-card::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 46%;
	z-index: 2; pointer-events: none;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}
.pp-home-flavour-card:active, .pp-home-flavour-card.is-pressed { transform: scale(var(--pp-press-scale)); transition-duration: var(--pp-motion-press-in); }
.pp-home-flavour-card:hover, .pp-home-flavour-card:focus-visible { border-color: rgba(255, 255, 255, 0.42); }

/* Artwork layer — decorative, covers the card; its baked background IS the
   card surface, so no seam exists. The resolved R4 optical metadata
   (registry ×1.25, cap ×1.35, y trims) applies as a transform via
   custom properties; CSS carries the system defaults, the template emits
   only deviations. */
.pp-home-flavour-media { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.pp-home-flavour-media .pp-home-flavour-img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover; object-position: 50% 50%;
	transform: translate(var(--pp-fl-x, 0%), var(--pp-fl-y, 0%)) scale(var(--pp-fl-s, 1.25));
	transform-origin: 50% 50%;
	transition: transform var(--pp-motion-component) var(--pp-ease-out);
}
.pp-home-flavour-card:hover .pp-home-flavour-img,
.pp-home-flavour-card:focus-visible .pp-home-flavour-img {
	transform: translate(var(--pp-fl-x, 0%), var(--pp-fl-y, 0%)) translateY(-3px) scale(var(--pp-fl-s, 1.25));
}

/* Localized flavour aura — LOCKED-SPEC §6. Overlay above the opaque
   artwork: tight core + wide wash, both radials, opacity-only
   transitions. BASE = the proven no-blend fallback (plain radial at
   alpha ×.82); @supports upgrades the core to the screen blend at full
   alpha. Decorative only — suppressed under forced-colors. */
.pp-home-flavour-glow { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pp-home-flavour-glow::before {
	content: ""; position: absolute; inset: -10%;
	background: radial-gradient(46% 38% at var(--pp-fl-aura-x, 50%) var(--pp-fl-aura-y, 40%), var(--pp-fl-aura, #fff) 0%, rgba(0, 0, 0, 0) 70%);
	opacity: calc(var(--pp-fl-core, 0.19) * 0.82);
	transition: opacity var(--pp-motion-component) var(--pp-ease-out);
}
.pp-home-flavour-glow::after {
	content: ""; position: absolute; inset: -10%;
	background: radial-gradient(70% 62% at var(--pp-fl-aura-x, 50%) var(--pp-fl-aura-y, 40%), var(--pp-fl-aura, #fff) 0%, rgba(0, 0, 0, 0) 72%);
	opacity: var(--pp-fl-wash, 0.095);
	transition: opacity var(--pp-motion-component) var(--pp-ease-out);
}
.pp-home-flavour-card:hover .pp-home-flavour-glow::before,
.pp-home-flavour-card:focus-visible .pp-home-flavour-glow::before { opacity: calc(var(--pp-fl-core-h, 0.29) * 0.82); }
.pp-home-flavour-card:hover .pp-home-flavour-glow::after,
.pp-home-flavour-card:focus-visible .pp-home-flavour-glow::after { opacity: var(--pp-fl-wash-h, 0.135); }
@supports (mix-blend-mode: screen) {
	.pp-home-flavour-glow::before { mix-blend-mode: screen; opacity: var(--pp-fl-core, 0.19); }
	.pp-home-flavour-card:hover .pp-home-flavour-glow::before,
	.pp-home-flavour-card:focus-visible .pp-home-flavour-glow::before { opacity: var(--pp-fl-core-h, 0.29); }
}

/* Footer legibility scrim — same z-band as the aura but LATER in DOM
   order, so it reliably paints above it: the aura can never reduce
   footer text contrast. Invisible over the identical navy background. */
.pp-home-flavour-scrim {
	position: absolute; inset: auto 0 0 0; height: 84px;
	z-index: 2; pointer-events: none;
	background: linear-gradient(180deg, rgba(14, 36, 64, 0) 0%, rgba(14, 36, 64, 0.6) 82%);
}

/* Commerce layer — HTML/CSS only, above every decorative layer. */
.pp-home-flavour-commerce {
	position: relative; z-index: 3;
	min-height: 66px;
	display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
	padding: 0 15px 14px;
}
.pp-home-flavour-text { min-width: 0; }
.pp-home-flavour-name { display: block; font: 700 19px/1.1 var(--pp-font-display); letter-spacing: -0.01em; color: #fff; }
/* Responsive footer pair — ONE count, two presentations; display:none
   keeps exactly one in the accessibility tree at a time. */
.pp-home-flavour-cta { display: block; font: 600 12.5px/1.2 var(--pp-font-body); color: rgba(255, 255, 255, 0.86); font-variant-numeric: tabular-nums; margin-top: 4px; }
.pp-home-flavour-count { display: none; font: 600 12px/1.2 var(--pp-font-body); color: rgba(255, 255, 255, 0.72); font-variant-numeric: tabular-nums; margin-top: 3px; }
.pp-home-flavour-card:hover .pp-home-flavour-cta,
.pp-home-flavour-card:focus-visible .pp-home-flavour-cta { text-decoration: underline; text-underline-offset: 2px; }
.pp-home-flavour-arrow {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; flex: none; border-radius: 50%; margin-bottom: 1px;
	background: rgba(255, 255, 255, 0.08); /* HS.1 S1: Navy-band ghost family */
	border: 1px solid rgba(255, 255, 255, 0.35); color: #fff;
	transition: background-color var(--pp-motion-micro) var(--pp-ease-out),
	            border-color var(--pp-motion-micro) var(--pp-ease-out),
	            color var(--pp-motion-micro) var(--pp-ease-out),
	            transform var(--pp-motion-component) var(--pp-ease-out);
}
.pp-home-flavour-arrow .pp-i { width: 13px; height: 13px; }
.pp-home-flavour-card:hover .pp-home-flavour-arrow,
.pp-home-flavour-card:focus-visible .pp-home-flavour-arrow { background: #fff; border-color: #fff; color: var(--pp-navy); transform: translateX(2px); }

/* Keyboard focus: the on-dark ring (design-system.css) draws on the card
   itself as a 4px box-shadow; the rail's 6px block padding (see the rail
   rule above) provides the headroom that keeps it unclipped on every side,
   and focus scrolls off-screen cards into view natively. */
.pp-home-flavour-card:focus-visible { z-index: 3; }

/* ---------- Mobile (<768) — HUMAN-LOCKED horizontal swipe rail ----------
 * NEVER stacked, NEVER wrapped: 42vw cards (clamped 150–186px) put ~2.15
 * cards in a 390px viewport with the ~26px partial next card visible.
 * The artwork stays inset:0 at every width (the R3.6 bottom inset is
 * gone — the scrim owns footer legibility now) and mobile shows the
 * COMPACT footer: name + "N products" + 26px arrow. Full R4 atmosphere
 * at rest — mobile has no hover. */
@media (max-width: 767px) {
	.pp-home-flavour-rail {
		gap: 10px;
		scroll-padding-left: var(--pp-gutter-mobile);
		margin-inline: calc(var(--pp-gutter-mobile) * -1);
		padding-inline: var(--pp-gutter-mobile);
	}
	.pp-home-flavour-card {
		flex: 0 0 42vw;
		min-width: 150px; max-width: 186px;
		min-height: 196px;
	}
	.pp-home-flavour-commerce { min-height: 56px; padding: 0 12px 11px; }
	.pp-home-flavour-name { font-size: 16px; }
	.pp-home-flavour-cta { display: none; }
	.pp-home-flavour-count { display: block; font-size: 11px; margin-top: 2px; }
	.pp-home-flavour-arrow { width: 26px; height: 26px; }
	.pp-home-flavour-arrow .pp-i { width: 12px; height: 12px; }
	.pp-home-flavour-scrim { height: 76px; }
}

/* ---------- Reduced motion ----------
 * --pp-motion-component is already 0ms under reduce (design-system.css),
 * so aura/border/arrow-fill/underline states apply instantly; these rules
 * cancel the MOVEMENT (a 0ms transition still moves). */
@media (prefers-reduced-motion: reduce) {
	.pp-home-flavour-card:active, .pp-home-flavour-card.is-pressed { transform: none; }
	.pp-home-flavour-card:hover .pp-home-flavour-img,
	.pp-home-flavour-card:focus-visible .pp-home-flavour-img {
		transform: translate(var(--pp-fl-x, 0%), var(--pp-fl-y, 0%)) scale(var(--pp-fl-s, 1.25));
	}
	.pp-home-flavour-card:hover .pp-home-flavour-arrow,
	.pp-home-flavour-card:focus-visible .pp-home-flavour-arrow { transform: none; }
}

/* ---------- Forced colors (human decision D2) ----------
 * Aura and scrim are decorative; the artwork is too — the visible HTML
 * text carries the flavour identity. Suppressing all three leaves a clean
 * Canvas card with legible CanvasText, intact geometry (the card's own
 * min-height/flex-basis, not the image, defines the box), link semantics,
 * arrow affordance and the forced-colors outline from design-system.css. */
@media (forced-colors: active) {
	.pp-home-flavour-glow,
	.pp-home-flavour-scrim,
	.pp-home-flavour-media { display: none; }
}
