/**
 * Homepage sections.
 *
 * Loaded only on the front page — see burgerboi_enqueue_page_style() in
 * inc/enqueue.php. Sections are added here as each is built against Figma.
 *
 * Figma reference: frame "Home", 1512 × 7965.
 * vw midpoints are computed against 1512 so every clamp() maximum lands on the
 * exact Figma value at a 1512px viewport (e.g. 144 / 1512 = 9.5238vw).
 *
 *  1. Hero
 *  2. Order strip
 *  3. Menu categories
 *  4. Marquee
 *  5. Story
 *  6. Signature drop
 *  7. Fan favourites
 *  8. Social wall
 *  9. Locations
 * 10. Franchise
 * 11. News
 * 12. Newsletter
 */

/* -------------------------------------------------------------------------- */
/* 1. Hero                                                                     */
/* -------------------------------------------------------------------------- */

/*
 * Figma "header" group: 1512 × 914, black base with the artwork on top, a
 * bottom-up black scrim, and the copy sitting on the scrim.
 *
 * The header overlays the hero rather than pushing it down, so the hero is the
 * positioning context for it.
 */
/*
 * 110px is the Figma value: both the copy and the buttons sit their boxes 110px
 * off the base of the 914px frame. The headline needs a correction on top of
 * that — see .hero__title — because a CSS line box is not a Figma text frame.
 */
.hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: clamp(600px, 60.45vw, 914px); /* 914 / 1512 */
	padding-block-end: clamp(64px, 7.2751vw, 110px); /* 110 / 1512 */
	background-color: var(--c-black);
	color: var(--c-white);
	isolation: isolate;
}

/* The uploaded background image, when there is one. */
.hero__media {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.hero__media img,
.hero__video {
	width: 100%;
	height: 100%;
	/* object-fit: cover; */
}

/*
 * The scrim: transparent at the top, solid black at the base. It covers the
 * bottom 470px of the 914px frame — 51.42% — so the headline always has
 * contrast no matter what image is behind it.
 */
.hero::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	z-index: -1;
	height: 51.42%;
	background: linear-gradient(180deg, rgb(0 0 0 / 0%) 0%, rgb(0 0 0 / 100%) 100%);
	pointer-events: none;
}

.hero__inner {
	display: flex;
	gap: 32px;
	align-items: flex-end;
	justify-content: space-between;
	width: 100%;
}

/*
 * Figma sets a 16px gap between the eyebrow and the headline. The headline's
 * line box already contributes ~16px of leading above its glyphs at 144px, so a
 * CSS gap of 0 reproduces the 16px of *visible* space in the design. Below the
 * desktop breakpoint the type shrinks, that leading shrinks with it, and a real
 * gap is reinstated.
 */
.hero__content {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
}

@media (max-width: 1100px) {
	.hero__content {
		gap: 8px;
	}
}

/* GeneralSans-SemiboldItalic, 24px, line-height 28.8 (1.2). */
.hero__eyebrow {
	margin: 0;
	font-size: clamp(16px, 1.587vw, 24px); /* 24 / 1512 */
	font-style: italic;
	font-weight: var(--fw-semibold);
	line-height: 1.2;
}

/*
 * The headline: 144px, line-height 129.6 (0.9), letter-spacing -4.32px
 * (-0.03em). The accent half is a character-range override in Figma; here it is
 * its own span so the two halves stay separately editable.
 */
/*
 * At line-height 0.9 the line box is shorter than the glyphs, but it still
 * carries leading below the last baseline — about 11px at 144px. The design
 * measures to the ink, so the box is pulled down by that amount. Expressed in
 * em, it scales with the headline instead of drifting at other viewport widths.
 */
.hero__title {
	margin: 0 0 -0.076em;
	font-size: clamp(30px, 6.6138vw, 100px); /* 100 / 1512 — dialled down from 144 */
	font-weight: var(--fw-bold);
	letter-spacing: -0.03em;
	line-height: 0.9;
	text-transform: uppercase;
}

.hero__title-accent {
	display: block;
	color: var(--c-purple);
}

.hero__actions {
	display: flex;
	flex-shrink: 0;
	flex-direction: column;
	align-items: stretch;
	gap: 16px;
	width: fit-content;
}

/*
 * The two hero buttons read as one matched pair: the secondary "Find a Location"
 * (a small .btn--ghost by default) is bumped up to the primary's dimensions —
 * same padding, 2px border, 18px text on the 1.2 line — and the column is sized
 * to its widest child (width: fit-content + align-items: stretch) so both pills
 * share the same width too.
 */
.hero__actions .btn--ghost {
	gap: 8px;
	padding: 10px 22px;
	border-width: 2px;
	font-size: 18px;
	line-height: 1.2;
}

/* --- Scroll cue --- */

.hero__scroll {
	position: absolute;
	bottom: 20px;
	left: 50%;
	display: inline-flex;
	gap: 10px;
	align-items: center;
	padding: 10px;
	color: var(--c-white);
	font-size: 18px;
	font-weight: var(--fw-semibold);
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
	transform: translateX(-50%);
	transition: opacity var(--duration) var(--ease);
}

.hero__scroll:hover {
	opacity: 0.7;
}

.hero__scroll svg {
	width: 24px;
	height: 24px;
	animation: hero-bob 1.8s var(--ease) infinite;
}

@keyframes hero-bob {
	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero__scroll svg {
		animation: none;
	}
}

/* --- Below the Figma breakpoint --- */

/*
 * Copy left, buttons bottom-right is the Figma arrangement, and it holds while
 * the headline is one or two lines. Once the column narrows enough for a third
 * the buttons end up floating alongside its middle, unattached to anything — so
 * they stack under the copy from the same width the navigation collapses at.
 */
@media (max-width: 1150px) {
	.hero__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 32px;
	}

	/* The actions column already sits at the left here (hero__inner stacks
	 * flex-start); the base "stretch" keeps both buttons equal width. */
}

@media (max-width: 640px) {
	.hero {
		padding-block-end: 80px;
		/*
		 * Height is what drives the crop here. The art is a landscape photo and the
		 * frame is portrait, so `cover` zooms until the height fits — and every
		 * extra pixel of hero height throws away more width at the sides. At 600px
		 * on a 390px screen that is a 2.3x zoom, tight enough to cut the subject in
		 * half. Coming down to 470 keeps her whole, and the svh cap stops a short
		 * handset from getting a hero that fills its entire screen.
		 */
		min-height: min(470px, 62svh);
	}

	/*
	 * The hero art is a wide shot with the subject sitting well right of centre
	 * against empty wall. A phone's portrait frame keeps under half its width, so
	 * a centred crop lands on the blank wall and slices her head off — she reads
	 * as a pair of legs. Pulling the crop right brings her, and the burger she is
	 * holding, fully into frame while leaving some wall on the left for the
	 * headline to sit against.
	 *
	 * This is tuned to the photo currently on the site. Swapping the hero image
	 * for one composed differently means revisiting this number.
	 */
	.hero__media img,
	.hero__video {
		/*
		 * Without a fit the image is stretched to the box and the subject is
		 * visibly squashed. `cover` fills the frame at the photo's own proportions
		 * and crops the overflow instead, which object-position then aims.
		 */
		object-fit: cover;
		object-position: 90% 50%;
	}

	/*
	 * A taller, heavier scrim. The desktop gradient assumes a dark upper frame;
	 * the phone crop can put pale table or a white t-shirt directly behind the
	 * headline, where a half-strength wash is not enough to read against.
	 */
	.hero::after {
		height: 100%;
		background: linear-gradient(
			180deg,
			rgb(0 0 0 / 0%) 0%,
			rgb(0 0 0 / 20%) 25%,
			rgb(0 0 0 / 58%) 50%,
			rgb(0 0 0 / 86%) 75%,
			rgb(0 0 0 / 97%) 100%
		);
	}

	.hero__actions {
		width: 100%;
	}

	.hero__actions .btn {
		width: 100%;
	}

	.hero__scroll {
		display: none; /* The cue is redundant on a phone. */
	}
}
