/*
 * Section: not sure where to start (the "jl-callout" group).
 *
 * A short pause on the sage tint (the services section's ground on the home
 * page): on the left a small label and a heading, on the right a sentence set
 * large in Fraunces and an arrow link. Use it at most once on a page.
 *
 * The tint eases in from the page colour at the top and back out at the
 * bottom with a curved gradient, so the section meets its neighbours without
 * an edge. Colours, fonts and edge spacing come from the theme. The reveal
 * only runs once the script is running (html.jl-js).
 */

.jl-callout.jl-callout {
	--co-pad: 48px;
	--co-gap: 24px;
	--co-fade: 260px;
	--co-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--co-bg: color-mix(in srgb, var(--wp--preset--color--accent-1) 26%, var(--wp--preset--color--base));
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 28px var(--co-gap);
	align-items: start;
	margin-block: 0;
	padding: 220px var(--co-pad) 240px;
	background: linear-gradient(
		to bottom,
		var(--wp--preset--color--base) 0,
		color-mix(in srgb, var(--co-bg) 10%, var(--wp--preset--color--base)) calc(var(--co-fade) * 0.18),
		color-mix(in srgb, var(--co-bg) 38%, var(--wp--preset--color--base)) calc(var(--co-fade) * 0.42),
		color-mix(in srgb, var(--co-bg) 74%, var(--wp--preset--color--base)) calc(var(--co-fade) * 0.68),
		color-mix(in srgb, var(--co-bg) 94%, var(--wp--preset--color--base)) calc(var(--co-fade) * 0.88),
		var(--co-bg) var(--co-fade),
		var(--co-bg) calc(100% - var(--co-fade)),
		color-mix(in srgb, var(--co-bg) 94%, var(--wp--preset--color--base)) calc(100% - var(--co-fade) * 0.88),
		color-mix(in srgb, var(--co-bg) 74%, var(--wp--preset--color--base)) calc(100% - var(--co-fade) * 0.68),
		color-mix(in srgb, var(--co-bg) 38%, var(--wp--preset--color--base)) calc(100% - var(--co-fade) * 0.42),
		color-mix(in srgb, var(--co-bg) 10%, var(--wp--preset--color--base)) calc(100% - var(--co-fade) * 0.18),
		var(--wp--preset--color--base) 100%
	);
	color: var(--wp--preset--color--contrast);
}

/* WordPress spaces out a Group's children; every part here sets its own spacing. */
.jl-callout.jl-callout > *,
.jl-callout .jl-callout__head > *,
.jl-callout .jl-callout__body > * {
	margin-block: 0;
}

.jl-callout .jl-callout__head h2 {
	max-width: 560px;
	margin-top: 28px;
	font-size: clamp(2.5rem, 4.6vw, 4.25rem);
	letter-spacing: -0.03em;
	line-height: 1;
	text-wrap: balance;
}

.jl-callout .jl-callout__body {
	padding-top: 44px;
}

.jl-callout .jl-callout__statement {
	max-width: 620px;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(1.75rem, 2.4vw, 2.25rem);
	letter-spacing: -0.015em;
	line-height: 1.12;
}

.jl-callout .jl-callout__body .jl-arrow {
	margin-top: 44px;
	font-size: 1rem;
	line-height: 1.4;
}

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

.jl-js .jl-callout .jl-callout__head h2:not(.is-split):not(.is-done) {
	opacity: 0;
}

.jl-callout .jl-callout__head h2 .jl-word {
	display: inline-block;
	opacity: 0;
	transform: translateY(0.45em);
	transition: opacity 0.9s ease var(--d, 0ms), transform 1s var(--co-ease) var(--d, 0ms);
}

.jl-callout .jl-callout__head h2.is-in .jl-word {
	opacity: 1;
	transform: none;
}

.jl-js .jl-callout .jl-callout__head > .jl-tag,
.jl-js .jl-callout .jl-callout__body > * {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.9s var(--co-ease) var(--d, 0ms), transform 0.9s var(--co-ease) var(--d, 0ms);
}

.jl-js .jl-callout.is-in .jl-callout__head > .jl-tag,
.jl-js .jl-callout.is-in .jl-callout__body > * {
	opacity: 1;
	transform: none;
}

.jl-callout .jl-callout__body > :nth-child(1) {
	--d: 200ms;
}

.jl-callout .jl-callout__body > :nth-child(n + 2) {
	--d: 300ms;
}

/* ---------- Tablet: the heading above the sentence ---------- */
@media (max-width: 1099px) {
	.jl-callout.jl-callout {
		--co-pad: 40px;
		--co-gap: 20px;
		--co-fade: 200px;
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		padding-top: 160px;
		padding-bottom: 180px;
	}

	.jl-callout .jl-callout__head h2 {
		margin-top: 24px;
	}

	.jl-callout .jl-callout__body {
		padding-top: 0;
	}

	.jl-callout .jl-callout__statement {
		font-size: 1.875rem;
	}

	.jl-callout .jl-callout__body .jl-arrow {
		margin-top: 32px;
	}
}

@media (max-width: 699px) {
	.jl-callout.jl-callout {
		--co-pad: 24px;
		--co-gap: 12px;
		--co-fade: 140px;
		gap: 28px;
		padding-top: 108px;
		padding-bottom: 120px;
	}

	.jl-callout .jl-callout__head h2 {
		margin-top: 20px;
	}

	.jl-callout .jl-callout__statement {
		font-size: 1.5rem;
	}

	.jl-callout .jl-callout__body .jl-arrow {
		margin-top: 24px;
	}
}

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

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

	.jl-callout.jl-callout * {
		transition: none !important;
	}
}
