/*
 * Case template (page-templates/case.php). Hero with the client name on the band in the service colour,
 * the featured image, the case sections (situation + facts + logo + story), result figures, quote,
 * the next-case card and the closer.
 * Reuses .case-kpi, .case-pill and .proof-otto from cases.css. Empty data is left out, never shown as "volgt".
 */


/* Hero: no image, so the band carries the service colour; 'none' keeps the neutral band. */
.case-hero { position: relative; overflow: hidden; --bl: 50%; --bw: 34%; --bc: var(--c, var(--beige-deep)); }
.case-hero-inner {
	padding-top: max(calc(var(--header-h, 0px) + 72px), clamp(200px, 22vw, 320px));
	padding-bottom: clamp(56px, 6vw, 96px);
	align-items: end;
}
.case-hero h1 { max-width: 9em; overflow-wrap: anywhere; }
.case-hero-teaser { margin-top: 24px; max-width: 30em; font-size: 18px; line-height: 1.45; }
.case-hero-side { display: grid; gap: 22px; justify-items: start; align-content: end; padding-bottom: 0.6em; }
.case-hero-side .case-pill { background: var(--beige-tint); }
.case-hero-side .textlink { color: var(--green); }
.arrow--back svg { transform: rotate(180deg); }
.textlink:hover .arrow--back { transform: translateX(-3px); }

/* Sections */
.case-sec { padding-top: var(--sp-block); }
.case-sec + .case-sec,
.case-goal + .case-sec { padding-top: var(--sp-section); }
.case-h2 { font-size: clamp(32px, 3.6vw, 56px); max-width: 13em; }

.case-row { align-items: start; row-gap: 32px; }
.case-main, .case-aside, .case-row > *, .case-aside > *, .case-kpi > * { min-width: 0; overflow-wrap: anywhere; }
.case-main { display: grid; gap: 28px; align-content: start; }
.case-text { display: grid; gap: 1em; max-width: 38em; font-size: 18px; line-height: 1.55; }

.case-facts { margin: 0; display: grid; gap: 14px; align-content: start; border-top: 1px solid var(--green); padding-top: 16px; }
.case-facts .case-kpi { grid-template-columns: minmax(110px, auto) 1fr; column-gap: 20px; }
.case-facts .case-kpi:last-child { border-bottom: 0; padding-bottom: 0; }
.case-side { display: grid; gap: 18px; align-content: start; }

/* Featured image under the hero: wide, rounded, cropped to a calm strip. */
.case-media { margin: 0; }
.case-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 7;
	object-fit: cover;
	border-radius: var(--radius);
	background: var(--beige-deep);
}

/* Story: the case text in the prose style, below the situation. */
.case-main > .case-story { margin-top: 12px; }
.case-text + .case-story { padding-top: 36px; border-top: 1px solid var(--line); }
.case-story h2 { font-size: clamp(28px, 2.6vw, 38px); }

/* Aside: client logo (small) and the facts. Stays in view next to a long story. */
.case-aside { display: grid; gap: 28px; align-content: start; position: sticky; top: 32px; }
.case-logo {
	justify-self: start;
	display: flex;
	align-items: center;
	min-height: 88px;
	padding: 18px 22px;
	border-radius: var(--radius-s);
	background: var(--beige);
}
.case-logo-img { display: block; width: auto; max-width: 168px; height: auto; max-height: 52px; object-fit: contain; }
/* Raster logos often carry a white background (JPEG): multiply turns it into the tile colour. */
img.case-logo-img { mix-blend-mode: multiply; }
.case-logo-mask {
	height: 44px;
	max-height: none;
	background: var(--green);
	-webkit-mask: var(--logo) center / contain no-repeat;
	mask: var(--logo) center / contain no-repeat;
}

/* No content yet: one honest line and two links, nothing else. */
.case-none { padding-top: var(--sp-block); padding-bottom: var(--sp-block); display: grid; gap: 28px; justify-items: start; }
.case-none-text { font-size: clamp(20px, 1.6vw, 24px); line-height: 1.4; max-width: 30em; }
.case-none-links { display: flex; flex-wrap: wrap; gap: 16px 36px; }

/* KPI panel: beige container, like the beoordelingsdatum panel on the homepage. */
.case-goal { margin-top: var(--sp-section); }
.case-goal .b-split { align-items: start; row-gap: 32px; }
.case-goal .b-split > div:first-child { display: grid; gap: 28px; }
.case-goal-kpi { max-width: 22em; }
.case-goal .case-facts { border-top-color: var(--green); }

/* Head row inside a section: heading left, muted line right (beside, never above). */
.case-head { align-items: end; row-gap: 16px; margin-bottom: 40px; }

/* Rounds through the loop: columns with a number, like the promises. */
.case-rounds {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	border-top: 1px solid var(--green);
}
.case-round { padding: 24px 28px 8px 0; display: grid; gap: 14px; align-content: start; }
.case-round + .case-round { padding-left: 28px; border-left: 1px solid var(--line); }
.case-round .n { font-size: var(--fs-micro); color: var(--ink-soft); }
.case-round h3 { font-size: var(--fs-h3); line-height: 1.1; }
.case-round p { font-size: var(--fs-small); color: var(--ink-soft); }

/* Result figures */
.case-figures {
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--gap);
}
.case-figure {
	background: var(--ct, var(--beige));
	border-radius: var(--radius);
	padding: 24px;
	display: grid;
	gap: 8px;
	align-content: start;
}
.case-figure-value { font-family: var(--serif); font-weight: 300; font-size: clamp(48px, 5vw, 80px); line-height: 1; letter-spacing: -0.025em; }
.case-figure-unit { font-size: 0.45em; letter-spacing: -0.01em; }
.case-figure dd { margin: 0; }
.case-figure-label { font-size: var(--fs-small); }
.case-figure-period { font-size: var(--fs-micro); color: var(--ink-soft); }

/* Quote: only rendered when filled. */
.case-quote { margin: var(--sp-section) 0 0; display: grid; gap: 24px; }
.case-quote blockquote { margin: 0; font-size: clamp(30px, 3.6vw, 52px); max-width: 20em; }
.case-quote blockquote p { margin: 0; }
.case-quote figcaption { font-size: var(--fs-small); }

/* Next case: a wide card in the next case's colour. The text and the arrow on the left, the shared framed
   photo (case-frame.css, here the wide variant) flush on the right. One link. */
.case-next { margin-top: var(--sp-section); }
.case-next-link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
	align-items: stretch;
	overflow: hidden;
	border-radius: var(--radius-l);
	background: var(--c, var(--beige-deep));
	text-decoration: none;
	color: var(--green);
}
.case-next-main { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: clamp(28px, 3.4vw, 48px); }
.case-next-text { display: grid; gap: 10px; }
.case-next-name { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 4.6vw, 72px); line-height: 1; letter-spacing: -0.02em; }
.case-next-sub { font-size: var(--fs-small); color: var(--ink-soft); }
.case-next-link .arrow { width: 52px; height: 52px; background: var(--green); color: var(--beige); transition: transform .2s; }
.case-next-link:hover .arrow { transform: translateX(3px); }
.case-next-link:focus-visible { outline-offset: 4px; border-radius: var(--radius-l); }
.case-frame--wide { aspect-ratio: 16 / 9; }

@media (max-width: 1180px) {
	.case-rounds { grid-template-columns: 1fr 1fr; }
	.case-round:nth-child(odd) { padding-left: 0; border-left: 0; }
	.case-round:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
	.case-next-link { grid-template-columns: minmax(0, 1fr); }
	.case-next-main { gap: 20px; }
	.case-next-link .case-frame--wide { order: -1; aspect-ratio: 16 / 10; }
	.case-row.split, .case-goal .b-split { grid-template-columns: minmax(0, 1fr); }
	.case-media img { aspect-ratio: 4 / 3; }
	.case-aside { position: static; order: -1; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 20px; }
	.case-aside .case-logo { min-height: 72px; padding: 14px 16px; }
	.case-aside .case-logo-img { max-width: 120px; max-height: 40px; }
	.case-aside .case-logo-mask { height: 36px; }
	.case-aside > .case-facts:only-child { grid-column: 1 / -1; }
	.case-hero { --bl: 54%; --bw: 44%; }
	.case-hero-inner { padding-top: max(calc(var(--header-h, 0px) + 72px), 168px); row-gap: 24px; }
	.case-hero-side { padding-bottom: 0; }
}
@media (max-width: 560px) {
	.case-aside { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
	.case-rounds { grid-template-columns: 1fr; }
	.case-round,
	.case-round + .case-round { padding-left: 0; border-left: 0; }
	.case-round + .case-round { border-top: 1px solid var(--line); }
	.case-next-link .arrow { width: 44px; height: 44px; }
}
