/*
 * Single Download template — scoped styles.
 *
 * Enqueued only on is_singular('download') via inc/setup.php.
 * Rebuilt 2026-05-12 after the live-review flagged the page as visually
 * broken: previously the template carried an inline <style> block that
 * (a) duplicated rules from this file, (b) overrode .site-shell max-width
 * with 100% — which removed the container constraint and caused horizontal
 * overflow, and (c) used hardcoded #2c5aa0 blue plus emoji type badges,
 * none of which match the 2026 navy/cream/gold design language used by the
 * portfolio/case-study singles.
 *
 * This file now owns all single-download styling end-to-end. Mobile
 * breakpoints at 720/980px. All colors via tokens.
 */

.single-download-wrap {
	/* Defensive: only set what is unique to this template. Container width,
	 * margin, and gutter come from .site-shell — do NOT override max-width
	 * here. The previous inline-style override is what broke the page. */
}

/* ========== Hero ========== */
.single-download-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem 3rem;
	align-items: start;
	margin: 0 0 2.25rem;
}
@media (min-width: 980px) {
	.single-download-hero--with-thumb {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
		gap: 2.5rem 3.5rem;
		align-items: center;
	}
}
.single-download-hero__text {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}
.single-download-hero__eyebrow {
	margin: 0;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--color-gold-text);
}
.single-download-title {
	margin: 0;
	font-size: clamp(2rem, 1.35rem + 3.2vw, 3.5rem);
	line-height: 1.06;
	letter-spacing: -0.02em;
	font-weight: 700;
	color: var(--color-text);
}
.single-download-description {
	margin: 0;
	max-width: 42ch;
	font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem);
	line-height: 1.45;
	color: color-mix(in srgb, var(--color-text) 78%, transparent);
	font-weight: 400;
}
.single-download-cta-group {
	margin: 0.5rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.single-download-cta-group .button-large {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.95rem 1.6rem;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	background: var(--color-accent);
	color: #fff;
	border: 1px solid var(--color-accent);
	border-radius: var(--radius-md);
	transition: background-color 0.18s var(--ease-standard), border-color 0.18s var(--ease-standard);
}
.single-download-cta-group .button-large:hover,
.single-download-cta-group .button-large:focus-visible {
	background: var(--color-accent-strong);
	border-color: var(--color-accent-strong);
	color: #fff;
}
.single-download-hero__thumbnail {
	margin: 0;
	padding: 0;
	background: var(--color-surface-alt);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-card);
	overflow: hidden;
}
.single-download-hero__thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

/* ========== Specs strip (horizontal data rail under hero) ========== */
.single-download-specs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0;
	margin: 0 0 2.5rem;
	padding: 1rem 0;
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}
.single-download-specs .download-spec {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 0.25rem 1.1rem;
	min-width: 0;
}
.single-download-specs .download-spec + .download-spec {
	border-left: 1px solid var(--color-border);
}
.single-download-specs .download-spec dt {
	margin: 0;
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--color-muted);
}
.single-download-specs .download-spec dd {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.35;
	font-weight: 500;
	color: var(--color-text);
	word-break: break-word;
}

/* ========== Content wrapper: main + sidebar ========== */
.single-download-content-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem;
	margin: 0 0 3rem;
}
@media (min-width: 980px) {
	.single-download-content-wrapper {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 3rem;
	}
}
.single-download-main {
	min-width: 0;
}

/* Body: capped reading width matching portfolio/case-study pattern. */
.single-download-body {
	max-width: 65ch;
	font-size: clamp(1rem, 0.97rem + 0.18vw, 1.075rem);
	line-height: 1.7;
	color: var(--color-text);
}
.single-download-body p {
	margin: 0 0 1.2rem;
}
.single-download-body h2 {
	margin: 2.5rem 0 0.9rem;
	font-size: clamp(1.4rem, 1.15rem + 0.95vw, 1.85rem);
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--color-text);
}
.single-download-body h3 {
	margin: 1.75rem 0 0.55rem;
	font-size: clamp(1.1rem, 1.02rem + 0.4vw, 1.25rem);
	font-weight: 600;
	line-height: 1.3;
}
.single-download-body :where(ul, ol),
.single-download-body :where(ul.wp-block-list, ol.wp-block-list) {
	list-style-position: outside;
	padding-inline-start: 1.4rem;
	margin: 0 0 1.2rem 0.2rem;
}
.single-download-body :where(ul, ol) li {
	margin: 0 0 0.45rem;
}
.single-download-body :where(ul, ol) li::before {
	content: none;
}
.single-download-body a {
	color: var(--color-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.single-download-body a:hover,
.single-download-body a:focus-visible {
	color: var(--color-accent-strong);
}

/* ========== Changelog ========== */
.single-download-changelog {
	margin: 2.5rem 0 0;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border);
}
.single-download-changelog h2 {
	margin: 0 0 1rem;
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.download-changelog-content {
	background: var(--color-surface-alt);
	border: 1px solid var(--color-border);
	padding: 1.25rem 1.4rem;
	border-radius: var(--radius-md);
	font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
	font-size: 0.86rem;
	line-height: 1.55;
	color: var(--color-text);
	overflow-x: auto;
}

/* ========== Subjects footer (pill chips) ========== */
.single-download-subjects-footer {
	margin: 2.5rem 0 0;
}
.single-download-subjects-heading {
	margin: 0 0 0.75rem;
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--color-muted);
}
.single-download-subjects {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.single-download-subjects li {
	margin: 0;
}
.single-download-subjects a {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.85rem;
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.2;
	text-decoration: none;
	color: var(--color-text);
	background: transparent;
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-pill);
	transition: border-color 0.18s var(--ease-standard),
		color 0.18s var(--ease-standard),
		background-color 0.18s var(--ease-standard);
}
.single-download-subjects a:hover,
.single-download-subjects a:focus-visible {
	border-color: var(--color-accent);
	color: var(--color-accent);
	background: var(--color-accent-soft);
}

/* ========== Related resources grid ========== */
.single-download-related {
	margin: 3rem 0 0;
	padding-top: 2.25rem;
	border-top: 1px solid var(--color-border);
}
.single-download-related__heading h2 {
	margin: 0 0 1.5rem;
	font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.65rem);
	font-weight: 700;
	letter-spacing: -0.01em;
}
.download-related-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.5rem;
}
.download-related-card {
	margin: 0;
}
.download-related-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-card);
	overflow: hidden;
	transition: border-color 0.2s var(--ease-standard),
		transform 0.2s var(--ease-standard),
		box-shadow 0.2s var(--ease-standard);
}
.download-related-card__link:hover,
.download-related-card__link:focus-visible {
	border-color: var(--color-accent);
	transform: translateY(-2px);
	box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--color-text) 35%, transparent);
}
.download-related-card__thumbnail {
	display: block;
	aspect-ratio: 4 / 3;
	width: 100%;
	background: var(--color-surface-alt);
	overflow: hidden;
}
.download-related-card__thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.download-related-card__thumbnail--blank {
	background-image: linear-gradient(135deg,
		color-mix(in srgb, var(--color-surface-alt) 92%, var(--color-gold)),
		var(--color-surface-alt));
}
.download-related-card__content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.1rem 1.2rem 1.3rem;
	flex: 1 1 auto;
}
.download-related-card__eyebrow {
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--color-gold-text);
}
.download-related-card__title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}
.download-related-card__lead {
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--color-muted);
}
.download-related-card__cta {
	margin-top: auto;
	padding-top: 0.45rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--color-gold-text);
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

/* ========== Sidebar (info card + sticky CTA) ========== */
.single-download-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}
.single-download-info-card {
	padding: 1.4rem 1.5rem;
	background: var(--color-surface-alt);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-card);
}
@media (min-width: 980px) {
	.single-download-info-card {
		position: sticky;
		top: 2rem;
	}
}
.single-download-info-card h2 {
	margin: 0 0 1rem;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.005em;
}
.download-info-list {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}
.download-info-list__row {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--color-border);
	margin: 0;
}
.download-info-list__row:last-child {
	padding-bottom: 0;
	border-bottom: none;
}
.download-info-list__row dt {
	margin: 0;
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--color-muted);
}
.download-info-list__row dd {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--color-text);
}

.single-download-sticky-cta {
	padding: 1.25rem 1.3rem;
	background: var(--color-surface);
	border: 1px solid var(--color-accent);
	border-radius: var(--radius-card);
}
@media (min-width: 980px) {
	.single-download-sticky-cta {
		position: sticky;
		top: 16rem;
	}
}
.single-download-sticky-cta .button-block {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	width: 100%;
	padding: 0.85rem 1rem;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	background: var(--color-accent);
	color: #fff;
	border: 1px solid var(--color-accent);
	border-radius: var(--radius-md);
	transition: background-color 0.18s var(--ease-standard);
}
.single-download-sticky-cta .button-block:hover,
.single-download-sticky-cta .button-block:focus-visible {
	background: var(--color-accent-strong);
}
.single-download-give-back {
	margin: 0.85rem 0 0;
	font-size: var(--fs-sm);
	line-height: 1.5;
	color: var(--color-muted);
	text-align: center;
}
.single-download-give-back a {
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ========== Mobile: collapse spec strip rules, drop sticky positioning ========== */
@media (max-width: 720px) {
	.single-download-hero {
		gap: 1.25rem;
		margin-bottom: 1.75rem;
	}
	.single-download-title {
		font-size: clamp(1.8rem, 1.4rem + 3vw, 2.4rem);
	}
	.single-download-specs {
		grid-template-columns: 1fr 1fr;
	}
	.single-download-specs .download-spec + .download-spec {
		border-left: none;
	}
	.single-download-specs .download-spec {
		padding: 0.6rem 0.9rem;
	}
	.single-download-specs .download-spec:nth-child(2n) {
		border-left: 1px solid var(--color-border);
	}
	.single-download-specs .download-spec:nth-child(n + 3) {
		border-top: 1px solid var(--color-border);
	}
	.single-download-cta-group .button-large {
		flex: 1 1 auto;
		justify-content: center;
	}
	.single-download-body .wp-block-table {
		position: relative;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		margin: 0 0 1.5rem;
	}
	.single-download-body .wp-block-table table {
		min-width: 720px;
	}
}

/* Reduce motion. */
@media (prefers-reduced-motion: reduce) {
	.single-download-subjects a,
	.download-related-card__link,
	.single-download-cta-group .button-large,
	.single-download-sticky-cta .button-block {
		transition: none;
	}
}
