/**
 * Front-page hero layer: call-to-action row, banner slot and the Featured row.
 * Loads after wordpress.css. Height caps (07 §5): the green card stays at or
 * under 200px on phones and 336px on desktop, so the section stays within
 * 216px / 360px including its padding.
 */

/* --------------------------------------------------------------------------
   Default hero with a call-to-action row
   -------------------------------------------------------------------------- */
.bs-hero__card--cta {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"content visual"
		"sub     sub"
		"actions actions";
	align-items: center;
	column-gap: var(--bs-sp-2);
	min-height: 0;
	max-height: none;
	padding: var(--bs-sp-3);
}

.bs-hero__card--cta .bs-hero__content {
	grid-area: content;
	min-width: 0;
	max-width: none;
	padding: 0;
}

.bs-hero__card--cta .bs-hero__tag {
	white-space: nowrap;
}

.bs-hero__card--cta .bs-hero__sub {
	grid-area: sub;
	position: relative;
	z-index: 2;
	max-width: none;
}

.bs-hero__card--cta .bs-hero__visual {
	grid-area: visual;
	gap: 6px;
	padding: 0;
}

.bs-hero__actions {
	grid-area: actions;
	position: relative;
	z-index: 2;
	display: flex;
	gap: var(--bs-sp-2);
	margin-top: var(--bs-sp-3);
}

.bs-hero__cta {
	flex: 1 1 auto;
	width: auto;
	min-height: 44px;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: none;
}

.bs-hero__cta svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* The base hover green is too light for white text; darken instead. */
.bs-hero__cta.bs-btn-whatsapp:hover {
	background-color: var(--bs-whatsapp);
	filter: brightness(0.9);
}

/* Phones share the row between both buttons; wider screens keep their natural width. */
@media (min-width: 480px) {
	.bs-hero__cta {
		flex: 0 0 auto;
	}
}

@media (max-width: 767px) {
	.bs-hero__card--cta .bs-hero__astro-img {
		height: 56px;
	}

	.bs-hero__card--cta .bs-hero__pizza-img {
		width: 76px;
		height: 76px;
	}
}

@media (min-width: 601px) and (max-width: 767px) {
	.bs-hero__card--cta {
		column-gap: var(--bs-sp-4);
		padding-inline: var(--bs-sp-4);
	}

	.bs-hero__card--cta .bs-hero__astro-img {
		height: 68px;
	}

	.bs-hero__card--cta .bs-hero__pizza-img {
		width: 88px;
		height: 88px;
	}
}

/* Narrow phones: the astronaut gives way so the tag line and slogan keep one line each. */
@media (max-width: 359px) {
	.bs-hero__card--cta .bs-hero__astro-img {
		display: none;
	}

	.bs-hero__cta {
		padding-inline: 10px;
		font-size: 13px;
	}

	.bs-hero__cta.bs-btn-whatsapp {
		gap: 6px;
	}

	.bs-hero__cta svg {
		width: 16px;
		height: 16px;
	}
}

@media (min-width: 768px) {
	/* The visual spans every row; the 1fr rows above and below take any spare
	   height, which keeps the copy, facts and buttons centred beside it. */
	.bs-hero__card--cta {
		grid-template-rows: 1fr auto auto auto 1fr;
		grid-template-areas:
			".       visual"
			"content visual"
			"sub     visual"
			"actions visual"
			".       visual";
		column-gap: var(--bs-sp-5);
		min-height: 230px;
		padding: var(--bs-sp-5) var(--bs-sp-6) var(--bs-sp-5) var(--bs-sp-7);
	}

	.bs-hero__actions {
		margin-top: var(--bs-sp-4);
	}

	.bs-hero__cta {
		min-height: 48px;
		padding: 12px 22px;
		font-size: 15px;
	}
}

@media (min-width: 768px) and (max-width: 991px) {
	.bs-hero__card--cta {
		padding-left: var(--bs-sp-6);
	}

	.bs-hero__card--cta .bs-hero__astro-img {
		height: 104px;
	}

	.bs-hero__card--cta .bs-hero__pizza-img {
		width: 168px;
		height: 168px;
	}
}

/* --------------------------------------------------------------------------
   Banner slot: fills the same green card frame at the art's aspect ratio
   -------------------------------------------------------------------------- */
.bs-hero--banner {
	padding-block: var(--bs-sp-2);
}

/* Height follows the card's width at the art's ratio (540 / 1920 = 28.125%), capped.
   Percentage padding is used instead of aspect-ratio because aspect-ratio would turn
   the height cap into a width cap and pull the card off the container's right edge. */
.bs-hero__card--banner {
	display: block;
	height: 0;
	min-height: 0;
	max-height: none;
	padding-bottom: min(28.125%, 200px);
	background-image: none;
}

/* 3:1 client artwork (6000 × 2000) without mobile art: show it whole at every width. */
.bs-hero__card--banner.bs-hero__card--wide-art {
	padding-bottom: 33.3333%;
}

.bs-hero__card--banner::before,
.bs-hero__card--banner::after {
	content: none;
}

@media (max-width: 479px) {
	/* Mobile art is 1080 × 600. */
	.bs-hero__card--banner {
		padding-bottom: min(55.5556%, 200px);
	}

	/* A slide without mobile art shows the whole desktop image on the green card. */
	.bs-banner__slide--desktop-art .bs-banner__img {
		object-fit: contain;
	}

	.bs-hero__card--banner.bs-hero__card--wide-art {
		padding-bottom: 33.3333%;
	}
}

@media (min-width: 768px) {
	.bs-hero--banner {
		padding-block: var(--bs-sp-3);
	}

	.bs-hero__card--banner {
		padding-bottom: min(28.125%, 336px);
	}

	.bs-hero__card--banner.bs-hero__card--wide-art {
		padding-bottom: 33.3333%;
	}
}

/* Phones and small tablets: the 3:1 art is short, so the slider buttons sit under it instead of covering it. */
@media (max-width: 767px) {
	.bs-hero__card--banner.bs-hero__card--wide-art {
		overflow: visible;
		margin-bottom: 44px;
	}

	.bs-hero__card--wide-art .bs-banner__track {
		overflow: hidden;
	}

	.bs-hero__card--wide-art .bs-banner__controls {
		top: 100%;
		right: -6px;
		bottom: auto;
	}
}

.bs-banner__track,
.bs-banner__slide {
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.bs-banner__track {
	touch-action: pan-y pinch-zoom;
}

/* The incoming slide fades in on top; the outgoing one stays opaque underneath
   until the fade ends, so the card never dips to green between slides. */
.bs-banner__slide {
	--bs-banner-reveal: 900ms;
	z-index: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0s linear var(--bs-banner-reveal), visibility 0s linear var(--bs-banner-reveal);
}

.bs-banner__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: none;
}

/* Slide change (never on first paint, so the LCP image is untouched): the new banner wipes in from the side it
   comes from while its art settles from a slight zoom; the old one stays underneath and eases back. */
.bs-banner.has-moved .bs-banner__slide.is-active {
	animation: bs-banner-wipe-next var(--bs-banner-reveal) var(--bs-ease-out) both;
}

.bs-banner.has-moved[data-bs-dir="prev"] .bs-banner__slide.is-active {
	animation-name: bs-banner-wipe-prev;
}

.bs-banner.has-moved .bs-banner__slide.is-active .bs-banner__img {
	animation: bs-banner-settle calc(var(--bs-banner-reveal) + 300ms) var(--bs-ease-out) both;
}

.bs-banner.has-moved .bs-banner__slide.is-leaving .bs-banner__img {
	animation: bs-banner-recede var(--bs-banner-reveal) var(--bs-ease-out) both;
}

@keyframes bs-banner-wipe-next {
	from { clip-path: inset(0 0 0 100%); }
	to { clip-path: inset(0 0 0 0); }
}

@keyframes bs-banner-wipe-prev {
	from { clip-path: inset(0 100% 0 0); }
	to { clip-path: inset(0 0 0 0); }
}

@keyframes bs-banner-settle {
	from { transform: scale(1.08); }
	to { transform: none; }
}

@keyframes bs-banner-recede {
	from { transform: none; filter: brightness(1); }
	to { transform: scale(1.04); filter: brightness(0.75); }
}

.bs-banner__link,
.bs-banner__picture {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}

.bs-banner__link {
	position: relative;
}

.bs-banner__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The card clips overflow, so the focus ring sits inside the frame: the site's ring colour
   (yellow on this green card) with a green inner edge so it reads on any artwork. */
.bs-banner__link:focus-visible {
	outline: 3px solid var(--bs-focus-ring, var(--bs-yellow-400));
	outline-offset: -3px;
	box-shadow: inset 0 0 0 5px var(--bs-green-900);
}

.bs-banner__link:focus-visible::after {
	content: '';
	position: absolute;
	inset: 3px;
	border: 2px solid var(--bs-white);
	border-radius: inherit;
	pointer-events: none;
}

.bs-banner__controls {
	position: absolute;
	z-index: 2;
	right: 6px;
	bottom: 6px;
	display: flex;
	align-items: center;
}

/* Rotation pauses on hover and keyboard focus and stops after a manual change, so no Pause button is shown. */
.bs-banner__toggle {
	display: none !important;
}

.bs-banner__toggle,
.bs-banner__dot {
	position: relative;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: var(--bs-radius-pill);
	color: var(--bs-cream-50);
}

.bs-banner__toggle::before {
	content: '';
	position: absolute;
	inset: 6px;
	border-radius: var(--bs-radius-pill);
	background-color: var(--bs-green-900);
	transition: background-color var(--bs-dur-fast) var(--bs-ease-out);
}

.bs-banner__toggle:hover::before {
	background-color: var(--bs-green-700);
}

.bs-banner__icon {
	position: relative;
	width: 14px;
	height: 14px;
	fill: currentColor;
}

.bs-banner__toggle[data-bs-state="playing"] .bs-banner__icon--play,
.bs-banner__toggle[data-bs-state="paused"] .bs-banner__icon--pause {
	display: none;
}

/* Cream dot with a green ring, so it reads on light and dark artwork alike. */
.bs-banner__dot::before {
	content: '';
	width: 14px;
	height: 14px;
	border: 2px solid var(--bs-green-900);
	border-radius: var(--bs-radius-pill);
	background-color: var(--bs-cream-50);
	transition: width var(--bs-dur-fast) var(--bs-ease-out), background-color var(--bs-dur-fast) var(--bs-ease-out);
}

.bs-banner__dot[aria-current="true"]::before {
	width: 26px;
	background-color: var(--bs-yellow-400);
}

/* While the banners rotate, the current dot fills up until the next slide. */
.bs-banner.is-timing .bs-banner__dot[aria-current="true"]::before {
	background-color: var(--bs-cream-50);
}

.bs-banner__dot::after {
	content: '';
	position: absolute;
	top: calc(50% - 5px);
	left: calc(50% - 11px);
	width: 0;
	height: 10px;
	border-radius: var(--bs-radius-pill);
	background-color: var(--bs-yellow-400);
	opacity: 0;
}

.bs-banner.is-timing .bs-banner__dot[aria-current="true"]::after {
	opacity: 1;
	animation: bs-banner-progress var(--bs-banner-ms, 6000ms) linear both;
}

@keyframes bs-banner-progress {
	from { width: 0; }
	to { width: 22px; }
}

.bs-banner__toggle:focus-visible,
.bs-banner__dot:focus-visible {
	outline-offset: 0;
}

/* "Order now" moves focus to the first category pill. The pills' scroll container
   clips anything outside it, so it gets room for the focus ring above, below and
   at the start; the negative margin cancels the padding and nothing moves. */
.bs-cats__bar .bs-cats__scroll {
	padding: 6px 0 6px 6px;
	margin: -6px 0 -6px -6px;
}

/* --------------------------------------------------------------------------
   Featured row
   -------------------------------------------------------------------------- */
.bs-section--featured .bs-grid + .bs-grid {
	margin-top: var(--bs-sp-4);
}

@media (min-width: 1100px) {
	.bs-section--featured .bs-grid + .bs-grid {
		margin-top: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bs-banner.has-moved .bs-banner__slide.is-active,
	.bs-banner.has-moved .bs-banner__slide.is-active .bs-banner__img,
	.bs-banner.has-moved .bs-banner__slide.is-leaving .bs-banner__img {
		animation: none;
	}

	.bs-banner__slide,
	.bs-banner__slide.is-active,
	.bs-banner__toggle::before,
	.bs-banner__dot::before {
		transition: none;
	}
}
