/* Where to find us (sections/location.php).
   --text  (no contact card, Home 83:234): text left, bordered map right; 496px tall at 1440.
   --card  (contact card, Find us 83:663): heading, map left, contact card right.
   --wave  (Background: Peach / Light peach, the old Home 64:184): light peach, with the
           wavy peach shape rising 110px over the section above. */

/* ---------- Peach wave ---------- */

/* The SVG is light peach, so the section is too, whichever peach was picked. */
.pe-location.pe-location--wave {
	background: var(--pe-peach-light);
}

/* 1440×462 at 1440, its top 110.5px above the section (23.92% of its height). Painted
   after the section above, so its wavy top edge covers that section's bottom. */
.pe-location__wave {
	position: absolute;
	top: 0;
	left: 0;
	transform: translateY(-23.92%);
}

.pe-location .pe-container {
	position: relative; /* above the wave */
}

/* ---------- Layout ---------- */

.pe-location__grid {
	display: grid;
	align-items: center;
}

/* Home: 624px for the text column, a 45px gap, then the map in the remaining 601px plus
   43px of the right gutter (the map is 644px wide and ends 42px from the frame's edge).
   The map is 77px from the top and 78px from the bottom of the 496px section. The text
   starts 43px below the map's top and may run down to 40.5px from the bottom (the
   address and hours take four lines), so the bottom padding is 40.5px and the map
   adds the other 37.5px under itself. */
.pe-location--text {
	padding-block: clamp(3rem, 5.35vw, 4.8125rem) clamp(1.5rem, 2.81vw, 2.531rem); /* 77px / 40.5px */
}

.pe-location--text .pe-location__grid {
	grid-template-columns: minmax(0, 624fr) minmax(0, 601fr);
	align-items: start;
	column-gap: clamp(1.5rem, 3.125vw, 2.8125rem); /* 45px */
}

.pe-location--text .pe-location__text {
	padding-top: clamp(1rem, 2.99vw, 2.6875rem); /* 43px */
}

.pe-location--text .pe-location__map {
	margin-right: calc(var(--pe-gutter) * -0.506);
	margin-bottom: clamp(1.5rem, 2.6vw, 2.344rem); /* 37.5px */
	aspect-ratio: 644 / 341;
	border: 2px solid var(--pe-ink);
}

/* Find us 83:663 (757px): 48px above the heading, 104px under the panel; map 730, gap 40,
   card 500, both 498px tall. */
.pe-location--card {
	padding-block: clamp(2rem, 3.33vw, 3rem) clamp(3rem, 7.22vw, 6.5rem);
}

.pe-location--card .pe-location__heading {
	margin: 0 0 2.5rem;
}

.pe-location--card .pe-location__grid {
	grid-template-columns: minmax(0, 730fr) minmax(0, 500fr);
	align-items: stretch;
	gap: 2.5rem;
}

/* The map fills its column; when a longer card makes the row taller, the map grows
   taller (the photo is cropped) instead of aspect-ratio widening it into the card. */
.pe-location--card .pe-location__map {
	order: -1;
	width: 100%;
	min-width: 0;
	aspect-ratio: 730 / 498;
}

/* ---------- Text column (Home) ---------- */

/* 599px, but the address box is 550px wide after its 74.45px indent (624px). */
.pe-location__text {
	max-width: 39.03rem;
}

/* 56.3px / 64.7px. */
.pe-location--text .pe-location__heading {
	margin: 0 0 2.043rem;
	font-size: clamp(2.125rem, 3.91vw, 3.518rem);
	line-height: 1.15;
}

/* 45×47 pin, 29px gap, Nunito 700 36.3px / 43.6px. */
.pe-location__place {
	display: flex;
	align-items: flex-start;
	gap: 1.816rem;
	margin: 0 0 2.043rem;
	font-size: clamp(1.5rem, 2.522vw, 2.27rem);
	font-weight: 700;
	line-height: 1.2;
}

.pe-location__place-pin {
	flex-shrink: 0;
	width: 1.25em;
}

/* 27.2px / 39.5px, lined up with the place name (74.45px in). */
.pe-location__address {
	margin: 0;
	padding-left: calc(1.25 * clamp(1.5rem, 2.522vw, 2.27rem) + 1.816rem);
	font-size: var(--pe-text-intro);
	line-height: 1.45;
}

/* ---------- Map ---------- */

.pe-location__map {
	position: relative;
	display: block;
	overflow: hidden;
	--pe-map-ratio: 1.4; /* the photo's width / height; the template sets the real one */
	/* How wide the photo is drawn (object-fit: cover). Used by the marker, inside. */
	--pe-map-img-w: max(100cqw, 100cqh * var(--pe-map-ratio));

	container-type: size; /* cqw / cqh below = the map's width / height */
	border-radius: var(--pe-radius-card-lg); /* 50px */
	background: var(--pe-aqua);
	color: var(--pe-ink);
	text-decoration: none;
}

a.pe-location__map {
	transition: box-shadow 0.15s ease;
}

a.pe-location__map:hover {
	box-shadow: 0 6px 14px rgb(32 61 54 / 0.18);
}

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

/* The pin and its label, as one group. Sizes are fractions of the map width (cqw).
   The tip of the pin sits on a point of the photo, not of the box: --pe-map-x/y say
   where (fractions of the photo), and --pe-map-ratio (the photo's width / height, set
   inline by the template) lets us follow object-fit: cover as the box changes shape,
   so the pin stays on the place (and over the pin printed on the placeholder map).
   The pin grows with the photo too, so it always covers that printed pin. */
.pe-location__marker {
	--pe-map-tip-x: calc(50cqw + (var(--pe-map-x) - 0.5) * var(--pe-map-img-w));
	--pe-map-tip-y: calc(50cqh + (var(--pe-map-y) - 0.5) * var(--pe-map-img-w) / var(--pe-map-ratio));
	--pe-map-left: calc(var(--pe-map-tip-x) - var(--pe-map-pin) / 2);

	position: absolute;
	top: calc(var(--pe-map-tip-y) - var(--pe-map-pin) * 1.3797); /* pin is 49×67 */
	left: var(--pe-map-left);
	display: flex;
	align-items: flex-start;
}

.pe-location__marker-pin {
	flex-shrink: 0;
	width: var(--pe-map-pin);
	height: auto;
}

/* Home: 49×67 pin at 298/115 on the 644×341 map (its tip at 50.05% / 52.5% of the
   1028×776 photo); the pill 31px to its right, 15px lower. Inside the 2px border the
   map is 640px wide, so 1cqw = 6.4px at 1440. */
.pe-location--text .pe-location__map {
	--pe-map-x: 0.5005;
	--pe-map-y: 0.525;
	--pe-map-pin: calc(var(--pe-map-img-w) * 0.0761);
}

.pe-location--text .pe-location__marker {
	gap: 4.89cqw;
}

/* 205px wide pill, cream at 85%, Nunito 14px / 21.8px. */
.pe-location__label {
	width: clamp(8.5rem, 32.06cqw, 12.825rem);
	margin-top: 2.34cqw;
	padding: clamp(0.5rem, 2.84cqw, 1.135rem) clamp(0.5rem, 3.45cqw, 1.381rem);
	border-radius: var(--pe-radius-pill);
	background: var(--pe-cream);
	box-shadow: 0 6px 39.2px rgb(32 61 54 / 0.5);
	opacity: 0.85;
	font-size: clamp(0.6875rem, 2.1875cqw, 0.875rem);
	line-height: 1.5565;
	text-align: center;
}

/* Phones: the map is small, so the pill gets less side padding and is a little
   narrower. "620–658 Terrigal Drive" then still fits on one line, and the pill stays
   inside the map at 360px. */
@media (max-width: 767px) {
	.pe-location__label {
		width: 8.25rem;
		padding-inline: 0.4375rem;
	}
}

/* Find us: 41×57 pin, its tip at 49.96% / 57.7% of the 1028×696 photo, so it covers the
   red pin printed on the photo. (Figma 83:666 kept the pin at 344/203 when the map grew
   to 498px tall, which puts it about 27px higher; we keep it on the printed pin.) The
   name (Fredoka 36px / 43px) starts 13.6px to its right, 7px lower. */
.pe-location--card .pe-location__map {
	--pe-map-x: 0.4996;
	--pe-map-y: 0.577;
	--pe-map-pin: max(1.375rem, var(--pe-map-img-w) * 0.0567);
}

.pe-location--card .pe-location__marker {
	max-width: calc(100cqw - var(--pe-map-left) - 3cqw);
	gap: 1.86cqw;
}

.pe-location__marker-text {
	display: flex;
	flex-direction: column;
	margin-top: 0.96cqw;
}

.pe-location__marker-name {
	font-family: var(--pe-font-display);
	font-size: clamp(1rem, 4.93cqw, 2.25rem);
	font-weight: 600;
	line-height: 1.194;
	white-space: nowrap;
}

/* The short address: two centred lines of 14px / 33px in a 260px box that starts 15px
   right of the name. Figma's 33px line box starts 8px up into the name's. */
.pe-location__marker-address {
	width: 35.62cqw;
	margin-top: -1.1cqw;
	margin-left: 2.05cqw;
	font-size: clamp(0.6875rem, 1.92cqw, 0.875rem);
	line-height: 2.357;
	text-align: center;
}

.pe-location__marker-line {
	display: block;
	text-wrap: balance;
}

/* A smaller map (1024px screens, phones): the lines may wrap, so the address uses all the
   room right of the pin, with ordinary line spacing. */
@container (max-width: 40rem) {
	.pe-location__marker-address {
		width: auto;
		margin: 0.25rem 0 0;
		line-height: 1.4;
	}
}

/* ---------- Contact card (Find us) ---------- */

/* 500px wide, 1px sage border, radius 24, 32px padding. */
.pe-location__card {
	padding: 2rem;
	border: 1px solid var(--pe-sage);
	border-radius: var(--pe-radius-card);
	background: var(--pe-cream);
}

/* Fredoka 34.5px / 41.4px, 22px above the first row. */
.pe-location__card-title {
	margin: 0 0 1.375rem;
	font-size: var(--pe-text-h3);
	line-height: 1.2;
}

.pe-location__details {
	display: grid;
	gap: 1.375rem;
	margin: 0;
}

/* Label Nunito 700 21px / 29px, 6px gap, value 18px / 27px. */
.pe-location__details dt {
	margin: 0 0 0.375rem;
	font-size: clamp(1.125rem, 1.46vw, 1.3125rem);
	font-weight: 700;
	line-height: 1.38;
}

.pe-location__details dd {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.pe-location__details a {
	text-decoration: none;
}

.pe-location__details a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* ---------- Under 1024: one column, text (or card) then the map ---------- */

@media (max-width: 1023px) {
	.pe-location--text .pe-location__grid,
	.pe-location--card .pe-location__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
	}

	.pe-location--text {
		padding-bottom: 3rem;
	}

	.pe-location__text {
		max-width: none;
	}

	.pe-location--text .pe-location__text {
		padding-top: 0;
	}

	.pe-location--text .pe-location__map {
		margin-right: 0;
		margin-bottom: 0;
	}

	.pe-location--card .pe-location__map {
		order: 0;
	}

	.pe-location__map {
		border-radius: var(--pe-radius-card); /* 24px */
	}
}

@media (max-width: 767px) {
	.pe-location--card .pe-location__heading {
		margin-bottom: 1.5rem;
	}

	.pe-location__card {
		padding: 1.5rem;
	}

	.pe-location__details dd {
		text-wrap: pretty; /* no lone "2250" when the address wraps */
	}

	.pe-location__place {
		gap: 1rem;
	}

	.pe-location__address {
		padding-left: calc(1.25 * clamp(1.5rem, 2.522vw, 2.27rem) + 1rem);
		text-wrap: pretty; /* no lone "2250" when the address wraps */
	}
}
