/* Case studies (M17). Linked only on case-study URLs. Everything is scoped
   under .wd-case, takes its colours from the theme (currentColor and a
   translucent tint of it), loads no font and makes no request. */
.wd-case {
	--wd-case-line: color-mix(in srgb, currentColor 22%, transparent);
	--wd-case-tint: color-mix(in srgb, currentColor 6%, transparent);
	--wd-case-gap: 24px;
	box-sizing: border-box;
	max-width: 1120px;
	margin: 0 auto;
	padding: 32px 16px 64px;
	/* Our own baseline: a block theme can centre, enlarge or lighten text on
	   the page around it, and none of that is ours to inherit. */
	font-size: 1rem;
	line-height: 1.6;
	text-align: start;
	hyphens: manual;
}
.wd-case *, .wd-case *::before, .wd-case *::after { box-sizing: inherit; }
.wd-case a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
:where(.wd-case) ul, :where(.wd-case) dl, :where(.wd-case) dd { margin: 0; padding: 0; list-style: none; }
.wd-case h1, .wd-case h2 { font-weight: 650; line-height: 1.2; }
.wd-case p { font-size: inherit; line-height: inherit; }
/* The ONE use of !important in this file, and the reason is verifiable: the
   wd-portal-connect plugin's wd-forms.css is enqueued sitewide and contains
   `.wd-step-heading, .wd-sub-heading, p, .wd-form-title { text-align: center
   !important }` under 768px, which centred every paragraph on these pages
   (found by the browser spec naming the rule). That plugin is frozen
   (CLAUDE.md section 2), so this defends from our side, scoped to our
   container; the intake app does the same (D-093). */
main.wd-case :is(p, li, dt, dd, h1, h2, summary, figcaption) { text-align: start !important; }
.wd-case-section p, .wd-case-section li { font-size: 1.0625rem; }

.wd-case-hero { margin-bottom: var(--wd-case-gap); }
.wd-case-stats-wrap { margin-bottom: 40px; }
.wd-case-eyebrow { margin: 0 0 8px; font-size: .875rem; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.wd-case-title { margin: 0 0 12px; font-size: clamp(1.75rem, 4.5vw, 2.75rem); }
.wd-case-lede { margin: 0 0 16px; max-width: 46rem; font-size: 1.125rem; }
.wd-case-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 24px; font-size: .9375rem; }
.wd-case-facts li { margin: 0; }
.wd-case-label { font-weight: 600; margin-right: 4px; }
.wd-case-figure { margin: 0; aspect-ratio: 1200 / 630; background: var(--wd-case-tint); border-radius: 12px; overflow: hidden; }
.wd-case-image { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Stat cards: three equal cells with a reserved minimum height, so the text
   settling into them cannot move anything below. */
.wd-case-stats { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wd-case-stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; min-height: 120px; padding: 16px 20px; border: 1px solid var(--wd-case-line); border-radius: 12px; background: var(--wd-case-tint); }
.wd-case-stat-value { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; line-height: 1.15; }
.wd-case-stat-label { font-size: .9375rem; }

.wd-case-section { margin-bottom: 40px; max-width: 46rem; }
.wd-case-section h2 { margin: 0 0 12px; font-size: 1.5rem; }
.wd-case-section p { margin: 0 0 1em; }
.wd-case-solution ul { list-style: disc; padding-left: 1.25em; }
.wd-case-solution li { margin-bottom: .75em; }
.wd-case-solution code { font-size: .9em; overflow-wrap: anywhere; }
.wd-case-results { display: grid; gap: 12px; }
.wd-case-result { padding: 12px 16px; border-left: 3px solid currentColor; background: var(--wd-case-tint); }
.wd-case-result dt { font-size: .9375rem; }
.wd-case-result dd { font-weight: 700; }
.wd-case-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-case-tags li { padding: 2px 12px; border: 1px solid var(--wd-case-line); border-radius: 999px; font-size: .875rem; }
.wd-case-related-list li { margin-bottom: 8px; }

/* Archive */
.wd-case-archive-head { margin-bottom: 24px; }
.wd-case-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; margin-bottom: 32px; padding: 12px 16px; border: 1px solid var(--wd-case-line); border-radius: 12px; }
.wd-case-filter-all { display: inline-block; align-self: center; margin-right: 8px; font-weight: 600; }
.wd-case-filter { flex: 1 1 260px; min-width: 0; }
.wd-case-filter-title { margin: 0 0 8px; font-size: .875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
summary.wd-case-filter-title { cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; list-style: none; }
summary.wd-case-filter-title::-webkit-details-marker { display: none; }
summary.wd-case-filter-title::after { content: "+"; font-size: 1.25rem; line-height: 1; }
details[open] > summary.wd-case-filter-title::after { content: "\2212"; }
details.wd-case-filter[open] > summary { margin-bottom: 8px; }
.wd-case-filter ul { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-case-filter a { display: inline-block; padding: 8px 14px; min-height: 44px; border: 1px solid var(--wd-case-line); border-radius: 999px; font-size: .9375rem; line-height: 1.5; text-decoration: none; }
.wd-case-filters a[aria-current="page"] { border-color: currentColor; font-weight: 600; }
.wd-case-grid { display: grid; grid-template-columns: 1fr; gap: var(--wd-case-gap); }
.wd-case-card { display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 20px; border: 1px solid var(--wd-case-line); border-radius: 12px; background: var(--wd-case-tint); }
.wd-case-card-client { margin: 0; font-size: .875rem; opacity: .75; }
.wd-case-card-title { margin: 0; font-size: 1.25rem; }
.wd-case-card-title a { text-decoration: none; }
.wd-case-card-title a:hover { text-decoration: underline; }
.wd-case-card-metric { margin: 0; font-size: .9375rem; line-height: 1.4; }
.wd-case-card-metric strong { display: block; font-size: 1.5rem; line-height: 1.2; }
.wd-case-card-more { margin: auto 0 0; font-weight: 600; }
.wd-case-empty { margin: 32px 0; }
.wd-case .navigation.pagination { margin-top: 32px; }
.wd-case .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-case .page-numbers { display: inline-block; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--wd-case-line); border-radius: 8px; text-align: center; text-decoration: none; }
.wd-case .page-numbers.current { border-color: currentColor; font-weight: 700; }

/* The call to action (phase 5) */
.wd-case-cta { max-width: 46rem; margin: 48px 0 0; padding: 24px; border: 2px solid currentColor; border-radius: 12px; }
.wd-case-cta h2 { margin: 0 0 8px; font-size: 1.5rem; }
.wd-case-cta p { margin: 0 0 16px; }
.wd-case-cta-button { display: inline-block; min-height: 44px; padding: 10px 20px; border: 2px solid currentColor; border-radius: 8px; font-weight: 700; text-decoration: none; }
.wd-case-cta-button:hover { background: var(--wd-case-tint); }

@media (min-width: 700px) {
	.wd-case { padding: 48px 24px 80px; }
	.wd-case-stats { grid-template-columns: repeat(3, 1fr); }
	.wd-case-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.wd-case-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
	.wd-case-card, .wd-case-cta-button { transition: border-color .15s ease, background-color .15s ease; }
	.wd-case-card:hover { border-color: currentColor; }
}
