/* =====================================================================
   Single blog post — Revision-style hero + sticky metabar + sidebar.
   Class prefix: .bp-*
   ===================================================================== */

:root {
	--bp-radius: 16px;
	--bp-radius-sm: 10px;
	--bp-shadow-soft: 0 5px 25px 0 rgba(24, 24, 27, 0.06);
	--bp-shadow-card: 0 8px 32px 0 rgba(24, 24, 27, 0.08);
	--bp-content-max: 720px;
	--bp-grid-gap: 56px;
}

.bp-page {
	padding: 0 0 96px;
}

.bp-container { max-width: 1280px; }

/* Vertical rhythm for top-level sections only (not sidebar widgets). */
.bp-page > section {
	padding: 40px 0;
	position: relative;
}

/* ==================== HERO ==================== */
.bp-hero { margin-bottom: 10px; }

.bp-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--text-light);
	margin-bottom: 28px;
}

.bp-breadcrumbs a {
	color: var(--text-light);
	text-decoration: none;
	transition: color 0.2s;
}
.bp-breadcrumbs a:hover { color: var(--violet); }

.bp-breadcrumbs .bp-sep { color: var(--text-light); opacity: 0.5; }

.bp-breadcrumbs .bp-crumb-current,
.bp-breadcrumbs .breadcrumb_last {
	color: var(--text);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 320px;
}

/* Asymmetric split — text left, image right. Stacks on mobile. */
.bp-hero-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: center;
}

@media (min-width: 768px) {
	.bp-hero-grid {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
		gap: 56px;
	}
}

@media (min-width: 1200px) {
	.bp-hero-grid {
		grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
		gap: 72px;
	}
}

/* When there's no featured image, fall back to a single centered column. */
.bp-hero-grid--solo {
	grid-template-columns: minmax(0, 820px);
	justify-content: center;
}
.bp-hero-grid--solo .bp-header { text-align: center; }
.bp-hero-grid--solo .bp-cats { justify-content: center; }
.bp-hero-grid--solo .bp-meta-top { justify-content: center; }

.bp-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 22px;
}

.bp-meta-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--text-light);
}

.bp-meta-author {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--text);
	transition: opacity 0.2s;
}
.bp-meta-author:hover { opacity: 0.75; }

.bp-meta-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

.bp-meta-author-name { font-weight: 600; color: var(--text); }

.bp-meta-sep { opacity: 0.4; }

.bp-meta-date { color: var(--text-light); }
.bp-meta-on { margin-right: 4px; opacity: 0.7; }

.bp-title {
	margin: 0;
	font-size: clamp(30px, 3.6vw, 48px);
	line-height: 1.1;
	letter-spacing: -0.025em;
	color: var(--text);
	text-wrap: balance;
}

.bp-subtitle {
	margin: 0;
	font-size: clamp(16px, 1.3vw, 18px);
	line-height: 1.55;
	color: var(--text-light);
	text-wrap: pretty;
}

.bp-cats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bp-cats a {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	background: rgba(124, 58, 237, 0.12);
	color: var(--violet-light);
	border: 1px solid rgba(124, 58, 237, 0.25);
	border-radius: 999px;
	transition: background-color 0.2s;
}
.bp-cats a:hover { background: rgba(124, 58, 237, 0.2); }

/* Right-column image — 16:9 accent matching the cover art's native ratio,
   so the full image shows edge-to-edge: no crop, no letterbox. */
.bp-hero-art {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--bp-radius);
	background: var(--bg-light-3);
	max-height: 520px;
}

.bp-hero-art-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@media (max-width: 767.98px) {
	.bp-hero-art {
		order: -1; /* image above text on narrow screens */
	}
}

/* ==================== MAIN LAYOUT ==================== */
.bp-layout { margin-top: 20px; }

.bp-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
}

@media (min-width: 992px) {
	.bp-grid {
		grid-template-columns: 160px minmax(0, 1fr) 300px;
		gap: var(--bp-grid-gap);
		align-items: start;
	}
}

/* ==================== METABAR (left, sticky) ==================== */
.bp-metabar { display: none; }

@media (min-width: 992px) {
	.bp-metabar {
		display: block;
		position: sticky;
		top: 92px; /* 68px sticky header + 24px breathing room */
	}
}

.bp-metabar-inner {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* Reading progress circle */
.bp-reading {
	position: relative;
	width: 80px;
	height: 80px;
}

.bp-reading-svg {
	position: absolute;
	inset: 0;
	transform: rotate(-90deg);
}

.bp-reading-track {
	stroke: var(--border-dark);
	stroke-width: 2;
	fill: none;
}

.bp-reading-progress {
	stroke: var(--violet);
	stroke-width: 2.5;
	stroke-linecap: round;
	fill: none;
	stroke-dasharray: 238.795;
	stroke-dashoffset: 238.795;
	transition: stroke-dashoffset 60ms linear;
}

.bp-reading-label {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
	color: var(--text);
	letter-spacing: -0.02em;
	line-height: 1;
}

.bp-reading-unit {
	margin-top: 2px;
	font-size: 10px;
	font-weight: 600;
	color: var(--text-light);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* TOC */
.bp-toc[hidden] { display: none; }

.bp-toc-h {
	margin: 0 0 12px;
	font-size: 11px;
	font-weight: 700;
	color: var(--text-light);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.bp-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	border-left: 1px solid var(--border-dark);
}

.bp-toc-list li { position: relative; }

.bp-toc-list a {
	display: block;
	padding: 6px 0 6px 14px;
	margin-left: -1px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--text-light);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: color 0.2s, border-color 0.2s;
}

.bp-toc-list a:hover { color: var(--violet); }

.bp-toc-list a.is-active {
	color: var(--violet);
	font-weight: 600;
	border-left-color: var(--violet);
}

/* Share (vertical) */
.bp-share-h {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--text-light);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 12px;
}

.bp-share-list {
	display: grid;
	grid-template-columns: repeat(2, 40px);
	gap: 8px;
}

.bp-share-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--bg-light-2);
	border: 1px solid var(--border-dark);
	color: var(--text-light);
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.bp-share-link:hover {
	color: var(--violet);
	border-color: rgba(124, 58, 237, 0.25);
	background: rgba(124, 58, 237, 0.08);
}

.bp-share-link svg { width: 18px; height: 18px; }

.bp-share-copy { padding: 0; }

.bp-share-copied {
	position: absolute;
	left: 100%;
	margin-left: 10px;
	padding: 4px 10px;
	background: var(--violet);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
}
.bp-share-copied.is-visible { opacity: 1; }

/* ==================== ARTICLE BODY ==================== */
.bp-article {
	max-width: var(--bp-content-max);
	margin: 0 auto;
	width: 100%;
	min-width: 0;   /* grid item must collapse so wide <pre> code blocks scroll instead of widening the column on mobile */
}

@media (min-width: 992px) {
	.bp-article { margin: 0; }
}

.bp-content {
	font-size: 17px;
	line-height: 1.7;
	color: var(--text);
	min-width: 0;   /* grid item must collapse so wide <pre> code blocks scroll (overflow-x:auto) instead of widening the column on mobile */
}

.bp-content > * { margin: 0 0 28px; }
.bp-content > *:last-child { margin-bottom: 0; }

.bp-content p { margin: 0 0 28px; }

.bp-content a {
	color: var(--violet);
	text-decoration: underline;
	text-decoration-color: rgba(124, 58, 237, 0.3);
	text-underline-offset: 3px;
	text-decoration-thickness: 1.5px;
	transition: text-decoration-color 0.2s;
}
.bp-content a:hover { text-decoration-color: var(--violet); }

.bp-content strong { font-weight: 700; color: var(--text); }

.bp-content h2,
.bp-content h3,
.bp-content h4 {
	margin: 48px 0 16px;
	color: var(--text);
	letter-spacing: -0.02em;
	scroll-margin-top: 92px; /* clears sticky header on TOC anchor clicks */
}

.bp-content h2 { font-size: 30px; line-height: 1.2; }
.bp-content h3 { font-size: 22px; line-height: 1.3; }
.bp-content h4 { font-size: 18px; line-height: 1.35; }

.bp-content ul,
.bp-content ol {
	margin: 0 0 28px;
	padding-left: 24px;
}

.bp-content li {
	margin-bottom: 8px;
	line-height: 1.65;
}

.bp-content li::marker { color: var(--violet); }

.bp-content blockquote {
	position: relative;
	margin: 36px 0;
	padding: 28px 32px 28px 60px;
	background: var(--bg-light-2);
	border-radius: var(--bp-radius);
	font-size: 19px;
	line-height: 1.5;
	color: var(--text);
	font-style: italic;
}

.bp-content blockquote::before {
	content: '"';
	position: absolute;
	left: 22px;
	top: 14px;
	font-family: Georgia, serif;
	font-size: 56px;
	line-height: 1;
	color: var(--violet);
	opacity: 0.5;
}

.bp-content blockquote p { margin: 0 0 12px; }
.bp-content blockquote p:last-child { margin-bottom: 0; }

.bp-content blockquote cite {
	display: block;
	margin-top: 14px;
	font-size: 13px;
	font-weight: 600;
	font-style: normal;
	color: var(--text-light);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.bp-content figure {
	margin: 36px 0;
}

.bp-content figure img,
.bp-content > img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--bp-radius);
}

.bp-content figure.alignwide {
	width: calc(100% + 80px);
	margin-left: -40px;
	margin-right: -40px;
}

@media (max-width: 991.98px) {
	.bp-content figure.alignwide {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

.bp-content figcaption {
	margin-top: 12px;
	font-size: 13px;
	color: var(--text-light);
	text-align: center;
}

/* Inline code */
.bp-content :not(pre) > code {
	padding: 2px 6px;
	font-family: "JetBrains Mono", "Menlo", monospace;
	font-size: 0.88em;
	background: var(--bg-light-2);
	color: var(--violet);
	border-radius: 4px;
}

/* Code blocks (pre) */
.bp-content pre,
.bp-content .wp-block-code,
.bp-content .wp-block-preformatted {
	position: relative;
	margin: 32px 0;
	padding: 22px 24px;
	background: #18181b;
	color: #f4f4f5;
	border-radius: var(--bp-radius-sm);
	font-family: "JetBrains Mono", "Menlo", monospace;
	font-size: 13.5px;
	line-height: 1.6;
	overflow-x: auto;
}

.bp-content pre code {
	padding: 0;
	background: transparent;
	color: inherit;
	font-size: inherit;
}

/* Copy button injected into pre by JS */
.bp-code-copy {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.08);
	color: #f4f4f5;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 6px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s, background-color 0.2s;
}
.bp-content pre:hover .bp-code-copy { opacity: 1; }
.bp-code-copy:hover { background: rgba(255, 255, 255, 0.16); }
.bp-code-copy.is-copied { background: var(--violet); border-color: var(--violet); }

/* Tables */
.bp-content table {
	width: 100%;
	margin: 32px 0;
	border-collapse: collapse;
	font-size: 15px;
}

.bp-content th,
.bp-content td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--border-dark);
}

.bp-content th {
	font-weight: 700;
	color: var(--text);
	background: var(--bg-light-2);
}

/* hr */
.bp-content hr {
	margin: 48px 0;
	border: 0;
	height: 1px;
	background: var(--border-dark);
}

/* ==================== ARTICLE FOOTER ==================== */
.bp-article-footer {
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--border-dark);
}

.bp-footer-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.bp-footer-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

/* ==================== SIDEBAR ==================== */
.bp-sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

/* On desktop, the Related widget sticks once the reader scrolls past
   the About card — same top inset as the left metabar. The sidebar
   column itself is stretched to the row height so the sticky has room
   to ride alongside the article. */
@media (min-width: 992px) {
	.bp-sidebar { align-self: stretch; }

	.bp-w-related {
		position: sticky;
		top: 92px;
	}
}

.bp-widget {
	background: #fff;
	padding: 24px;
	border-radius: var(--bp-radius);
	box-shadow: var(--bp-shadow-soft);
}

.bp-widget-h {
	margin: 0 0 18px;
	font-size: 13px;
	font-weight: 700;
	color: var(--text-light);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* About author card */
.bp-author-card {
	display: block;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s;
}
.bp-author-card:hover { opacity: 0.92; }

.bp-author-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 12px;
}

.bp-author-name {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--text);
}
.bp-author-card:hover .bp-author-name { color: var(--violet); }

.bp-author-bio {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--text-light);
}

.bp-author-stats {
	display: flex;
	gap: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--border-dark);
}

.bp-author-stat { display: flex; flex-direction: column; gap: 2px; }
.bp-author-stat-val { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.bp-author-stat-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* Related posts widget */
.bp-related-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.bp-related-item:not(:last-child) {
	padding-bottom: 16px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--border-dark);
}

.bp-related-link {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	align-items: start;
}

.bp-related-thumb {
	display: block;
	aspect-ratio: 1/1;
	overflow: hidden;
	border-radius: var(--bp-radius-sm);
	background: var(--bg-light-3);
}

.bp-related-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.bp-related-link:hover .bp-related-thumb img { transform: scale(1.06); }

.bp-related-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.bp-related-cat {
	font-size: 10px;
	font-weight: 700;
	color: var(--violet);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.bp-related-title {
	margin: 0;
	font-size: 14px;
	line-height: 1.35;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.01em;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s;
}
.bp-related-link:hover .bp-related-title { color: var(--violet); }

.bp-related-date {
	font-size: 11px;
	color: var(--text-light);
	margin-top: 2px;
}

/* ==================== PREV / NEXT ==================== */
.bp-pn { margin-top: 32px; }

.bp-pn-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 768px) {
	.bp-pn-grid { grid-template-columns: 1fr 1fr; }
}

.bp-pn-item {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px 32px;
	background: #fff;
	border-radius: var(--bp-radius);
	box-shadow: var(--bp-shadow-soft);
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s, transform 0.2s;
}
.bp-pn-item:hover {
	box-shadow: var(--bp-shadow-card);
}

.bp-pn-next { text-align: right; align-items: flex-end; }

.bp-pn-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: var(--violet);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.bp-pn-label svg { transition: transform 0.25s ease; }
.bp-pn-prev:hover .bp-pn-label svg { transform: translateX(-3px); }
.bp-pn-next:hover .bp-pn-label svg { transform: translateX(3px); }

.bp-pn-title {
	margin: 0;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--text);
	letter-spacing: -0.01em;
	transition: color 0.2s;
}
.bp-pn-item:hover .bp-pn-title { color: var(--violet); }

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
	.bp-reading-progress { transition: none; }
	.bp-related-link:hover .bp-related-thumb img { transform: none; }
	.bp-pn-label svg { transition: none; }
}

/* ==================== MOBILE POLISH ====================
   The desktop blockquote indent (60px left) and prev/next padding (32px sides)
   eat too much of a 430px column — trim them. End-of-file so it wins the cascade. */
@media (max-width: 600px) {
	.bp-content blockquote { padding: 22px 18px 22px 40px; }
	.bp-content blockquote::before { left: 12px; font-size: 42px; }
	.bp-pn-item { padding: 18px 18px; }
}
