/*
 * Photo and text section (sections/split.php).
 *
 * Figma at 1440: Facilities rows 83:319 / 83:337 / 83:355 (600×500 arch photo, 85px gap,
 * 585px text column, 72px top and bottom) and the home party band 83:158 (waves on:
 * 630×450 photo with a 300px top radius, 548px text column, balloons, 818px tall).
 */
.pe-split {
	/* Column widths as fractions of the Figma pixels, so they keep the proportions. */
	--pe-split-media: 600fr;
	--pe-split-text: 585fr;
	--pe-split-gap: clamp(2.5rem, 5.9vw, 5.3125rem); /* 85px */

	padding-block: clamp(3rem, 5vw, 4.5rem); /* 72px */
}

.pe-split__inner {
	display: grid;
	grid-template-columns: minmax(0, var(--pe-split-media)) minmax(0, var(--pe-split-text));
	grid-template-areas: "media text";
	align-items: center;
	gap: var(--pe-split-gap);
}

.pe-split--image-right .pe-split__inner {
	grid-template-columns: minmax(0, var(--pe-split-text)) minmax(0, var(--pe-split-media));
	grid-template-areas: "text media";
}

.pe-split.pe-split--no-image .pe-split__inner {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "text";
}

.pe-split__media {
	grid-area: media;
	/* Lets the arch radius be worked out from the photo's width (cqi). */
	container-type: inline-size;
}

.pe-split__photo {
	width: 100%;
}

/* ---- Text column ---- */
.pe-split__text {
	grid-area: text;
	position: relative;
	isolation: isolate; /* keeps the balloons behind the text */
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.pe-split__eyebrow {
	margin: 0 0 0.18rem;
}

.pe-split__heading {
	margin: 0;
}

.pe-split__body {
	max-width: 33.75rem; /* 540px */
	margin-top: 1.5rem;
	font-size: var(--pe-text-intro); /* 27.24px */
	line-height: 1.45;
}

.pe-split__body > :last-child {
	margin-bottom: 0;
}

.pe-split__buttons {
	margin-top: 1.5rem; /* 24px */
}

/* "View menu" (83:361): 230 × 64 outline button. */
.pe-split__buttons .pe-button:not(.pe-button--xl) {
	min-height: 4rem;
	padding-inline: 3.5625rem; /* 57px each side of the label */
}

/* Small flower under the text (58px yellow, 56.7px lilac at 1440). */
.pe-split__flower {
	width: 3.632rem;
	margin-top: 1.5rem;
}

.pe-split__flower--flower-lilac {
	width: 3.541rem;
}

/* Big lilac flower (Baby play 83:337): 178px, level with the top of the photo, 416px
   into the 585px text column, painted over the row. It shares the text's grid cell,
   so the % below are of the text column and it follows the text to either side. */
.pe-split__flower-big {
	grid-area: text;
	align-self: start;
	justify-self: start;
	position: relative;
	z-index: 1;
	width: 30.43%; /* 178 / 585 */
	margin-left: 71.11%; /* 416 / 585 */
}

/* ---- Balloons: above the eyebrow, top right, behind the text ---- */
.pe-split--deco-balloons .pe-split__text {
	--pe-split-balloons: clamp(5.5rem, 11.15vw, 10.033rem); /* 160.5px */

	/* The balloons start 105px above the eyebrow. */
	padding-top: calc(var(--pe-split-balloons) * 0.654);
}

.pe-split__balloons,
.pe-split__balloons-flower {
	position: absolute;
	z-index: -1;
}

.pe-split__balloons {
	top: 0;
	left: 38.5%; /* 211px into the 548px column */
	width: var(--pe-split-balloons);
}

.pe-split__balloons-flower {
	top: calc(var(--pe-split-balloons) * 0.0374);
	left: 72.1%; /* 395px */
	width: calc(var(--pe-split-balloons) * 0.441); /* 70.8px */
}

/* ---- Waves: the home party band ----
   A light-peach band with wavy edges: the wave shape at the top, the same shape
   flipped at the bottom, and a solid fill between them where they don't overlap.
   The colour comes from the shape, so the Section settings background is not used. */
.pe-section.pe-split--waves {
	--pe-split-media: 635fr; /* 630px photo + 5px inset */
	--pe-split-text: 548fr;
	--pe-split-gap: clamp(2.5rem, 6.04vw, 5.4375rem); /* 87px */

	isolation: isolate;
	background: none;
	/* % padding follows the width, like the waves: 184px at 1440 → 818px tall. */
	padding-block: max(4rem, 12.78%);
}

.pe-split--waves::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	/* % margins follow the width too: the fill starts inside the solid part of the waves. */
	margin-block: 16%;
	background: var(--pe-peach-light);
}

.pe-split__wave {
	position: absolute;
	left: 0;
	z-index: -1;
}

.pe-split__wave--top {
	top: 0;
}

.pe-split__wave--bottom {
	bottom: 0;
	transform: scaleY(-1);
}

.pe-split--waves .pe-split__media {
	padding-left: 0.3125rem;
}

.pe-split--waves.pe-split--image-right .pe-split__media {
	padding-left: 0;
	padding-right: 0.3125rem;
}

.pe-split--waves .pe-split__photo {
	aspect-ratio: 630 / 450;
	--pe-arch-radius: calc(100cqi * 300 / 630);
}

.pe-split--waves .pe-split__body {
	margin-top: 0.375rem;
	line-height: 1.5;
}

.pe-split--waves .pe-split__buttons {
	margin-top: 1.0625rem;
}

.pe-split--waves .pe-button--xl {
	min-width: 22.8125rem; /* 365px */
	max-width: 100%;
}

/* ---- Tablet: narrower gap and photo ---- */
@media (max-width: 1023px) {
	.pe-split,
	.pe-section.pe-split--waves {
		--pe-split-media: 5fr;
		--pe-split-text: 6fr;
		--pe-split-gap: 2.5rem;
	}

	/* The text column is narrow: keep the eyebrow under the balloons (the strings still
	   run behind the text) and let the button take its natural width. */
	.pe-split--deco-balloons .pe-split__text {
		padding-top: var(--pe-split-balloons);
	}

	.pe-split--waves .pe-button--xl {
		min-width: 0;
	}
}

/* ---- Phone: one column, text first, photo under ---- */
@media (max-width: 767px) {
	.pe-split .pe-split__inner,
	.pe-split--image-right .pe-split__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"text"
			"media";
		gap: 2rem;
	}

	.pe-split__media {
		width: 100%;
		max-width: 37.5rem;
	}

	.pe-split--waves .pe-split__media,
	.pe-split--waves.pe-split--image-right .pe-split__media {
		padding-inline: 0;
	}

	.pe-split__flower {
		width: 2.75rem;
		margin-top: 1.25rem;
	}

	/* The text column is the full width now, so the big flower would sit on the heading. */
	.pe-split__flower-big {
		display: none;
	}
}
