/*
 * Section: finding us (the "jl-find" group).
 *
 * A small label and heading, then a wide square-cornered photo of the studio
 * with the address beside it: a small heading, the address, an arrow link to
 * a map, and "Getting there" (a Details block) under a hairline. On tablets
 * the photo takes the full width and the address and directions sit side by
 * side under it; on phones the photo reaches both screen edges and "Getting
 * there" folds into a "+" row (assets/js/find.js keeps it open on wider
 * screens).
 *
 * Colours, fonts and edge spacing come from the theme. The reveal only runs
 * once the script is running (html.jl-js).
 */

.jl-find.jl-find {
	--fd-pad: 48px;
	--fd-gap: 24px;
	--fd-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	margin-block: 0;
	padding: clamp(96px, 14vh, 150px) var(--fd-pad) 72px;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	scroll-margin-top: var(--jl-header-h);
}

/* WordPress spaces out a Group's children; every part here sets its own spacing. */
.jl-find.jl-find > *,
.jl-find .jl-find__body > *,
.jl-find .jl-find__aside > *,
.jl-find .jl-find__address > *,
.jl-find .jl-find__getting > * {
	margin-block: 0;
}

.jl-find.jl-find > h2 {
	margin-top: 22px;
	font-size: clamp(2.5rem, 4.6vw, 4.25rem);
	letter-spacing: -0.03em;
	line-height: 1;
	text-wrap: balance;
}

.jl-find .jl-find__body {
	display: grid;
	grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
	gap: 48px var(--fd-gap);
	align-items: end;
	margin-top: 88px;
}

/* ---------- Photo ---------- */

.jl-find .jl-find__photo {
	min-width: 0;
	margin: 0;
	overflow: hidden;
	background: color-mix(in srgb, var(--wp--preset--color--accent-1) 30%, var(--wp--preset--color--accent-5));
}

.jl-find .jl-find__photo img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* While editing, WordPress wraps the image in a box that would otherwise shrink to the image's own size. */
.jl-find .jl-find__photo > div {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-width: none !important;
}

/* ---------- Address and getting there ---------- */

.jl-find .jl-find__aside {
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-width: 0;
	max-width: 420px;
	padding-left: 24px;
}

.jl-find .jl-find__address h3 {
	font-size: clamp(1.5rem, 2.2vw, 2rem);
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.jl-find .jl-find__address > p:not(.jl-arrow) {
	margin-top: 14px;
	font-size: 1.0625rem;
	line-height: 1.6;
}

.jl-find .jl-find__address .jl-arrow {
	margin-top: 24px;
	font-size: 1.0625rem;
	line-height: 1.4;
}

.jl-find .jl-find__getting {
	padding-top: 24px;
	border-top: 1px solid var(--jl-line);
	color: var(--wp--preset--color--accent-4);
}

/* On wider screens "Getting there" is a small label, always open. */
.jl-find .jl-find__getting summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--wp--preset--color--accent-4);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
	list-style: none;
	pointer-events: none;
}

.jl-find .jl-find__getting summary::-webkit-details-marker {
	display: none;
}

.jl-find .jl-find__getting > :not(summary) {
	margin-top: 14px;
	font-size: 1rem;
	line-height: 1.6;
}

.jl-find .jl-find__getting > :not(summary) + :not(summary) {
	margin-top: 14px;
}

/* ---------- Motion (front only, once the script is running) ---------- */

.jl-js .jl-find > .jl-tag,
.jl-js .jl-find > h2,
.jl-js .jl-find .jl-find__photo,
.jl-js .jl-find .jl-find__aside {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.9s var(--fd-ease) var(--d, 0ms), transform 0.9s var(--fd-ease) var(--d, 0ms);
}

.jl-js .jl-find > .is-in,
.jl-js .jl-find .jl-find__body > .is-in {
	opacity: 1;
	transform: none;
}

/* ---------- Tablet: the photo across, address and directions side by side ---------- */
@media (max-width: 1099px) {
	.jl-find.jl-find {
		--fd-pad: 40px;
		--fd-gap: 20px;
	}

	.jl-find .jl-find__body {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px var(--fd-gap);
		margin-top: 64px;
	}

	.jl-find .jl-find__photo img {
		aspect-ratio: 16 / 10;
	}

	.jl-find .jl-find__aside {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
		max-width: none;
		padding-left: 0;
	}

	.jl-find .jl-find__address .jl-arrow {
		margin-top: 20px;
	}

	.jl-find .jl-find__getting {
		padding-top: 0;
		border-top: 0;
	}
}

/* ---------- Mobile: the photo edge to edge, "Getting there" folds away ---------- */
@media (max-width: 699px) {
	.jl-find.jl-find {
		--fd-pad: 24px;
		--fd-gap: 12px;
		padding-top: 88px;
		padding-bottom: 40px;
	}

	.jl-find.jl-find > h2 {
		margin-top: 18px;
	}

	.jl-find .jl-find__body {
		gap: 28px;
		margin-top: 40px;
	}

	.jl-find .jl-find__photo {
		margin: 0 calc(-1 * var(--fd-pad));
	}

	.jl-find .jl-find__photo img {
		aspect-ratio: 4 / 5;
	}

	.jl-find .jl-find__aside {
		display: flex;
		gap: 24px;
	}

	.jl-find .jl-find__getting {
		border-top: 1px solid var(--jl-line);
		border-bottom: 1px solid var(--jl-line);
	}

	.jl-find .jl-find__getting summary {
		min-height: 52px;
		color: var(--wp--preset--color--contrast);
		font-size: 1rem;
		font-weight: 400;
		letter-spacing: 0;
		text-transform: none;
		cursor: pointer;
		pointer-events: auto;
	}

	/* A thin "+" that turns into a cross when open. */
	.jl-find .jl-find__getting summary::after {
		content: "";
		flex: none;
		width: 20px;
		height: 20px;
		background:
			linear-gradient(currentColor, currentColor) center / 14px 1.2px no-repeat,
			linear-gradient(currentColor, currentColor) center / 1.2px 14px no-repeat;
		transition: transform 0.3s var(--fd-ease);
	}

	.jl-find .jl-find__getting[open] summary::after {
		transform: rotate(45deg);
	}

	.jl-find .jl-find__getting > :not(summary) {
		margin-top: 4px;
	}

	.jl-find .jl-find__getting > :last-child {
		padding-bottom: 20px;
	}
}

/* Set by the script if it could not prepare the section: everything shows at rest. */
.jl-find.is-plain > *,
.jl-find.is-plain .jl-find__body > * {
	opacity: 1 !important;
	transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.jl-js .jl-find > .jl-tag,
	.jl-js .jl-find > h2,
	.jl-js .jl-find .jl-find__photo,
	.jl-js .jl-find .jl-find__aside {
		opacity: 1;
		transform: none;
	}

	.jl-find.jl-find *,
	.jl-find.jl-find *::after {
		transition: none !important;
	}
}
