/* =============================================================
   SINGLE POST — single.css
   Loaded on: is_single()
   Depends on: theme.css (design tokens), blog.css (post-card, post-cat-badge)
   ============================================================= */

/* ── Shared inner containers ─────────────────────────────────── */

.article-body__inner,
.article-footer__inner,
.related-posts__inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── ZONE 1: Article Hero ────────────────────────────────────── */

.article-hero {
	position: relative;
	min-height: 540px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
	background: var(--primary); /* solid fallback when no image */
}

/* Background image layer */
.article-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

/* The Bialty plugin wraps post_thumbnail_html output in a div,
   which breaks the height:100% chain to the cover image */
.article-hero__bg .bialty-container {
	height: 100%;
}

.article-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 30%;
	display: block;
}

/* Dark navy gradient overlay: transparent at top, solid at bottom */
.article-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to bottom,
		rgba(5, 79, 125, 0.05) 0%,
		rgba(5, 79, 125, 0.30) 35%,
		rgba(5, 79, 125, 0.72) 60%,
		rgba(5, 79, 125, 0.93) 80%,
		#054f7d 100%
	);
}

/* Content above the gradient */
.article-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 80px 24px 52px;
}

/* A. Breadcrumb — white on hero */
.article-breadcrumb {
	font-family: var(--font-body);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.60);
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
}

.article-breadcrumb a {
	color: rgba(255, 255, 255, 0.60);
	text-decoration: none;
	transition: color 0.15s ease;
}

.article-breadcrumb a:hover {
	color: #ffffff;
}

.article-breadcrumb [aria-current="page"] {
	color: rgba(255, 255, 255, 0.85);
}

/* B. Category badge — sits on hero */
.article-cat-badge {
	display: inline-block;
	margin-bottom: 14px;
}

/* C. H1 Title — white on hero */
.article-title {
	font-family: var(--font-heading);
	font-size: 44px;
	font-weight: 700;
	line-height: 1.2;
	color: #ffffff;
	max-width: 780px;
	margin: 0 0 22px;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* D. Author Block — white on hero */
.article-author {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
}

.article-author__avatar img,
.article-author .author-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid rgba(255, 255, 255, 0.40);
}

.article-author__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.article-author__name {
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.3;
}

.article-author__creds {
	font-family: var(--font-body);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.65);
	line-height: 1.3;
}

/* E. Meta Row — white on hero */
.article-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-family: var(--font-body);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.65);
	margin-bottom: 0;
}

.article-meta__item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.article-meta__icon {
	color: rgba(255, 255, 255, 0.65);
	flex-shrink: 0;
	vertical-align: middle;
}

.article-meta__sep {
	font-size: 10px;
	opacity: 0.5;
}

/* ── ZONE 2: Article Body ────────────────────────────────────── */

.article-body {
	/* Light beige page surface so the white content panel reads clearly */
	background: #FDFBF6;
	padding: 56px 0 64px;
}

.article-body__grid {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 64px;
	align-items: start;
}

/* ── Content Column ─────────────────────────────────────────── */

.article-content {
	min-width: 0; /* prevent grid blowout */
	background: #ffffff;
	border: 1px solid rgba(5, 79, 125, 0.08);
	border-radius: 12px;
	padding: 40px 44px;
	box-shadow: 0 2px 12px rgba(5, 79, 125, 0.05);
}

@media (max-width: 768px) {
	.article-content {
		padding: 24px 20px;
		border-radius: 8px;
	}
}

/* Entry content typography */
.entry-content {
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.85;
	color: var(--body-text);
}

.entry-content h2 {
	font-family: var(--font-heading);
	font-size: 28px;
	font-weight: 700;
	color: var(--body-text);
	line-height: 1.3;
	margin-top: 40px;
	margin-bottom: 16px;
}

.entry-content h3 {
	font-family: var(--font-body);
	font-size: 20px;
	font-weight: 700;
	color: var(--body-text);
	line-height: 1.35;
	margin-top: 28px;
	margin-bottom: 12px;
}

.entry-content h4 {
	font-family: var(--font-body);
	font-size: 17px;
	font-weight: 700;
	color: var(--body-text);
	margin-top: 20px;
	margin-bottom: 10px;
}

.entry-content p {
	margin-bottom: 22px;
}

.entry-content a {
	color: var(--accent);
	text-decoration: none;
	transition: text-decoration 0.15s ease;
}

.entry-content a:hover {
	text-decoration: underline;
}

.entry-content strong,
.entry-content b {
	font-weight: 700;
	color: var(--body-text);
}

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--border-radius);
	margin: 28px auto;
	display: block;
}

.entry-content ul {
	list-style: disc;
	padding-left: 24px;
	margin-bottom: 22px;
}

.entry-content ol {
	list-style: decimal;
	padding-left: 24px;
	margin-bottom: 22px;
}

.entry-content li {
	margin-bottom: 8px;
	line-height: 1.7;
}

.entry-content blockquote {
	border-left: 4px solid var(--accent);
	background: var(--off-white);
	padding: 20px 24px;
	border-radius: 0 var(--border-radius) var(--border-radius) 0;
	font-style: italic;
	font-family: var(--font-body);
	font-size: 17px;
	margin: 32px 0;
	color: var(--body-text);
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content .callout-box {
	border-left: 4px solid var(--accent);
	background: var(--off-white);
	padding: 20px 24px;
	border-radius: 0 var(--border-radius) var(--border-radius) 0;
	font-style: normal;
	font-family: var(--font-body);
	font-size: 17px;
	margin: 32px 0;
}

/* ── Sticky Sidebar ─────────────────────────────────────────── */

.article-sidebar {
	position: sticky;
	top: 80px;
	align-self: start;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #e2e8f0 transparent;
}

.article-sidebar::-webkit-scrollbar {
	width: 4px;
}

.article-sidebar::-webkit-scrollbar-track {
	background: transparent;
}

.article-sidebar::-webkit-scrollbar-thumb {
	background: #e2e8f0;
	border-radius: 4px;
}

/* TOC Widget — white panel matching .article-content */
.toc-widget {
	margin-bottom: 28px;
	background: #ffffff;
	border: 1px solid rgba(5, 79, 125, 0.08);
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 2px 12px rgba(5, 79, 125, 0.05);
}

.toc-widget__label {
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--medium-gray);
	margin-bottom: 12px;
}

#toc-sidebar ol {
	list-style: none;
	padding: 0;
	margin: 0;
}

#toc-sidebar li {
	margin: 0;
}

#toc-sidebar .toc-link {
	display: block;
	font-family: var(--font-body);
	font-size: 13px;
	line-height: 1.5;
	color: var(--body-text);
	padding: 6px 0;
	border-bottom: 1px solid #edf2f7;
	text-decoration: none;
	transition: color 0.15s ease, padding-left 0.15s ease, font-weight 0.15s ease;
}

#toc-sidebar .toc-link:hover {
	color: var(--accent);
}

#toc-sidebar .toc-link.toc-active {
	color: var(--accent);
	font-weight: 700;
	padding-left: 8px;
	border-left: 2px solid var(--accent);
	margin-left: -2px;
}

/* Sidebar CTA Card */
.sidebar-cta {
	background: var(--primary);
	border-radius: var(--border-radius);
	padding: 20px;
	margin-top: 4px;
}

.sidebar-cta__heading {
	font-family: var(--font-heading);
	font-size: 18px;
	font-weight: 600;
	color: #ffffff;
	margin-bottom: 8px;
}

.sidebar-cta__body {
	font-family: var(--font-body);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.80);
	line-height: 1.6;
	margin-bottom: 12px;
}

.sidebar-cta__btn {
	display: block;
	width: 100%;
	padding: 10px 18px;
	background: #ffffff;
	color: var(--primary);
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	border-radius: var(--border-radius);
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-cta__btn:hover {
	background: var(--accent);
	color: #ffffff;
}

/* ── TOC Accordion (Mobile/Tablet — injected by JS) ─────────── */

.toc-accordion {
	position: sticky;
	top: 72px;
	z-index: 100;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	margin-bottom: 28px;
	border-radius: var(--border-radius);
	overflow: hidden;
}

.toc-accordion > summary {
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 700;
	color: var(--primary);
	padding: 14px 16px;
	background: var(--off-white);
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	user-select: none;
}

.toc-accordion > summary::-webkit-details-marker {
	display: none;
}

.toc-accordion > summary::after {
	content: '▾';
	font-size: 12px;
	transition: transform 0.2s ease;
}

.toc-accordion[open] > summary::after {
	transform: rotate(180deg);
}

.toc-accordion ol {
	list-style: none;
	padding: 8px 16px 12px;
	margin: 0;
}

.toc-accordion .toc-link {
	display: block;
	font-family: var(--font-body);
	font-size: 13px;
	line-height: 1.5;
	color: var(--body-text);
	padding: 6px 0;
	border-bottom: 1px solid #edf2f7;
	text-decoration: none;
	transition: color 0.15s ease;
}

.toc-accordion .toc-link:last-child {
	border-bottom: none;
}

.toc-accordion .toc-link:hover,
.toc-accordion .toc-link.toc-active {
	color: var(--accent);
}

/* ── ZONE 3: Mid-Content CTA (injected via filter) ───────────── */

.mid-content-cta {
	background: var(--primary);
	border-radius: var(--border-radius);
	padding: 32px 36px;
	margin: 40px 0;
}

.mid-cta-inner {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.mid-cta-eyebrow {
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	margin-bottom: 8px;
}

.mid-cta-heading {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 600;
	color: #ffffff !important;
	margin-bottom: 10px;
}

.mid-cta-body {
	font-family: var(--font-body);
	font-size: 15px;
	color: rgba(255, 255, 255, 0.80);
	line-height: 1.6;
	margin-bottom: 0;
}

.mid-cta-button {
	display: inline-block;
	background: #ffffff;
	color: var(--primary);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 700;
	padding: 14px 28px;
	border-radius: var(--border-radius);
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background 0.2s ease, color 0.2s ease;
}

.mid-cta-button:hover {
	background: var(--accent);
	color: #ffffff;
}

/* ── ZONE 4A: Social Share ───────────────────────────────────── */

.article-share__row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding-top: 32px;
	border-top: 1px solid #e2e8f0;
	margin-bottom: 32px;
}

.article-share__label {
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--medium-gray);
	flex-shrink: 0;
}

.article-share__links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.article-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--off-white);
	color: var(--primary);
	border: 1px solid #e2e8f0;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.article-share__btn:hover {
	background: var(--accent);
	color: #ffffff;
	border-color: var(--accent);
}

/* ── ZONE 4B: Post Tags ──────────────────────────────────────── */

.article-tags {
	padding-top: 16px;
}

.article-footer__inner {
	padding-bottom: 0;
}

.article-tags__row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding-top: 32px;
	border-top: 1px solid #e2e8f0;
	margin-bottom: 40px;
}

.article-tags__label {
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--medium-gray);
	flex-shrink: 0;
}

.article-tags__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.article-tag {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 30px;
	font-family: var(--font-body);
	font-size: 12px;
	color: var(--body-text);
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.article-tag:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* ── ZONE 4B: Author Bio Box ─────────────────────────────────── */

.article-footer__inner--bio {
	margin-bottom: 48px;
}

.author-bio {
	display: flex;
	flex-direction: row;
	gap: 24px;
	align-items: flex-start;
	background: var(--off-white);
	border-left: 4px solid var(--accent);
	border-radius: var(--border-radius);
	padding: 28px 32px;
}

.author-bio__avatar img,
.author-bio .author-avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.author-bio__name {
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 700;
	color: var(--body-text);
	margin-bottom: 4px;
}

.author-bio__title {
	font-family: var(--font-body);
	font-size: 13px;
	color: var(--medium-gray);
	margin-bottom: 8px;
}

.author-bio__text {
	font-family: var(--font-body);
	font-size: 14px;
	color: var(--body-text);
	line-height: 1.7;
	margin-bottom: 10px;
}

.author-bio__link {
	display: inline-block;
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 700;
	color: var(--accent);
	text-decoration: none;
	margin-top: 2px;
	transition: text-decoration 0.15s ease;
}

.author-bio__link:hover {
	text-decoration: underline;
}

/* ── ZONE 4C: Full-Width CTA Banner ──────────────────────────── */

.footer-cta-banner {
	background: var(--primary);
	padding: 64px 24px;
	text-align: center;
	margin: 48px 0;
}

.footer-cta-banner__inner {
	max-width: 640px;
	margin: 0 auto;
}

.footer-cta-banner__eyebrow {
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--accent);
	margin-bottom: 16px;
}

.footer-cta-banner__heading {
	font-family: var(--font-heading);
	font-size: 36px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.2;
	margin-bottom: 16px;
}

.footer-cta-banner__body {
	font-family: var(--font-body);
	font-size: 16px;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.65;
	max-width: 520px;
	margin: 0 auto;
}

.footer-cta-banner__btn {
	display: inline-block;
	background: #ffffff;
	color: var(--primary);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 700;
	padding: 16px 36px;
	border-radius: var(--border-radius);
	text-decoration: none;
	margin-top: 28px;
	transition: background 0.2s ease, color 0.2s ease;
}

.footer-cta-banner__btn:hover {
	background: var(--accent);
	color: #ffffff;
}

/* ── ZONE 4D: Related Posts ──────────────────────────────────── */

.related-posts {
	padding-bottom: 64px;
}

.related-posts__heading {
	font-family: var(--font-heading);
	font-size: 26px;
	font-weight: 600;
	color: var(--body-text);
	margin-bottom: 28px;
}

/* ── Responsive: Tablet (768px–1024px) ──────────────────────── */

@media (max-width: 1024px) {

	.article-hero {
		min-height: 420px;
	}

	.article-title {
		font-size: 34px;
	}

	.article-body__grid {
		grid-template-columns: 1fr;
	}

	/* Hide desktop sidebar — accordion will be injected by JS */
	.article-sidebar {
		display: none;
	}

	.footer-cta-banner__heading {
		font-size: 28px;
	}

}

/* ── Responsive: Mobile (< 768px) ───────────────────────────── */

@media (max-width: 767px) {

	.article-hero {
		min-height: 360px;
	}

	/* Content fills most of the hero on mobile, so the desktop gradient
	   (solid navy past 60%) buries the featured image. Use a lighter,
	   even scrim so the photo shows through the whole section. */
	.article-hero__overlay {
		background: linear-gradient(
			to bottom,
			rgba(5, 79, 125, 0.30) 0%,
			rgba(5, 79, 125, 0.55) 40%,
			rgba(5, 79, 125, 0.82) 100%
		);
	}

	.article-hero__inner {
		padding: 48px 16px 36px;
	}

	.article-title {
		font-size: 26px;
	}

	.article-body {
		padding-top: 32px;
	}

	.article-author {
		flex-wrap: wrap;
	}

	.mid-content-cta {
		padding: 24px 20px;
	}

	.mid-cta-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.mid-cta-button {
		width: 100%;
		text-align: center;
	}

	.author-bio {
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 24px 20px;
	}

	.author-bio__link {
		display: block;
		text-align: center;
	}

	.footer-cta-banner {
		padding: 48px 24px;
		margin: 32px 0;
	}

	.footer-cta-banner__heading {
		font-size: 26px;
	}

}
