/*
 * Section: intro with two images (the "jl-about" group).
 *
 * Built from ordinary blocks, so the same rules lay it out in the editor and
 * on the front. Colours, fonts and edge spacing come from the theme. The
 * reveal animation and parallax only start once the script is running
 * (html.jl-js), so the editor and visitors without JavaScript see it at rest.
 */

.jl-about.jl-about {
	--jl-about-pad: 48px;
	--jl-about-gap: 24px;
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-wipe: cubic-bezier(0.77, 0, 0.18, 1);
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 100vh;
	min-height: 100svh;
	margin-block: 0;
	overflow: hidden;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Blocks inside carry WordPress's default spacing; the grid sets its own. */
.jl-about.jl-about > *,
.jl-about .jl-about__content > *,
.jl-about .jl-about__top > *,
.jl-about .jl-about__text > *,
.jl-about .jl-about__rows > *,
.jl-about .jl-row > * {
	margin-block: 0;
}

/* Images */
.jl-about .jl-about__big,
.jl-about .jl-about__thumb {
	position: relative;
	margin: 0;
	overflow: hidden;
}

.jl-about .jl-about__big {
	order: 2;
	min-height: 320px;
	background: var(--wp--preset--color--accent-2);
}

.jl-about .jl-about__thumb {
	aspect-ratio: 461 / 609;
	background: var(--wp--preset--color--accent-5);
}

.jl-about .jl-about__big img,
.jl-about .jl-about__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* Content */
.jl-about .jl-about__content {
	order: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	padding: clamp(72px, 10vh, 112px) var(--jl-about-gap) var(--wp--preset--spacing--40) var(--jl-about-pad);
}

.jl-about .jl-about__top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: var(--jl-about-gap);
	align-items: start;
	margin-bottom: clamp(48px, 10vh, 140px);
}

.jl-about .jl-about__text {
	min-width: 0;
}

.jl-about .jl-about__title {
	font-size: clamp(1.625rem, 2.1vw, 2.75rem);
	line-height: 1.1;
	text-indent: 4.5vw;
}

.jl-about .jl-about__lead {
	margin-top: 1.25rem;
	color: var(--wp--preset--color--accent-4);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
	text-wrap: pretty;
}

.jl-about .jl-about__link {
	margin-top: 2.25rem;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1;
}

.jl-about .jl-about__link a {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	color: inherit;
	text-decoration: none;
	transition: color 0.4s var(--ease-out);
}

.jl-about .jl-about__link a::after {
	content: "";
	flex: none;
	width: 1.15em;
	height: 0.8em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 7h17M12 1l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 7h17M12 1l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.5s var(--ease-out);
}

.jl-about .jl-about__link a:hover {
	color: var(--wp--preset--color--accent-3);
}

.jl-about .jl-about__link a:hover::after {
	transform: translateX(6px);
}

/* Rows: a label and its value, separated by hairlines */
.jl-about .jl-row {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px var(--jl-about-gap);
	padding: 0.9rem 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
}

.jl-about .jl-row::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 1px;
	background: var(--jl-line);
}

.jl-about .jl-row > :first-child {
	color: var(--wp--preset--color--accent-4);
}

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

.jl-js .jl-about .jl-about__big {
	clip-path: inset(0 0 0 100%);
	transition: clip-path 1.7s var(--ease-wipe);
}

.jl-js .jl-about .jl-about__big img {
	position: absolute;
	top: -7%;
	left: 0;
	height: 114%;
	transform: scale(1.2);
	transition: transform 2.2s var(--ease-out);
}

.jl-js .jl-about .jl-about__thumb {
	clip-path: inset(100% 0 0 0);
	transition: clip-path 1.5s var(--ease-wipe) 0.1s;
}

.jl-js .jl-about .jl-about__thumb img {
	position: absolute;
	top: -6%;
	left: 0;
	height: 112%;
	transform: scale(1.25);
	transition: transform 1.9s var(--ease-out) 0.1s;
}

.jl-js .jl-about.is-in .jl-about__big,
.jl-js .jl-about.is-in .jl-about__thumb {
	clip-path: inset(0 0 0 0);
}

.jl-js .jl-about.is-in .jl-about__big img {
	transform: scale(1.04);
}

.jl-js .jl-about.is-in .jl-about__thumb img {
	transform: scale(1);
}

.jl-about .jl-about__title .w {
	display: inline-block;
	margin-bottom: -0.12em;
	padding-bottom: 0.12em;
	overflow: hidden;
	text-indent: 0;
	vertical-align: top;
}

.jl-about .jl-about__title .w > span {
	display: inline-block;
	transform: translateY(115%);
	transition: transform 1.1s var(--ease-out);
	transition-delay: calc(0.35s + var(--n) * 0.05s);
}

.jl-about.is-in .jl-about__title .w > span {
	transform: none;
}

.jl-js .jl-about .jl-about__lead,
.jl-js .jl-about .jl-about__link,
.jl-js .jl-about .jl-row > * {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 1.2s ease, transform 1.2s var(--ease-out);
}

.jl-js .jl-about .jl-about__lead {
	transition-delay: 0.85s;
}

.jl-js .jl-about .jl-about__link {
	transition-delay: 1.05s;
}

.jl-js .jl-about.is-in .jl-about__lead,
.jl-js .jl-about.is-in .jl-about__link,
.jl-js .jl-about.is-in .jl-row > * {
	opacity: 1;
	transform: none;
}

.jl-js .jl-about .jl-row::before {
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 1.4s var(--ease-wipe);
	transition-delay: calc(0.6s + var(--i, 0) * 0.18s);
}

.jl-js .jl-about.is-in .jl-row::before {
	transform: scaleX(1);
}

.jl-js .jl-about .jl-row > * {
	transition-delay: calc(0.9s + var(--i, 0) * 0.18s);
}

.jl-about .jl-row:nth-child(2) { --i: 1; }
.jl-about .jl-row:nth-child(3) { --i: 2; }
.jl-about .jl-row:nth-child(4) { --i: 3; }
.jl-about .jl-row:nth-child(n + 5) { --i: 4; }

/* ---------- Tablet ---------- */
@media (max-width: 1099px) {
	.jl-about.jl-about {
		--jl-about-pad: 40px;
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.jl-about .jl-about__big {
		order: 1;
		aspect-ratio: 16 / 10;
	}

	.jl-js .jl-about .jl-about__big {
		clip-path: inset(0 0 100% 0);
	}

	.jl-about .jl-about__content {
		order: 2;
		padding: 56px var(--jl-about-pad) 64px;
	}

	.jl-about .jl-about__top {
		grid-template-columns: 1fr 1.15fr;
		margin-bottom: 56px;
	}

	.jl-about .jl-about__thumb {
		aspect-ratio: 4 / 5;
	}

	.jl-about .jl-about__title {
		font-size: 1.875rem;
		text-indent: 3vw;
	}

	.jl-about .jl-row {
		padding: 1.25rem 0;
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 699px) {
	.jl-about.jl-about {
		--jl-about-pad: 24px;
	}

	.jl-about .jl-about__big {
		aspect-ratio: 4 / 5;
	}

	.jl-about .jl-about__content {
		padding: 40px var(--jl-about-pad) 48px;
	}

	.jl-about .jl-about__top {
		grid-template-columns: 1fr;
		margin-bottom: 32px;
	}

	/* The small image and any row marked "jl-row--hide-sm" are left out on phones. */
	.jl-about .jl-about__thumb,
	.jl-about .jl-row--hide-sm {
		display: none;
	}

	.jl-about .jl-about__title {
		font-size: 2rem;
		text-indent: 0;
	}

	.jl-about .jl-row {
		grid-template-columns: 1fr;
		padding: 1.1rem 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jl-about.jl-about * {
		transition: none !important;
	}

	.jl-js .jl-about .jl-about__big,
	.jl-js .jl-about .jl-about__thumb {
		clip-path: none;
	}

	.jl-js .jl-about .jl-about__title .w > span,
	.jl-js .jl-about .jl-about__lead,
	.jl-js .jl-about .jl-about__link,
	.jl-js .jl-about .jl-row > * {
		opacity: 1;
		transform: none;
	}

	.jl-js .jl-about .jl-row::before {
		transform: none;
	}
}
