/* Case studies page: every case as a cell in a two-per-row ledger.
   Copy leads, the photo is a small plate beside it, and the four
   figures run as one strip along the bottom of the cell. Brand marks
   are the shared .wtc-case__mark--… masks from style.css. */
.wtc-caseledger {
	--wtc-slate-deep: #46586a;
	--wtc-rule: #e5e1d6;
	padding: clamp(1rem, 3vh, 2rem) 0 clamp(3rem, 8vh, 5rem);
}

.wtc-caseledger__inner {
	max-width: var(--wp--style--global--wide-size, 1340px);
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left, 2rem) var(--wp--style--root--padding-right, 2rem);
}

.wtc-caseledger__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	border-bottom: 1px solid var(--wtc-rule);
}

.wtc-caseledger__cell {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1.75rem;
	min-width: 0;
	padding-block: clamp(1.75rem, 4vh, 2.5rem);
	border-top: 1px solid var(--wtc-rule);
	/* Anchored links land below the sticky header. */
	scroll-margin-top: 5rem;
}

.wtc-caseledger__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
	gap: clamp(1.25rem, 2.4vw, 2rem);
	align-items: start;
}

.wtc-caseledger__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.9rem;
	min-width: 0;
}

/* Marks of very different heights share one 52px line, so the
   headlines of a row start level. */
.wtc-caseledger__brand {
	display: flex;
	align-items: flex-end;
	height: 52px;
	max-width: 100%;
}

.wtc-caseledger__brand .wtc-case__mark {
	max-width: 100%;
	margin-top: 0;
}

.wtc-caseledger__copy h2,
.wtc-caseledger__copy h3 {
	margin: 0;
	font-size: clamp(1.375rem, 2vw, 1.625rem);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.wtc-caseledger__copy p {
	margin: 0;
	color: var(--wp--preset--color--accent-4);
	font-size: 1rem;
	line-height: 1.55;
}

.wtc-caseledger__frame {
	overflow: hidden;
	margin: 0;
	aspect-ratio: 4 / 5;
	border-radius: 16px;
	background: var(--wp--preset--color--accent-5);
}

.wtc-caseledger__frame img,
.wtc-caseledger__frame video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wtc-caseledger__figures {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wtc-caseledger__figures > * {
	padding-top: 0.85rem;
	border-top: 1px solid var(--wtc-rule);
}

.wtc-caseledger__figures dt,
.wtc-caseledger__figures--scope li {
	font-family: var(--wp--preset--font-family--geist-mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wtc-slate-deep);
}

.wtc-caseledger__figures dt {
	margin-bottom: 0.3rem;
	font-size: 10.5px;
	line-height: 1.45;
}

.wtc-caseledger__figures dd {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.wtc-caseledger__figures--scope li {
	font-size: 11px;
	line-height: 1.5;
}

@media (min-width: 900px) {
	.wtc-caseledger__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wtc-caseledger__cell:nth-child(odd) {
		padding-right: clamp(1.5rem, 2.6vw, 2.5rem);
		border-right: 1px solid var(--wtc-rule);
	}

	.wtc-caseledger__cell:nth-child(even) {
		padding-left: clamp(1.5rem, 2.6vw, 2.5rem);
	}
}

/* Phones: the figures fold to two by two, and the photo moves above
   the copy at full width, where a quarter-width plate would be a stamp. */
@media (max-width: 560px) {
	.wtc-caseledger__top {
		grid-template-columns: minmax(0, 1fr);
	}

	.wtc-caseledger__frame {
		order: -1;
		aspect-ratio: 3 / 2;
	}

	/* One case per row: no neighbour to level with. */
	.wtc-caseledger__brand {
		height: auto;
	}

	.wtc-caseledger__figures {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 0.9rem;
	}
}

/* ---- Reveal: each cell comes up as it enters, figures a beat later. -- */

.wtc-js .wtc-caseledger__cell > * {
	opacity: 0;
	translate: 0 14px;
}

.wtc-caseledger__cell.is-live > * {
	opacity: 1;
	translate: none;
	transition: opacity 0.75s ease, translate 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.wtc-caseledger__cell.is-live > .wtc-caseledger__figures {
	transition-delay: 0.14s;
}

@media (min-width: 900px) {
	.wtc-caseledger__cell.is-live:nth-child(even) > * {
		transition-delay: 0.1s;
	}

	.wtc-caseledger__cell.is-live:nth-child(even) > .wtc-caseledger__figures {
		transition-delay: 0.24s;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wtc-js .wtc-caseledger__cell > * {
		opacity: 1;
		translate: none;
		transition: none;
	}
}

/* Home page: eight cases under a section heading, with a link to the
   full page. The cells are the same; their headlines are h3 here. */
.wtc-caseledger--home {
	padding-top: clamp(3.5rem, 9vh, 6rem);
	scroll-margin-top: 5rem;
}

.wtc-caseledger__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	margin-bottom: 2.75rem;
}

.wtc-caseledger__head h2 {
	margin: 0;
}

.wtc-caseledger__more {
	display: flex;
	justify-content: center;
	margin-top: clamp(2rem, 5vh, 3rem);
}
