/*
 * Section: background (the "jl-credentials" group).
 *
 * Small and plain: a label and a modest heading over hairline rows, each
 * with a label, a value and a year, set in the right two thirds of the page.
 * Every row is a Group holding three Paragraphs.
 *
 * Colours, fonts and edge spacing come from the theme. The fade-in only runs
 * once the script is running (html.jl-js).
 */

.jl-credentials.jl-credentials {
	--cr-pad: 48px;
	--cr-gap: 24px;
	--cr-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--cr-gap);
	margin-block: 0;
	padding: 24px var(--cr-pad) 120px;
	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-credentials.jl-credentials > *,
.jl-credentials .jl-credentials__list > *,
.jl-credentials .jl-credentials__row > * {
	margin-block: 0;
}

.jl-credentials.jl-credentials > * {
	grid-column: 2 / span 2;
}

.jl-credentials.jl-credentials > h2 {
	margin-top: 20px;
	margin-bottom: 44px;
	font-size: clamp(1.75rem, 2.3vw, 2.25rem);
	letter-spacing: -0.025em;
	line-height: 1.1;
}

.jl-credentials .jl-credentials__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
	gap: var(--cr-gap);
	align-items: baseline;
	padding: 16px 0 18px;
	border-top: 1px solid var(--jl-line);
	font-size: 1rem;
	line-height: 1.5;
}

.jl-credentials .jl-credentials__row > :first-child,
.jl-credentials .jl-credentials__row > .jl-tag {
	color: var(--wp--preset--color--accent-4);
}

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

.jl-js .jl-credentials > * {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.9s var(--cr-ease) var(--d, 0ms), transform 0.9s var(--cr-ease) var(--d, 0ms);
}

.jl-js .jl-credentials.is-in > * {
	opacity: 1;
	transform: none;
}

.jl-credentials > :nth-child(2) {
	--d: 100ms;
}

.jl-credentials > :nth-child(n + 3) {
	--d: 200ms;
}

/* ---------- Tablet: across the full width ---------- */
@media (max-width: 1099px) {
	.jl-credentials.jl-credentials {
		--cr-pad: 40px;
		--cr-gap: 20px;
		grid-template-columns: minmax(0, 1fr);
	}

	.jl-credentials.jl-credentials > * {
		grid-column: auto;
	}
}

/* ---------- Mobile: label and year on one line, the value under them ---------- */
@media (max-width: 699px) {
	.jl-credentials.jl-credentials {
		--cr-pad: 24px;
		--cr-gap: 12px;
		padding-bottom: 88px;
	}

	.jl-credentials .jl-credentials__row {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 4px 12px;
	}

	.jl-credentials .jl-credentials__row > :nth-child(2) {
		order: 3;
		grid-column: 1 / -1;
	}

	.jl-credentials .jl-credentials__row > :nth-child(3) {
		order: 2;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.jl-js .jl-credentials > * {
		opacity: 1;
		transform: none;
		transition: none !important;
	}
}
