/*
 * Wave divider section (sections/wave-divider.php).
 *
 * The section is only the wave: no padding, no gap above or below. The SVG scales with
 * the width (1440 × 249 or 1440 × 115 at desktop) and just gets shorter on phones.
 *
 * Pairing (Figma), also listed in sections/wave-divider.php:
 *   sage-aqua, aqua-peach, lilac-sage, yellow-aqua: transparent around the ribbons, so
 *     the section above, the divider (its own Background) and the section below must all
 *     share one background. In the design that is cream (default) every time.
 *   yellow-aqua-band: cream above → aqua below (the background is painted here).
 *   peach-in:   cream above  → peach-light below.
 *   peach-out:  peach-light above → cream below.
 *   peach-drop: peach-light above → cream below (hanging wave).
 *   aqua-cream: aqua-light above  → cream below.
 *   aqua-in:    aqua-light above  → aqua below.
 *   aqua-out:   aqua above → cream below.
 *   shape-aqua-light: cream above → aqua-light below.
 *   shape-aqua:       aqua-light above → aqua below.
 *   shape-aqua-cream: cream above → aqua below (What's On, after the cream calendar).
 *   All but the four ribbons are solid, so the divider's own Background doesn't show.
 */
.pe-wave-divider {
	padding-block: 0;
}

/* In Figma, 64:284, 64:818 and 83:426 are the shared ribbon drawing flipped left to right. */
.pe-wave-divider--aqua-peach .pe-wave-divider__img,
.pe-wave-divider--yellow-aqua .pe-wave-divider__img,
.pe-wave-divider--yellow-aqua-band .pe-wave-divider__img {
	transform: scaleX(-1);
}

/*
 * The solid waves: paint the section's top half in the wave's top colour and its bottom
 * half in the bottom colour. On phones the wave is a fractional number of pixels tall
 * (31.14px at 390); if a browser anti-aliases the image edges, the edge rows then blend
 * into the neighbouring section's colour instead of showing a cream hairline.
 */
.pe-wave-divider.pe-wave-divider--peach-in {
	background: linear-gradient(var(--pe-cream) 50%, var(--pe-peach-light) 50%);
}

.pe-wave-divider.pe-wave-divider--peach-out,
.pe-wave-divider.pe-wave-divider--peach-drop {
	background: linear-gradient(var(--pe-peach-light) 50%, var(--pe-cream) 50%);
}

.pe-wave-divider.pe-wave-divider--aqua-cream {
	background: linear-gradient(var(--pe-aqua-light) 50%, var(--pe-cream) 50%);
}

.pe-wave-divider.pe-wave-divider--aqua-in {
	background: linear-gradient(var(--pe-aqua-light) 50%, var(--pe-aqua) 50%);
}

.pe-wave-divider.pe-wave-divider--aqua-out {
	background: linear-gradient(var(--pe-aqua) 50%, var(--pe-cream) 50%);
}

/* Parties 83:3301: the peach blob hangs into the cream. It is wave-peach-in.svg upside
   down (113px in Figma, 115 here). */
.pe-wave-divider--peach-drop .pe-wave-divider__img {
	transform: scaleY(-1);
}

/* ---------- Ribbons into an aqua band (Our Facilities 83:426) ---------- */

/* Figma has a straight cream / aqua edge under the ribbons, 168.5px down the 249px wave:
   the cream Cafe section ends there and the aqua sensory band starts. */
.pe-wave-divider.pe-wave-divider--yellow-aqua-band {
	background: var(--pe-cream);
}

/* The aqua part sits over the flower's lower petals (in Figma the aqua band covers them),
   and under the ribbons. */
.pe-wave-divider--yellow-aqua-band::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 32.33%; /* 80.5 of 249 */
	background: var(--pe-aqua);
}

.pe-wave-divider--yellow-aqua-band .pe-wave-divider__img {
	position: relative;
	z-index: 1;
}

/* 83:362: 245px flower at x 670, its top 17px above the wave, behind the yellow ribbon.
   Sizes are shares of the 1440 × 249 wave so it scales with it. It overhangs the
   section above; this divider comes later in the page, so it paints over it. */
.pe-wave-divider__flower {
	position: absolute;
	top: -6.83%; /* 17 of 249 */
	left: 46.53%; /* 670 of 1440 */
	width: 17.01%; /* 245 of 1440 */
}

/* ---------- The top of a big blob (Book a Visit 83:3307, 83:3309) ---------- */

/* The 1440 × 462 blob is drawn at the top of the box and the box only shows its wavy top
   (135.06px / 167.06px at 1440); the rest of the blob would sit behind the next section,
   which has the same colour, so it is cut off. The background shows above the wave. */
.pe-wave-divider--shape-aqua-light,
.pe-wave-divider--shape-aqua,
.pe-wave-divider--shape-aqua-cream {
	overflow: hidden;
}

.pe-wave-divider.pe-wave-divider--shape-aqua-light {
	aspect-ratio: 1440 / 135.06;
	background: var(--pe-cream);
}

.pe-wave-divider.pe-wave-divider--shape-aqua {
	aspect-ratio: 1440 / 167.06;
	background: var(--pe-aqua-light);
}

/* The same aqua blob, for when the section above is cream. */
.pe-wave-divider.pe-wave-divider--shape-aqua-cream {
	aspect-ratio: 1440 / 167.06;
	background: var(--pe-cream);
}
