/* Shop-by-flavor: collection landing page & master flavor directory */

.flavor-hero {
	background: var(--flavor-hex, var(--retro-navy));
	color: var(--flavor-ink, #ffffff);
	padding: 2.6rem 0 2.2rem;
	border-bottom: 4px solid var(--retro-navy);
}

.flavor-eyebrow {
	font-family: var(--font-heading);
	font-size: 0.74rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	opacity: 0.88;
	margin: 0 0 0.4rem;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.flavor-title {
	/* inherit, not a colour of its own.
	   app.css sets one on h1..h6 and an element selector beats inheritance, so
	   without this the heading takes --text-primary regardless of the hero it
	   sits on — dark type on the dark entries, which chocolate-fudge (#4e2c1d)
	   and kosher (#1d3557) both are. Inheriting picks up the ink that was
	   chosen against each entry's own colour. */
	color: inherit;
	font-family: var(--font-display);
	font-size: clamp(2rem, 5vw, 3.1rem);
	line-height: 1.05;
	margin: 0 0 0.7rem;
	text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
}

.flavor-sub {
	font-family: var(--font-body);
	font-size: 0.98rem;
	line-height: 1.6;
	max-width: 65ch;
	margin: 0;
	opacity: 0.95;
}

/* ── the flavor switcher ── */
.flavor-switch {
	background: var(--retro-cream);
	border-bottom: 3px solid var(--retro-navy);
	padding: 0.85rem 0;
}

.flavor-switch-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.flavor-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	background: #fff;
	border: 2px solid var(--retro-navy);
	border-radius: 999px;
	padding: 0.35rem 0.75rem 0.35rem 0.5rem;
	font-family: var(--font-heading);
	font-size: 0.82rem;
	color: var(--retro-navy);
	text-decoration: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.flavor-chip:hover {
	transform: translateY(-2px);
	box-shadow: 0 3px 0 var(--retro-navy);
}

.flavor-chip.is-current {
	background: var(--chip-hex, var(--retro-navy));
	color: var(--chip-ink, #ffffff);
	box-shadow: 3px 3px 0 var(--retro-navy);
	border-color: var(--retro-navy);
}

.flavor-chip-icon {
	font-size: 1rem;
	line-height: 1;
}

.flavor-chip-n {
	font-size: 0.72rem;
	opacity: 0.65;
	font-weight: 600;
}

.flavor-chip-all {
	margin-left: auto;
	background: var(--retro-navy);
	color: #fff;
	font-weight: 700;
}

.flavor-chip-all:hover {
	background: #111;
	color: #fff;
}

.flavor-page .product-grid {
	margin: 2rem 0 1rem;
}

.flavor-note {
	background: var(--retro-cream);
	border-top: 3px solid var(--retro-navy);
	margin-top: 2.4rem;
	padding: 1.5rem 0;
}

.flavor-note p {
	font-family: var(--font-body);
	font-size: 0.92rem;
	line-height: 1.65;
	color: var(--text-secondary);
	max-width: 74ch;
	margin: 0;
}

/* ── master flavor directory (/flavors) ── */
.flavors-hub {
	padding: 2.5rem 0 3.5rem;
}

.flavors-hub-hero {
	background: var(--retro-navy);
	color: #fff;
	padding: 3rem 0 2.2rem;
	border-bottom: 4px solid var(--retro-navy);
}

.flavors-family-section {
	margin-bottom: 3rem;
}

.flavors-family-heading {
	font-family: var(--font-heading);
	font-size: 1.45rem;
	font-weight: 800;
	color: var(--retro-navy);
	margin: 0 0 1.2rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid rgba(0, 0, 0, 0.12);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.flavors-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.25rem;
}

.flavor-card {
	background: #fff;
	border: 3px solid var(--retro-navy);
	border-radius: 12px;
	padding: 1.25rem;
	text-decoration: none;
	color: var(--text-primary);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-shadow: 4px 4px 0 var(--retro-navy);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	position: relative;
	overflow: hidden;
}

.flavor-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	background: var(--card-accent, var(--retro-navy));
}

.flavor-card:hover {
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 var(--retro-navy);
}

.flavor-card-top {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.6rem;
}

.flavor-card-icon {
	font-size: 1.8rem;
	line-height: 1;
}

.flavor-card-title {
	font-family: var(--font-heading);
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--retro-navy);
	margin: 0;
}

.flavor-card-tagline {
	font-family: var(--font-body);
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--text-secondary);
	margin: 0 0 1rem;
	flex-grow: 1;
}

.flavor-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-family: var(--font-heading);
	font-size: 0.8rem;
	padding-top: 0.75rem;
	border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.flavor-card-count {
	font-weight: 700;
	color: var(--retro-red);
}

.flavor-card-arrow {
	font-weight: 800;
	color: var(--retro-navy);
}

/* ── home page flavor rack ── */
.flavor-rack-section {
	background: #fff;
	border-top: 4px solid var(--retro-navy);
	border-bottom: 4px solid var(--retro-navy);
	padding: 3rem 0;
}

.flavor-pill-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 0.85rem;
	margin-top: 1.5rem;
}

.flavor-pill {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	background: #fff;
	border: 2.5px solid var(--retro-navy);
	border-radius: 10px;
	padding: 0.65rem 0.85rem;
	text-decoration: none;
	color: var(--retro-navy);
	box-shadow: 3px 3px 0 var(--retro-navy);
	transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.flavor-pill:hover {
	transform: translate(-2px, -2px);
	box-shadow: 5px 5px 0 var(--retro-navy);
	background: var(--pill-bg, #fefefe);
}

.flavor-pill-icon {
	font-size: 1.35rem;
	line-height: 1;
}

.flavor-pill-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.flavor-pill-name {
	font-family: var(--font-heading);
	font-size: 0.85rem;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.flavor-pill-n {
	font-size: 0.72rem;
	color: var(--text-secondary);
	font-weight: 600;
}

@media (max-width: 640px) {
	/* minmax(0, 1fr), not 1fr: a 1fr column will not shrink below its
	   longest nowrap flavour name, and the grid pushed the page 57px wider
	   than a phone. The names ellipsise instead. */
	.flavor-pill-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.6rem;
	}
	.flavor-pill {
		min-width: 0;
		padding: 0.5rem 0.65rem;
	}
}

/* Photograph behind the flat colour, served from the CDN. The scrim clears
   toward the right so the image reads there while the heading keeps its
   contrast; narrow screens get an even wash, because the copy spans the full
   width. Without .has-photo this is exactly the flat hero it was. */
.flavors-hub-hero.has-photo {
	background-image:
		linear-gradient(
			100deg,
			rgba(24, 18, 12, 0.94) 0%,
			rgba(24, 18, 12, 0.88) 42%,
			rgba(24, 18, 12, 0.55) 72%,
			rgba(24, 18, 12, 0.35) 100%
		),
		var(--hub-photo);
	background-size: cover;
	background-position: center right;
	background-repeat: no-repeat;
}

@media (max-width: 767px) {
	.flavors-hub-hero.has-photo {
		background-image:
			linear-gradient(rgba(24, 18, 12, 0.9), rgba(24, 18, 12, 0.9)),
			var(--hub-photo);
	}
}

/* Photograph behind the entry's own colour, from the CDN. Tinting the scrim
   with that colour rather than black is what keeps the heading legible on the
   pale entries — vanilla-cream is #fbf2db with dark ink — since hex and ink
   were picked as a readable pair. Clears to the right on wide screens so the
   image reads; an even wash on narrow ones, where the copy spans the width. */
.flavor-hero.has-photo {
	background-image:
		linear-gradient(
			100deg,
			rgba(var(--hero-rgb), 0.96) 0%,
			rgba(var(--hero-rgb), 0.91) 44%,
			rgba(var(--hero-rgb), 0.64) 76%,
			rgba(var(--hero-rgb), 0.46) 100%
		),
		var(--hero-photo);
	background-size: cover;
	background-position: center right;
	background-repeat: no-repeat;
}

@media (max-width: 767px) {
	.flavor-hero.has-photo {
		background-image:
			linear-gradient(rgba(var(--hero-rgb), 0.93), rgba(var(--hero-rgb), 0.93)),
			var(--hero-photo);
	}
}
