/**
 * Homepage sections.
 */

/* =========================================================
   Hero
   ========================================================= */

.hero {
	position: relative;
	overflow: hidden;
	/* Matches the photograph's own backdrop, so its edges disappear. */
	background: var(--munchi-cream-warm);
}

/*
 * Wide screens: the photograph fills the hero, anchored right, and the copy
 * sits over the empty left part that the shot was composed with.
 */
.hero__media {
	position: absolute;
	/*
	 * Shifted right, as in the design: the falling pieces clear the copy and
	 * the bowl is cropped by the right edge rather than the jar sitting
	 * mid-page.
	 */
	inset: 0 -12% 0 12%;
}

.hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
	/* Feathers the shifted photo's left edge into the backdrop. */
	-webkit-mask-image: linear-gradient(to right, transparent, #000 18%);
	mask-image: linear-gradient(to right, transparent, #000 18%);
}

.hero__inner {
	position: relative;
	display: flex;
	align-items: center;
	/* The photograph is 2:1, so half the viewport width shows all of it. */
	min-height: clamp(38rem, 50vw, 48rem);
	padding-block: var(--space-xl);
	pointer-events: none;
}

.hero__content {
	max-width: 36rem;
	pointer-events: auto;
}

.hero__title {
	margin-block-end: var(--space-md);
	font-size: var(--text-4xl);
	line-height: 1;
	letter-spacing: -0.02em;
}

.hero__title-accent {
	display: block;
	color: var(--munchi-yellow);
}

.hero__text {
	max-width: 26rem;
	margin-block-end: var(--space-lg);
	font-size: var(--text-lg);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	margin-block-end: var(--space-xl);
}

.hero__actions .btn--outline {
	border-color: var(--munchi-navy);
}

.hero__benefits {
	display: grid;
	gap: var(--space-sm);
	/* Narrow enough to end before the photo's falling pieces begin. */
	grid-template-columns: repeat(4, minmax(0, 6.75rem));
}

.hero__benefit {
	display: grid;
	gap: var(--space-2xs);
	justify-items: center;
	text-align: center;
}

.hero__benefit-icon.munchi-icon {
	width: 2.25rem;
	height: 2.25rem;
	stroke-width: 1.4;
}

.hero__benefit-text {
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
	line-height: var(--leading-snug);
}

.hero__benefit-text span {
	display: block;
}

.hero__note {
	position: absolute;
	top: 7%;
	/* Measured against the shifted photo layer, which overhangs by 12%. */
	right: 15%;
	z-index: 1;
	max-width: 9rem;
	color: var(--munchi-navy);
	font-family: var(--font-hand);
	font-size: clamp(1.4rem, 1rem + 1vw, 2rem);
	font-weight: 600;
	line-height: 1.05;
	/* A halo in the backdrop colour keeps the note legible over the crisps. */
	text-shadow:
		0 0 4px var(--munchi-cream-warm),
		0 0 10px var(--munchi-cream-warm),
		0 0 18px var(--munchi-cream-warm);
	transform: rotate(-8deg);
}

.hero__note-arrow {
	display: block;
	filter: drop-shadow(0 0 3px var(--munchi-cream-warm)) drop-shadow(0 0 6px var(--munchi-cream-warm));
	width: 2.75rem;
	height: auto;
	margin-block-start: var(--space-3xs);
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hero__placeholder {
	position: absolute;
	top: 50%;
	right: var(--gutter);
	display: grid;
	place-items: center;
	width: min(28rem, 40%);
	min-height: 18rem;
	padding: var(--space-lg);
	border: 2px dashed var(--color-border-strong);
	border-radius: var(--radius-lg);
	color: var(--color-text-muted);
	text-align: center;
	transform: translateY(-50%);
}

.hero__placeholder-note {
	margin-block-start: var(--space-2xs);
	font-size: var(--text-xs);
	opacity: 0.7;
}

/*
 * Narrower screens: a background photo would put the jar behind the copy,
 * so the photograph stacks above it instead.
 */
@media (max-width: 1199px) {
	.hero__media {
		position: relative;
		inset: auto;
		aspect-ratio: 2 / 1;
	}

	.hero__note {
		right: 3%;
	}

	.hero__image {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.hero__inner {
		min-height: 0;
		justify-content: center;
		text-align: center;
	}

	.hero__text {
		margin-inline: auto;
	}

	.hero__actions,
	.hero__benefits {
		justify-content: center;
	}

	.hero__placeholder {
		position: static;
		width: auto;
		margin: var(--space-md) var(--gutter) 0;
		transform: none;
	}
}

@media (max-width: 599px) {
	/* Taller crop on phones, centred on the jar and the bowl. */
	.hero__media {
		aspect-ratio: 4 / 3;
	}

	.hero__image {
		object-position: 72% center;
	}

	.hero__note {
		display: none;
	}
}

@media (max-width: 479px) {
	.hero__benefits {
		grid-template-columns: repeat(2, minmax(0, 8rem));
		row-gap: var(--space-lg);
	}
}

/* =========================================================
   Category cards
   ========================================================= */

.categories {
	padding-block-start: var(--space-2xl);
}

.categories__grid {
	display: grid;
	gap: var(--space-md);
	grid-template-columns: repeat(3, 1fr);
}

.category-card {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 15rem;
	padding: var(--space-lg);
	overflow: hidden;
	border-radius: var(--radius-lg);
}

.category-card--green { background: linear-gradient(135deg, var(--munchi-tint-green), var(--munchi-tint-green-deep)); }
.category-card--yellow { background: linear-gradient(135deg, var(--munchi-tint-yellow), var(--munchi-yellow)); }
.category-card--pink { background: linear-gradient(135deg, var(--munchi-tint-pink), var(--munchi-tint-pink-deep)); }

.category-card--has-image.category-card--green { background: var(--munchi-photo-green); }
.category-card--has-image.category-card--yellow { background: var(--munchi-photo-yellow); }
.category-card--has-image.category-card--pink { background: var(--munchi-photo-pink); }

.category-card__content {
	position: relative;
	z-index: 2;
	/* Over the faded left edge of the photo, clear of the jar. */
	max-width: 45%;
}

.category-card__title {
	margin-block-end: var(--space-md);
	font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.875rem);
	line-height: 1.1;
	text-wrap: balance;
}

.category-card__link {
	text-decoration: none;
}

.category-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
}

.category-card__cta {
	display: inline-flex;
	gap: var(--space-3xs);
	align-items: center;
	padding: var(--space-2xs) var(--space-md);
	background: var(--munchi-navy);
	border-radius: var(--radius-pill);
	color: var(--color-text-inverse);
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
}

.category-card__media {
	position: absolute;
	inset: 0 0 0 30%;
	z-index: 1;
	overflow: hidden;
}

/*
 * The category photographs are wide scenes with the jar right of centre.
 * They fill the right of the card, cropped from the left, and fade into the
 * card's colour under the title.
 */
.category-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 68% center;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
	mask-image: linear-gradient(to right, transparent, #000 30%);
	transition: transform var(--duration-slow) var(--ease-out);
}

.category-card:hover .category-card__image {
	transform: scale(1.04);
}

@media (max-width: 899px) {
	.categories__grid {
		grid-template-columns: 1fr;
	}
}

/* =========================================================
   Our Best Sellers
   ========================================================= */

.bestsellers .section-heading {
	margin-block-end: var(--space-lg);
}

/* Every card here is a best seller, so its "Bestseller" badge would only repeat the heading. */
.bestsellers .product-card__badge.is-featured {
	display: none;
}

.bestsellers__all {
	margin-block-start: var(--space-lg);
	text-align: center;
}

/* =========================================================
   The Munchi Difference
   ========================================================= */

.difference {
	background: var(--munchi-navy);
	color: var(--color-text-inverse);
}

.difference .section-heading {
	margin-block-end: var(--space-lg);
}

.difference__flow {
	display: grid;
	gap: var(--space-xl);
	grid-template-columns: repeat(3, 1fr);
	align-items: start;
	max-width: 66rem;
	margin-inline: auto;
}

.difference__step {
	position: relative;
	text-align: center;
}

/* A plain arrow between steps, centred on the image row. */
.difference__step + .difference__step::before {
	content: "→";
	position: absolute;
	top: calc(var(--difference-media-height) / 2);
	left: calc(-1 * var(--space-xl) / 2);
	color: var(--color-text-inverse);
	font-size: 2rem;
	line-height: 1;
	transform: translate(-50%, -50%);
}

.difference__flow {
	--difference-media-height: 10rem;
}

.difference__media {
	display: grid;
	place-items: center;
	height: var(--difference-media-height);
	margin-block-end: var(--space-sm);
}

/*
 * Cut-outs on transparency, so they float on the navy. Each is fitted inside
 * the same box, whatever its shape, and never cropped.
 */
.difference__image {
	width: auto;
	height: auto;
	max-width: 100%;
	/* The box's own height, not 100%: a grid item's percentage height does not resolve here. */
	max-height: var(--difference-media-height);
	object-fit: contain;
}

.difference__step-number {
	display: grid;
	place-items: center;
	width: 4rem;
	height: 4rem;
	border: 2px solid var(--munchi-yellow);
	border-radius: var(--radius-pill);
	color: var(--munchi-yellow);
	font-family: var(--font-display);
	font-size: var(--text-xl);
	font-weight: var(--weight-black);
}

.difference__number {
	display: inline-block;
	margin-block-end: var(--space-2xs);
	padding: 0.15rem var(--space-xs);
	background: var(--munchi-yellow);
	border-radius: var(--radius-pill);
	color: var(--munchi-navy);
	font-size: var(--text-xs);
	font-weight: var(--weight-black);
}

.difference__title {
	max-width: 14rem;
	margin-inline: auto;
	font-size: var(--text-lg);
	text-wrap: balance;
}

.difference__text {
	max-width: 16rem;
	margin: var(--space-2xs) auto 0;
	color: var(--color-text-inverse-muted);
	font-size: var(--text-sm);
	text-wrap: balance;
}

@media (max-width: 767px) {
	.difference__flow {
		grid-template-columns: 1fr;
	}

	.difference__step + .difference__step::before {
		top: calc(-1 * var(--space-xl) / 2);
		left: 50%;
		transform: translate(-50%, -50%) rotate(90deg);
	}
}

/* =========================================================
   Why different methods? (template-parts/home/process.php)
   ========================================================= */

.methods {
	position: relative;
	overflow: hidden;
	--methods-leaf: #4f8a3a;
	--methods-green: #3f7f25;
}

.methods__sprig {
	position: absolute;
	inset-block-start: var(--space-xl);
	width: clamp(5rem, 9vw, 8.5rem);
	height: auto;
	fill: var(--methods-leaf);
	opacity: 0.85;
	pointer-events: none;
}

.methods__stem {
	fill: none;
	stroke: var(--methods-leaf);
	stroke-width: 4;
	stroke-linecap: round;
}

.methods__sprig--start {
	inset-inline-start: -1.25rem;
}

.methods__sprig--end {
	inset-inline-end: -1.25rem;
	transform: scaleX(-1);
}

.methods__heading {
	max-width: 60rem;
	margin: 0 auto var(--space-lg);
	text-align: center;
}

.methods__title {
	display: flex;
	gap: 0.3em;
	align-items: center;
	justify-content: center;
	font-size: var(--text-3xl);
	font-weight: var(--weight-black);
	line-height: 1.1;
}

.methods__title-accent {
	color: var(--methods-green);
}

.methods__strokes {
	flex: none;
	width: 0.75em;
	height: 0.6em;
	fill: none;
	stroke: var(--munchi-yellow);
	stroke-width: 5;
	stroke-linecap: round;
}

.methods__strokes:last-child {
	transform: scaleX(-1);
}

.methods__intro {
	max-width: 36rem;
	margin: var(--space-xs) auto 0;
	color: var(--color-text-muted);
	font-size: var(--text-md);
}

.methods__list {
	display: grid;
	gap: var(--space-md);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* One colour set per method: card, edge, ingredient strip, number badge. */
.method {
	--method-tint: #fff7e0;
	--method-edge: #f6e1a3;
	--method-strip: #fdebb8;
	--method-accent: var(--munchi-yellow);
	--method-accent-ink: var(--munchi-navy);

	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.8fr);
	gap: var(--space-md);
	padding: var(--space-xs);
	border: 1px solid var(--method-edge);
	border-radius: var(--radius-md);
	background: var(--method-tint);
}

.method--freeze-drying {
	--method-tint: #eaf4fc;
	--method-edge: #c5e1f6;
	--method-strip: #d6eaf9;
	--method-accent: #1f7fcf;
	--method-accent-ink: #ffffff;
}

.method--vacuum-frying {
	--method-tint: #eef6e5;
	--method-edge: #cfe4b9;
	--method-strip: #dcedc8;
	--method-accent: var(--methods-green);
	--method-accent-ink: #ffffff;
}

.method__photo {
	overflow: hidden;
	border-radius: calc(var(--radius-md) - var(--space-xs));
}

.method__photo-image {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 11rem;
	object-fit: cover;
	/* The produce sits on the left of each photo; keep it in frame. */
	object-position: 30% 50%;
}

.method__body {
	display: grid;
	gap: var(--space-sm);
	align-content: center;
	padding-block: var(--space-2xs);
	padding-inline-end: var(--space-2xs);
}

.method__header {
	display: flex;
	gap: var(--space-sm);
	align-items: center;
}

.method__number {
	display: grid;
	flex: none;
	width: 3.25rem;
	height: 3.25rem;
	place-items: center;
	border-radius: 50%;
	background: var(--method-accent);
	color: var(--method-accent-ink);
	font-family: var(--font-display);
	font-size: var(--text-xl);
	font-weight: var(--weight-black);
}

.method__title {
	font-size: var(--text-xl);
	font-weight: var(--weight-black);
	letter-spacing: 0.01em;
	line-height: 1.15;
	text-transform: uppercase;
}

.method__summary {
	margin: 0.15rem 0 0;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.method__steps {
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: var(--space-lg);
	margin: 0;
	padding: var(--space-sm);
	border-radius: var(--radius-sm);
	background: rgb(255 255 255 / 0.72);
	list-style: none;
}

.method-step {
	position: relative;
	display: flex;
	gap: var(--space-xs);
	align-items: center;
}

.method-step__arrow {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: calc(var(--space-lg) / -2);
	color: var(--method-accent);
	transform: translate(-50%, -50%);
}

.method--dehydration .method-step__arrow {
	color: var(--munchi-yellow-dark);
}

.method-step__arrow .munchi-icon {
	display: block;
	width: 1.1rem;
	height: 1.1rem;
	stroke-width: 2.4;
}

.method-step__image {
	flex: none;
	width: clamp(4rem, 5.5vw, 5.5rem);
	height: auto;
	max-height: 4.75rem;
	object-fit: contain;
}

/* Four steps share the same width as three: smaller pictures leave room for the words. */
.method__steps:has(> li:nth-child(4)) .method-step__image {
	width: clamp(3.5rem, 4vw, 4rem);
}

.method-step__text {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
}

.method-step__title {
	display: flex;
	gap: 0.4rem;
	align-items: flex-start;
	font-size: var(--text-sm);
	font-weight: var(--weight-bold);
	line-height: 1.25;
}

.method-step__number {
	display: grid;
	flex: none;
	width: 1.3rem;
	height: 1.3rem;
	place-items: center;
	border-radius: 50%;
	background: var(--method-accent);
	color: var(--method-accent-ink);
	font-size: 0.75rem;
	line-height: 1;
}

.method-step__detail {
	color: var(--color-text-muted);
	font-size: 0.78rem;
	line-height: 1.4;
}

.method__for {
	display: flex;
	gap: var(--space-md);
	align-items: center;
	padding: var(--space-2xs) var(--space-md);
	border-radius: var(--radius-pill);
	background: var(--method-strip);
}

.method__for-label {
	flex: none;
	margin: 0;
	font-size: var(--text-sm);
	font-weight: var(--weight-bold);
}

.method__for-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs) var(--space-lg);
	margin: 0;
	padding: 0;
	list-style: none;
}

.method__for-item {
	display: flex;
	gap: var(--space-2xs);
	align-items: center;
	font-size: var(--text-sm);
}

/* Lets a long name ("Mixed vegetables") wrap beside its picture. */
.method__for-name {
	min-width: 0;
}

.method__for-image {
	width: auto;
	height: 2.4rem;
}

/* Narrower desktops: each step's picture above its text, so four steps fit. */
@media (max-width: 1359px) {
	.method-step {
		flex-direction: column;
		align-items: flex-start;
	}

	.method-step__image {
		height: 4rem;
		width: auto;
		max-width: 100%;
	}
}

/* Tablets: steps wrap two to a row; the arrows would point across rows, so they go. */
@media (max-width: 1180px) {
	.method__steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-flow: row;
	}

	.method-step__arrow {
		display: none;
	}

	.method__for {
		gap: var(--space-sm);
		border-radius: var(--radius-sm);
	}

	.method__for-list {
		gap: var(--space-2xs) var(--space-md);
	}

	.method-step {
		flex-direction: row;
		align-items: center;
	}

	.method-step__image {
		width: 4.5rem;
		height: auto;
	}
}

/* Photo on top, then the steps. */
@media (max-width: 900px) {
	.methods__sprig {
		display: none;
	}

	.method {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-sm);
	}

	.method__photo-image {
		min-height: 0;
		max-height: 13rem;
		aspect-ratio: 444 / 162;
	}

	.method__body {
		padding: 0 var(--space-2xs) var(--space-2xs);
	}
}

/* Phones: one step per row with arrows pointing down, ingredients two by two. */
@media (max-width: 640px) {
	.methods__title {
		font-size: clamp(1.75rem, 1.2rem + 3vw, 2.25rem);
	}

	.methods__strokes {
		display: none;
	}

	.method__steps {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-md);
	}

	.method-step__arrow {
		display: block;
		inset-block-start: calc(var(--space-md) / -2);
		inset-inline-start: 2.25rem;
		transform: translate(-50%, -50%) rotate(90deg);
	}

	.method__number {
		width: 2.75rem;
		height: 2.75rem;
		font-size: var(--text-lg);
	}

	.method__for {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-xs);
		padding: var(--space-sm);
		border-radius: var(--radius-sm);
	}

	.method__for-list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-xs);
		width: 100%;
	}

	/* Two to a row must fit "Mixed vegetables" on a 360px phone. */
	.method__for-item {
		gap: 0.375rem;
	}

	.method__for-image {
		height: 2rem;
	}
}

/* =========================================================
   Product showcase
   ========================================================= */

.products .section-heading {
	margin-block-end: var(--space-md);
}

.product-filter {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
	justify-content: center;
	margin-block-end: var(--space-lg);
}

.product-filter__tab {
	min-height: 2.5rem;
	display: inline-flex;
	align-items: center;
	padding: var(--space-2xs) var(--space-md);
	background: var(--color-surface);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-pill);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--duration-fast) var(--ease-out),
		border-color var(--duration-fast) var(--ease-out);
}

.product-filter__tab:hover {
	border-color: var(--munchi-navy);
}

.product-filter__tab.is-active {
	background: var(--munchi-yellow);
	border-color: var(--munchi-yellow);
	color: var(--munchi-navy);
}

.products__view-all {
	margin-block-start: var(--space-lg);
	font-size: var(--text-sm);
	text-align: center;
}

.products__view-all .link-underline {
	border-block-end: 0;
	font-weight: var(--weight-semibold);
}

/* =========================================================
   Story
   ========================================================= */

.story {
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--munchi-navy);
	color: var(--color-text-inverse);
}

.story__content {
	display: flex;
	align-items: center;
	padding-block: var(--space-2xl);
	/* Align the text with the site container even though the section is full-bleed. */
	padding-inline: max(var(--gutter), calc((100vw - var(--container-max)) / 2)) var(--space-xl);
}

.story__content-inner {
	max-width: 32rem;
}

.story .section-heading__label {
	color: var(--munchi-yellow);
}

.story__title {
	margin-block: var(--space-xs) var(--space-md);
	font-size: clamp(1.875rem, 1.3rem + 1.6vw, 2.75rem);
	line-height: 1.1;
}

.story__title-accent {
	display: block;
}

.story__text {
	margin-block-end: var(--space-sm);
	color: var(--color-text-inverse-muted);
}

/* The brand line, set as a pull-quote. */
.story__tagline {
	margin-block: var(--space-md) var(--space-lg);
	padding-inline-start: var(--space-md);
	border-inline-start: 4px solid var(--munchi-yellow);
	color: var(--munchi-yellow);
	font-family: var(--font-display);
	font-size: var(--text-xl);
	font-weight: var(--weight-bold);
	line-height: var(--leading-snug);
}

/*
 * The photos as a collage: one tall image, two stacked beside it. With fewer
 * photos set, the grid simplifies (see the --1 and --2 variants).
 */
.story__media {
	display: grid;
	gap: var(--space-sm);
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	grid-template-rows: repeat(2, minmax(0, 1fr));
	min-height: 32rem;
	padding: var(--space-2xl) max(var(--gutter), calc((100vw - var(--container-max)) / 2)) var(--space-2xl) var(--space-lg);
}

.story__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--radius-md);
}

.story__image--1 {
	grid-row: 1 / -1;
}

.story__media--1 {
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
}

.story__media--2 {
	grid-template-rows: 1fr;
}

.story__media--2 .story__image--1 {
	grid-row: auto;
}

@media (max-width: 899px) {
	.story {
		grid-template-columns: 1fr;
	}

	.story__content {
		padding-inline: var(--gutter);
	}

	.story__media {
		order: -1;
		min-height: 20rem;
		padding: var(--space-lg) var(--gutter) 0;
	}
}

/* =========================================================
   Values
   ========================================================= */

.values {
	padding-block-end: 0;
}

.values__grid {
	display: grid;
	gap: var(--space-lg);
	grid-template-columns: repeat(4, 1fr);
}

.values__item {
	text-align: center;
}

.values__icon {
	display: block;
	margin-block-end: var(--space-xs);
}

.values__icon .munchi-icon {
	width: 2.75rem;
	height: 2.75rem;
	margin-inline: auto;
	stroke-width: 1.3;
}

.values__title {
	max-width: 10rem;
	margin-inline: auto;
	margin-block-end: var(--space-2xs);
	font-size: var(--text-base);
	text-wrap: balance;
}

.values__text {
	max-width: 13rem;
	margin-inline: auto;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

@media (max-width: 767px) {
	.values__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* =========================================================
   Testimonials
   ========================================================= */

.testimonials__grid {
	display: flex;
	gap: var(--space-md);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.testimonials__grid::-webkit-scrollbar {
	display: none;
}

/* Three to a row, then the rail scrolls. */
.testimonials__item {
	flex: 0 0 calc((100% - 2 * var(--space-md)) / 3);
	scroll-snap-align: start;
}

.testimonial {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: var(--space-lg);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
}

.testimonial__stars {
	display: flex;
	gap: 2px;
	margin-block-end: var(--space-sm);
	color: var(--color-border-strong);
}

.testimonial__star.is-filled {
	color: var(--munchi-yellow);
}

.testimonial__star .munchi-icon {
	width: 1rem;
	height: 1rem;
	fill: currentColor;
	stroke: none;
}

.testimonial__quote {
	margin-block-end: var(--space-md);
}

.testimonial__author {
	/* Pinned to the bottom, so attributions line up across a row of cards
	   whose quotes differ in length. */
	margin-block-start: auto;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.testimonial__author::before {
	content: "— ";
}

@media (max-width: 899px) {
	.testimonials__item {
		flex-basis: min(20rem, 85%);
	}
}

/* =========================================================
   FAQs
   ========================================================= */

.faq__inner {
	display: grid;
	gap: var(--space-xl);
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
	align-items: start;
}

/* The heading and the help prompt stay in view while the questions scroll. */
.faq__intro {
	position: sticky;
	top: 7rem;
}

.faq__title {
	margin-block-end: var(--space-sm);
	font-size: var(--text-3xl);
	line-height: 1.1;
}

.faq__lead {
	max-width: 24rem;
	color: var(--color-text-muted);
	font-size: var(--text-lg);
}

.faq__help {
	margin-block-start: var(--space-lg);
	padding: var(--space-md);
	background: var(--munchi-navy);
	border-radius: var(--radius-md);
	color: var(--color-text-inverse);
}

.faq__help-title {
	margin-block-end: var(--space-sm);
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: var(--weight-bold);
}

.faq__help-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
}

.faq__help .btn--outline {
	border-color: rgba(255, 255, 255, 0.45);
	color: var(--color-text-inverse);
}

.faq__help .btn--outline:hover {
	background: var(--color-text-inverse);
	color: var(--munchi-navy);
}

.faq__list {
	border-block-start: 1px solid var(--color-border-strong);
}

.faq__item {
	border-block-end: 1px solid var(--color-border-strong);
}

.faq__question {
	display: flex;
	gap: var(--space-md);
	align-items: center;
	justify-content: space-between;
	padding: var(--space-md) 0;
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: var(--weight-bold);
	cursor: pointer;
	list-style: none;
}

.faq__question::-webkit-details-marker {
	display: none;
}

.faq__question:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

/* A plus that turns into a minus when the answer is open. */
.faq__toggle {
	position: relative;
	flex: none;
	width: 2rem;
	height: 2rem;
	background: var(--munchi-yellow-soft);
	border-radius: var(--radius-pill);
	transition: background-color var(--duration-fast) var(--ease-out);
}

.faq__toggle::before,
.faq__toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.75rem;
	height: 2px;
	background: var(--munchi-navy);
	border-radius: 2px;
	transform: translate(-50%, -50%);
	transition: transform var(--duration-base) var(--ease-out);
}

.faq__toggle::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.faq__item[open] .faq__toggle {
	background: var(--munchi-yellow);
}

.faq__item[open] .faq__toggle::after {
	transform: translate(-50%, -50%) rotate(0deg);
}

.faq__answer {
	max-width: 40rem;
	padding-block-end: var(--space-md);
	color: var(--color-text-muted);
}

.faq__answer p + p {
	margin-block-start: var(--space-xs);
}

.faq__answer a {
	color: var(--color-text);
}

@media (max-width: 899px) {
	.faq__inner {
		grid-template-columns: 1fr;
		gap: var(--space-lg);
	}

	.faq__intro {
		position: static;
	}

	.faq__question {
		font-size: var(--text-base);
	}
}

/* =========================================================
   #MunchiMoments — Instagram Reels carousel
   ========================================================= */

.moments__rail {
	--reel-gap: var(--space-md);
	display: flex;
	gap: var(--reel-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-block-end: var(--space-2xs);
}

.moments__rail::-webkit-scrollbar {
	display: none;
}

/*
 * Flowing continuously: snapping would fight the steady movement, and soft
 * edges let cards drift in and out rather than being cut off.
 */
.moments__rail.is-marquee {
	scroll-snap-type: none;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}

/* Five reels to a view on desktop, then the rail scrolls. */
.moments__item {
	flex: 0 0 calc((100% - 4 * var(--reel-gap)) / 5);
	scroll-snap-align: start;
}

/* A reel is 9:16, so the card is too. */
.reel-card {
	position: relative;
	display: block;
	aspect-ratio: 9 / 16;
	overflow: hidden;
	background: var(--munchi-navy);
	border-radius: var(--radius-md);
	color: var(--color-text-inverse);
	text-decoration: none;
}

.reel-card__cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration-slow) var(--ease-out);
}

/* A darkened foot so the handle and caption read over any cover. */
.reel-card::after {
	content: "";
	position: absolute;
	inset: 45% 0 0;
	background: linear-gradient(to top, rgba(17, 26, 36, 0.85), transparent);
	pointer-events: none;
}

.reel-card__badge.munchi-icon {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	z-index: 1;
	width: 1.5rem;
	height: 1.5rem;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.reel-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	background: rgba(255, 255, 255, 0.25);
	border: 1.5px solid rgba(255, 255, 255, 0.7);
	border-radius: var(--radius-pill);
	backdrop-filter: blur(6px);
	transform: translate(-50%, -50%);
	transition:
		background-color var(--duration-base) var(--ease-out),
		transform var(--duration-base) var(--ease-out);
}

.reel-card__play .munchi-icon {
	width: 1.4rem;
	height: 1.4rem;
	/* Optical centring: a play triangle's weight sits left of its box. */
	margin-inline-start: 0.2rem;
}

.reel-card__meta {
	position: absolute;
	right: var(--space-sm);
	bottom: var(--space-sm);
	left: var(--space-sm);
	z-index: 1;
	display: grid;
	gap: 2px;
}

.reel-card__handle {
	font-size: var(--text-sm);
	font-weight: var(--weight-bold);
}

.reel-card__caption {
	display: -webkit-box;
	overflow: hidden;
	font-size: var(--text-xs);
	line-height: var(--leading-snug);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* Only a real reel responds to the pointer; a placeholder is not a link. */
a.reel-card:hover .reel-card__cover {
	transform: scale(1.05);
}

a.reel-card:hover .reel-card__play {
	background: var(--munchi-yellow);
	border-color: var(--munchi-yellow);
	color: var(--munchi-navy);
	transform: translate(-50%, -50%) scale(1.08);
}

a.reel-card:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 3px;
}

.moments .admin-notice-inline {
	margin-block-end: var(--space-md);
}

.moments__cta {
	margin-block-start: var(--space-lg);
	text-align: center;
}

@media (max-width: 1023px) {
	.moments__item {
		flex-basis: calc((100% - 2 * var(--reel-gap)) / 3);
	}
}

/* Phones: a card and a half, so the swipe is obvious. */
@media (max-width: 599px) {
	.moments__rail {
		--reel-gap: var(--space-sm);
	}

	.moments__item {
		flex-basis: 62%;
	}
}

/* =========================================================
   Closing CTA

   Not in the default section list; available through the
   munchi_homepage_sections filter.
   ========================================================= */

.cta {
	padding-block-end: var(--space-3xl);
}

.cta__panel {
	display: grid;
	grid-template-columns: 1fr 1fr;
	overflow: hidden;
	min-height: 19rem;
	background: var(--munchi-yellow);
	border-radius: var(--radius-lg);
}

.cta__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding: var(--space-xl);
}

.cta__title {
	margin-block: var(--space-xs) var(--space-sm);
	font-size: var(--text-2xl);
}

.cta__text {
	margin-block-end: var(--space-md);
}

.cta__media {
	position: relative;
}

.cta__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 767px) {
	.cta__panel {
		grid-template-columns: 1fr;
	}

	.cta__media {
		min-height: 14rem;
		order: -1;
	}
}

/* A placeholder review, marked for administrators only. */
.testimonial--placeholder {
	position: relative;
	border: 1px dashed var(--munchi-yellow-dark);
}

.testimonial__placeholder-badge {
	position: absolute;
	top: var(--space-2xs);
	right: var(--space-2xs);
	padding: 2px var(--space-2xs);
	background: var(--munchi-yellow-soft);
	border-radius: var(--radius-pill);
	color: #6b4e00;
	font-size: 0.625rem;
	font-weight: var(--weight-black);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Tablets: four best sellers as a 2 × 2 block rather than three and a lone fourth. */
@media (min-width: 600px) and (max-width: 1023px) {
	.bestsellers .product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-width: 42rem;
		margin-inline: auto;
	}
}
