/* Case Studies — front end. Inherits fonts and colours from Astra. */
:root {
	--cs-accent: var(--ast-global-color-0, #2b6a4f);
	--cs-text: var(--ast-global-color-2, #1e2a32);
	--cs-muted: var(--ast-global-color-3, #5b6670);
	--cs-surface: var(--ast-global-color-4, #f5f5f2);
	--cs-radius: 6px;
	--cs-gap: 28px;
}

/* ---------- Cards ---------- */
.cs-grid-wrap { margin: 0 0 2em; }
.cs-grid {
	display: grid;
	grid-template-columns: repeat(var(--cs-cols, 3), minmax(0, 1fr));
	gap: var(--cs-gap);
}
@media (max-width: 1024px) { .cs-grid { grid-template-columns: repeat(min(2, var(--cs-cols, 3)), minmax(0, 1fr)); } }
@media (max-width: 600px)  { .cs-grid { grid-template-columns: 1fr; } }

.cs-card { margin: 0; }
.cs-card[hidden] { display: none; }
.cs-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none !important;
	background: #fff;
	border-radius: var(--cs-radius);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.05);
	transition: box-shadow .25s ease, transform .25s ease;
}
.cs-card-link:hover,
.cs-card-link:focus-visible { box-shadow: 0 2px 6px rgba(0,0,0,.1), 0 14px 32px rgba(0,0,0,.1); transform: translateY(-3px); }
.cs-card-link:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 3px; }
.cs-card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--cs-surface); }
.cs-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.cs-card-link:hover .cs-card-media img { transform: scale(1.04); }
.cs-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.cs-card-location { margin: 0 0 6px; font-size: .78em; letter-spacing: .1em; text-transform: uppercase; color: var(--cs-accent); font-weight: 600; }
.cs-card-title { margin: 0 0 8px; font-size: 1.25em; line-height: 1.3; }
.cs-card-teaser { margin: 0 0 14px; color: var(--cs-muted); font-size: .95em; line-height: 1.5; }
.cs-card-more { margin-top: auto; color: var(--cs-accent); font-weight: 600; font-size: .95em; }

.cs-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.cs-filter button {
	background: transparent; color: var(--cs-text); border: 1px solid currentColor;
	border-radius: 999px; padding: 6px 16px; font-size: .9em; cursor: pointer; line-height: 1.4;
}
.cs-filter button.is-active,
.cs-filter button:hover { background: var(--cs-accent); border-color: var(--cs-accent); color: #fff; }

/* ---------- Single ---------- */
.cs-article { max-width: 1200px; margin: 0 auto; padding: 2.5em 0 3em; }
.cs-header { margin-bottom: 1.2em; }
.cs-title { margin: 0; }

.cs-hero-single img { display: block; width: 100%; height: auto; border-radius: var(--cs-radius); }

.cs-headline { font-size: 1.35em; line-height: 1.4; margin: 1.2em 0 1em; font-style: italic; color: var(--cs-text); }

.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin: 0 0 2em; padding: 1.4em 0; border-top: 1px solid rgba(0,0,0,.1); border-bottom: 1px solid rgba(0,0,0,.1); }
.cs-fact-label { margin: 0 0 4px; font-size: .8em; letter-spacing: .1em; text-transform: uppercase; color: var(--cs-muted); }
.cs-fact-value { margin: 0; font-size: 1.15em; font-weight: 600; }
.cs-fact-sub { margin: 2px 0 0; }

.cs-quote { margin: 0 0 2.2em; padding: 1.6em 1.8em; background: var(--cs-surface); border-left: 4px solid var(--cs-accent); border-radius: 0 var(--cs-radius) var(--cs-radius) 0; }
.cs-quote-label { margin: 0 0 .6em; font-weight: 700; font-size: 1.05em; }
.cs-quote blockquote { margin: 0; padding: 0; border: 0; font-style: italic; font-size: 1.05em; line-height: 1.65; }
.cs-quote blockquote p:last-child { margin-bottom: 0; }
.cs-quote figcaption { margin-top: .9em; font-weight: 600; color: var(--cs-muted); }

.cs-story { margin: 0 0 2.5em; }

.cs-section { margin: 0 0 2.5em; }
.cs-section-title { margin: 0 0 .8em; }
.cs-gallery { display: grid; grid-template-columns: repeat(var(--cs-gallery-cols, 3), minmax(0, 1fr)); gap: 10px; }
@media (max-width: 768px) { .cs-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-gallery-item { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--cs-surface); }
.cs-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease, opacity .2s; }
.cs-gallery-item:hover img { transform: scale(1.04); }
.cs-gallery-item:focus-visible { outline: 3px solid var(--cs-accent); outline-offset: 2px; }

.cs-video { margin-top: 18px; }
.cs-video video { display: block; width: 100%; height: auto; border-radius: var(--cs-radius); background: #000; }
.cs-video-embed { position: relative; aspect-ratio: 16 / 9; }
.cs-video-embed iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; border-radius: var(--cs-radius); }

.cs-credit { font-size: .9em; font-style: italic; color: var(--cs-muted); margin: 0 0 2.5em; }

.cs-cta { margin: 0 0 2.5em; padding: 2em; text-align: center; background: var(--cs-surface); border-radius: var(--cs-radius); }
.cs-cta h3 { margin: 0 0 .4em; }
.cs-cta p { margin: 0 0 1.2em; }
.cs-button {
	display: inline-block; padding: 12px 28px; border-radius: 3px; background: var(--cs-accent);
	color: #fff !important; text-decoration: none !important; font-weight: 600; transition: filter .2s;
}
.cs-button:hover { filter: brightness(1.1); }

.cs-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 1.5em; border-top: 1px solid rgba(0,0,0,.1); }
.cs-nav a { display: block; text-decoration: none; color: inherit; }
.cs-nav-next { text-align: right; }
.cs-nav-label { display: block; color: var(--cs-accent); font-weight: 600; font-size: .9em; }
.cs-nav-title { display: block; margin-top: 2px; }
@media (max-width: 600px) { .cs-nav { grid-template-columns: 1fr; } .cs-nav-next { text-align: left; } }

/* ---------- Lightbox ---------- */
.cs-lb { position: fixed; inset: 0; z-index: 99999; background: rgba(10,12,14,.94); display: flex; align-items: center; justify-content: center; }
.cs-lb[hidden] { display: none; }
.cs-lb-figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.cs-lb-figure img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; display: block; margin: 0 auto; }
.cs-lb-caption { color: #ddd; margin-top: 10px; font-size: .9em; }
.cs-lb-count { position: absolute; top: 18px; left: 22px; color: #ccc; font-size: .9em; }
.cs-lb button {
	position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
	width: 48px; height: 48px; border-radius: 50%; font-size: 24px; line-height: 48px; padding: 0;
}
.cs-lb button:hover,
.cs-lb button:focus-visible { background: rgba(255,255,255,.28); outline: none; }
.cs-lb-close { top: 14px; right: 16px; }
.cs-lb-prev { left: 16px; top: 50%; margin-top: -24px; }
.cs-lb-next { right: 16px; top: 50%; margin-top: -24px; }
body.cs-lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.cs-card-link, .cs-card-media img, .cs-gallery-item img { transition: none; }
}
