/* =====================================================================
   case-study.css
   The case-study page's own layout: the cover image, the sticky
   chapter menu, and the result metrics/quote. Reuses .pv-crumbs,
   .pv-head, .pv-meta, .pv-nav, .pv-back and .pv-showcase from
   single-project.css rather than redefining them — a case study and a
   project share the same header/footer shape, they just differ in
   what fills the middle.
   ===================================================================== */

.cs-cover {
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-lg);
	overflow: hidden;
	border: 1px solid var(--line);
	margin-bottom: var(--space-7);
}
@media (min-width: 700px) {
	.cs-cover {
		aspect-ratio: 21 / 9;
	}
}
.cs-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cs-layout {
	display: grid;
	gap: var(--space-2);
}
@media (min-width: 960px) {
	.cs-layout {
		grid-template-columns: 170px 1fr;
		gap: var(--space-8);
	}
}

.cs-nav {
	display: flex;
	gap: var(--space-1);
	overflow-x: auto;
	position: sticky;
	top: env(safe-area-inset-top, 0px);
	background: var(--paper);
	padding-block: var(--space-2);
	z-index: 2;
}
@media (min-width: 960px) {
	.cs-nav {
		flex-direction: column;
		overflow: visible;
		border-left: 2px solid var(--line);
		position: sticky;
		top: calc(env(safe-area-inset-top, 0px) + var(--header-height) + var(--space-4));
		align-self: start;
	}
}
.cs-nav a {
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: var(--text-sm);
	color: var(--muted);
	text-decoration: none;
	padding: var(--space-2) var(--space-3);
	white-space: nowrap;
	border-bottom: 3px solid transparent;
}
@media (min-width: 960px) {
	.cs-nav a {
		border-bottom: 0;
		border-left: 3px solid transparent;
		margin-left: -2px;
	}
}
.cs-nav a[aria-current="true"] {
	color: var(--ink);
	border-color: var(--accent, var(--brand));
}

.cs-chapter {
	padding-block: var(--space-4) var(--space-8);
	scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--header-height) + var(--space-4));
}
.cs-chapter h2 {
	font-size: var(--text-lg);
	border-bottom: 2px solid var(--accent, var(--brand));
	padding-bottom: var(--space-2);
	margin-bottom: var(--space-3);
}
.cs-chapter p {
	color: var(--muted);
}

.cs-sol-link {
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: var(--text-sm);
	margin: 0 0 var(--space-3);
}
.cs-sol-link a {
	color: var(--ink);
}

.cs-metrics {
	display: grid;
	gap: var(--space-4);
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	margin: var(--space-5) 0;
}
.cs-metric {
	border: 1px solid var(--line);
	border-top: 4px solid var(--accent, var(--brand));
	border-radius: var(--radius-md);
	padding: var(--space-4);
	background: var(--surface);
}
.cs-metric b {
	display: block;
	font-family: var(--font-ui);
	font-size: 2rem;
}
.cs-metric span {
	color: var(--muted);
	font-family: var(--font-ui);
	font-size: var(--text-xs);
}

.cs-quote {
	border-left: 4px solid var(--accent, var(--brand));
	padding-left: var(--space-4);
	margin: var(--space-5) 0 0;
	font-size: 1.1rem;
}
