/*
 * --p is how far the opening has played, 0 to 1, set by the script as the page scrolls:
 * at 0 the title is large and the images are a narrow column on the right; at 1 the title
 * is small, the information column is pinned, and the images fill the right eight columns.
 */
.le-case {
	--p: 0;
	/* The title, and the details beside it, at this share of the usual H1 and eyebrow sizes. */
	--title-scale: 0.8;
	/* The title's size relative to its large size: 1 down to the small heading's, 51 / 145 of the usual H1. */
	--k: calc(1 - var(--p) * (1 - 0.3517 / var(--title-scale)));
	/* Height of the title at its large size. The script measures it; this is the two-line default. */
	--title-height: 13.375rem;
	/* The title with the space above and below it: the hero and this fill the first screen. The script measures it. */
	--title-bar: calc(var(--title-height) + 3rem);
	/* One page-grid column, and a run of four with their gaps, measured inside .le-case__body. */
	--col: calc((100% - 11 * var(--le-grid-gap)) / 12);
	--span-4: calc(var(--col) * 4 + var(--le-grid-gap) * 3);

	color: var(--le-black);
	background: var(--le-white);
	/* The layout changes as the page scrolls; the browser must not "correct" the scroll position for it. */
	overflow-anchor: none;
}

/* On these pages the navbar lies over the hero image and scrolls away with it. */
body:has(.le-case) .elementor-location-header:has(.le-navbar) {
	position: absolute;
	inset: 0 0 auto;
}

body:has(.le-case) .le-navbar {
	background: none;
}

/* Hero --------------------------------------------------------------------- */

.le-case__hero {
	position: relative;
	/* The hero and the title bar under it fill the first screen, the title at its bottom left (always some
	   photo, however long the title). The admin bar, when it shows, takes its share of the screen. */
	height: max(10rem, 100svh - var(--title-bar) - var(--wp-admin--admin-bar--height, 0px));
	width: 100%;
	overflow: hidden;
	background: var(--le-black);
}

/* Intro: the photo first fills the screen, then gives way as the title bar slides up under it and the
   title's words slip up into view. The script adds .is-entering for the slide and .is-entered to start it. */
.le-js .le-case:not(.is-entered) .le-case__hero {
	height: calc(100svh - var(--wp-admin--admin-bar--height, 0px));
}

.le-case.is-entering .le-case__hero {
	transition: height 1.2s cubic-bezier(0.7, 0, 0.2, 1);
}

.le-js .le-case__title .le-w__i {
	transform: translateY(calc(100% + 0.5em));
	transition: transform 1s var(--le-ease-out);
	transition-delay: calc(0.55s + var(--i, 0) * 80ms);
}

/* Arriving by a page transition, the words start sooner, sliding up while the transition's cover is still clearing. */
.le-case.is-arriving .le-case__title .le-w__i {
	transition-delay: calc(var(--le-case-arriving-delay, 0.25s) + var(--i, 0) * 80ms);
}

.le-case.is-entered .le-case__title .le-w__i {
	transform: none;
}

/* Shown as it ends up, without the intro. */
.le-case.is-settled .le-case__title .le-w__i {
	transition: none;
}

.le-case__hero img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* A little shade behind the navbar, whatever the photo. */
.le-case__hero::after {
	position: absolute;
	inset: 0 0 auto;
	height: 9rem;
	background: linear-gradient(rgb(0 0 0 / 0.45), rgb(0 0 0 / 0));
	content: "";
}

/* Body: information column and story ------------------------------------------ */

.le-case__body {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding-inline: var(--le-gutter);
}

.le-case__info {
	position: sticky;
	top: 0;
	display: flex;
	flex: none;
	flex-direction: column;
	box-sizing: border-box;
	width: var(--span-4);
	height: 100svh;
	padding-block: 1.5rem;
}

/* The title is laid out once at its large size, eight columns wide, and scaled down; the box takes up the scaled height. */
.le-case__title-box {
	flex: none;
	width: calc(200% + var(--le-grid-gap));
	height: calc(var(--title-height) * var(--k));
}

.le-case__title {
	font-size: calc(var(--le-h1-size) * var(--title-scale));
	line-height: calc(var(--le-h1-leading) * var(--title-scale));
	transform: scale(var(--k));
	transform-origin: 0 0;
	will-change: transform;
}

.le-case__title-line {
	display: block;
}

.le-case__title-line--sub {
	color: var(--le-400);
}

/* Year, client, location: beside the large title, from the ninth column. Gone by the time the images arrive there. */
.le-case__meta {
	position: absolute;
	top: 1.5rem;
	left: calc(200% + var(--le-grid-gap) * 2);
	display: flex;
	gap: calc(1.8125rem * var(--title-scale));
	margin: 0;
	font-size: calc(0.875rem * var(--title-scale));
	line-height: calc(1.125rem * var(--title-scale));
	letter-spacing: calc(0.0437rem * var(--title-scale));
	opacity: clamp(0, 1 - var(--p) * 3, 1);
	white-space: nowrap;
}

.le-case__meta div {
	max-width: calc(7rem * var(--title-scale));
	white-space: normal;
}

.le-case__meta dt,
.le-case__meta dd {
	margin: 0;
	font-weight: inherit;
}

.le-case__tags {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	gap: 0.125rem;
	margin: calc(3rem - 1.75rem * var(--p)) 0 0;
	padding: 0;
	list-style: none;
}

.le-case__tags li {
	background: var(--le-100);
}

/* Each market links to the Work page filtered by it. */
.le-case__tags a {
	display: block;
	padding: 0.25rem 0.375rem;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.2s;
}

.le-case__tags a:hover,
.le-case__tags a:focus-visible {
	color: inherit;
	background: var(--le-200);
}

.le-case__summary {
	margin-top: 1.5rem;
	line-height: 1.375rem;
}

.le-case__capabilities {
	margin-top: 2rem;
}

.le-case__capabilities ul {
	margin: 0.5625rem 0 0;
	padding: 0;
	list-style: none;
}

.le-case__capabilities li {
	display: flex;
	align-items: center;
	box-sizing: content-box;
	height: 2.125rem;
	border-top: 1px solid var(--le-200);
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: -0.0113rem;
}

/*
 * Each links to the Work page filtered by its service. The link fills its row, which turns teal on
 * hover while the text slides in a little from the edge.
 */
.le-case__capabilities a {
	display: flex;
	flex: 1;
	align-items: center;
	align-self: stretch;
	padding-left: 0;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.2s, padding-left 0.3s var(--le-ease-out);
}

.le-case__capabilities a:hover,
.le-case__capabilities a:focus-visible {
	padding-left: 0.5rem;
	color: var(--le-black);
	background: var(--le-blue);
}

/* Next and previous ------------------------------------------------------------ */

.le-case__neighbours {
	position: relative;
	display: flex;
	flex: none;
	align-items: flex-end;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 1.5rem;
}

/*
 * Each sits in a slot as wide as its open card. The link's column is "0fr" - only as wide as
 * the label - until hovered, when it opens to the whole slot and the card unfolds upwards.
 */
.le-case__neighbour {
	display: grid;
	grid-template-columns: 0fr;
	width: 13.375rem;
	transition: grid-template-columns 0.6s var(--le-ease-out);
}

.le-case__neighbour--next {
	justify-content: end;
	margin-left: auto;
}

.le-case__neighbour:hover,
.le-case__neighbour:focus-within {
	grid-template-columns: 1fr;
}

.le-case__neighbour-link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	/* The label's height, so the closed link still stands on the column's bottom edge. */
	min-height: 1.625rem;
	color: var(--le-black);
	text-decoration: none;
}

.le-case__neighbour-label {
	position: relative;
	z-index: 1;
	flex: none;
}

.le-case__neighbour-reveal {
	display: grid;
	grid-template-rows: 0fr;
	/* Takes the link's width without adding to it, so the closed link is only as wide as its label. */
	width: 0;
	min-width: 100%;
	/* Tucked up under the label, which then sits on the image's corner. */
	margin-top: -1.625rem;
	transition: grid-template-rows 0.6s var(--le-ease-out);
}

.le-case__neighbour:hover .le-case__neighbour-reveal,
.le-case__neighbour:focus-within .le-case__neighbour-reveal {
	grid-template-rows: 1fr;
}

.le-case__neighbour-card {
	display: block;
	min-height: 0;
	overflow: hidden;
}

.le-case__neighbour-image {
	display: block;
	aspect-ratio: 214 / 126;
	background: var(--le-800);
}

.le-case__neighbour-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.le-case__neighbour-caption {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem;
	font-family: var(--le-font-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	line-height: 0.8125rem;
	letter-spacing: 0.0344rem;
	text-transform: uppercase;
	background: var(--le-100);
}

.le-case__neighbour-title {
	max-width: 8rem;
	min-height: 2.4375rem;
}

.le-case__neighbour-year {
	color: var(--le-500);
}

/* Story ------------------------------------------------------------------------ */

/* Four columns wide growing to eight; its top starts level with the tags and rises to the top of the pinned column. */
.le-case__story {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 1.125rem;
	box-sizing: border-box;
	width: calc(var(--span-4) + (var(--span-4) + var(--le-grid-gap)) * var(--p));
	padding-block: calc(1.5rem + (var(--title-height) + 3rem) * (1 - var(--p))) 1.5rem;
	container-type: inline-size;
}

.le-case__image,
.le-case__quote {
	margin: 0;
}

.le-case__image img {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * Quotes are switched off for now (see backups/case-study-quotes-2026-10-26.txt); these styles wait for their return.
 *
 * Sized from the story's width, so a quote that arrives while the column is still narrow fits it.
 * The space above and below is padding: Elementor zeroes the margins of figures inside widgets.
 */
.le-case__quote {
	padding-block: 12cqw;
}

.le-case__quote-body {
	padding-left: 4.6cqw;
	border-left: 2px solid var(--le-black);
}

.le-case__quote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: min(6.75rem, 11.78cqw);
	line-height: 0.8;
	font-style: normal;
	color: inherit;
}

.le-case__quote figcaption {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	margin-top: 2.25rem;
	padding-bottom: 0.125rem;
}

.le-case__quote-name {
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.0113rem;
}

.le-case__quote-role {
	color: var(--le-500);
}

/*
 * Narrower screens: no pinning and no growing. The page simply runs top to bottom:
 * title, details, summary, capabilities, the story at full width, then the two neighbours as open cards.
 */
@media (max-width: 1023px) {
	.le-case__body {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}

	/* Unwrapped, so the neighbours can follow the story while the rest of the column stays above it. */
	.le-case__info {
		display: contents;
	}

	.le-case__title-box {
		width: auto;
		height: auto;
	}

	.le-case__title {
		transform: none;
	}

	.le-case__meta {
		position: static;
		flex-wrap: wrap;
		margin-top: 1.5rem;
		opacity: 1;
	}

	.le-case__tags {
		margin-top: 2rem;
	}

	.le-case__story {
		width: auto;
		padding-block: 1.5rem;
	}

	.le-case__title-box {
		padding-top: 1.5rem;
	}

	.le-case__neighbours {
		order: 1;
		gap: var(--le-grid-gap);
		margin-top: 0;
		padding-block: 0.75rem 3rem;
	}

	.le-case__neighbour,
	.le-case__neighbour:hover {
		grid-template-columns: 1fr;
		flex: 1;
		width: auto;
		max-width: 16rem;
	}

	.le-case__neighbour-reveal {
		grid-template-rows: 1fr;
	}
}

@media (max-width: 880px) {
	.le-case__title-box {
		padding-top: 0.75rem;
	}

	.le-case__story {
		gap: 0.75rem;
		padding-block: 2.25rem 0.75rem;
	}

	.le-case__quote {
		padding-block: 3.75rem;
	}


	.le-case__quote blockquote {
		font-size: 3.1875rem;
		line-height: 2.75rem;
	}

	.le-case__neighbours {
		gap: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.le-case.is-entering .le-case__hero,
	.le-js .le-case__title .le-w__i {
		transition: none;
	}
}
