/* Base styles */
body {
	font-family: "Nunito", sans-serif;
	background: var(--bg-gradient);
	color: var(--text-color);
	min-height: 100vh;
	margin: 0;
	padding: 0;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Header styles */
header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 20px 0;
	border-bottom: 1px solid var(--border-color-strong);
	margin-bottom: 30px;
}

.contact-info {
	text-align: right;
	color: var(--text-muted);
}

.contact-info h2 {
	font-family: "Helvetica", sans-serif;
	color: var(--heading-color);
	font-size: 1rem;
	margin: 0 0 0.5rem 0;
}

.contact-info p {
	margin: 0.25rem 0;
	font-size: 0.9rem;
}

.contact-info a {
	color: var(--link-color);
	text-decoration: none;
}

.contact-info a:hover {
	text-decoration: underline;
}

/* Blog content - shared */
.blog-content {
	margin-left: 60px;
	margin-right: 20px;
	max-width: none;
	width: auto;
	box-sizing: border-box;
	padding: 2rem;
	color: var(--text-color);
	background: var(--bg-color);
	border-radius: 12px;
}

.blog-content {
	margin-left: 48px;
	margin-right: 20px;
	margin-bottom: 1.5rem;
}
/* Blog post link + external-icon styles (kept here as blog-specific rules) */
.blog-content a {
	text-decoration-color: currentColor;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}
.blog-content a:hover,
.blog-content a:focus {
	text-decoration-color: currentColor !important;
	color: #ffffff !important;
}
.blog-content a:hover .external-link-icon,
.blog-content a:focus .external-link-icon {
	color: #ffffff !important;
}
.blog-content .external-link-icon {
	margin-right: 0.5ch; /* match portfolio spacing after icon */
}

#posts-heading {
	text-align: left;
	color: var(--heading-color);
	font-size: clamp(1.5rem, 4vw, 2.5rem);
	margin-bottom: 1.5rem;
	text-shadow: var(--heading-shadow);
}

/* Blog Header Layout */
.blog-header-wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
}

/* Filter Box Styles */
#filter-container {
	padding: 1.5rem;
	border: 1px solid var(--border-color-strong);
	border-radius: 8px;
	background: var(--bg-color);
}

.filter-header {
	font-family: "Helvetica", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: var(--heading-color);
	margin: 0 0 1rem 0;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
}

.tag-btn {
	background: var(--code-bg);
	border: 1px solid var(--border-color-strong);
	color: var(--text-color);
	padding: 6px 12px;
	border-radius: 20px;
	cursor: pointer;
	font-size: 0.9rem;
	font-family: "Nunito", sans-serif;
}

.tag-btn:hover {
	border-color: var(--link-color);
	color: var(--link-color);
}

.tag-btn.active {
	background: var(--link-color);
	color: #000000;
	font-weight: 700;
	border-color: var(--link-color);
}

.tag-btn.inactive {
	opacity: 0.5;
	background: var(--bg-color);
}

.clear-filter-btn {
	margin-left: auto;
	background: transparent;
	border: 1px solid var(--border-color);
	color: var(--text-muted);
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.85rem;
}

.clear-filter-btn:hover {
	color: var(--text-color);
	border-color: var(--text-color);
}

/* Blog index article styles */
.blog-content article h3,
.blog-content .blog-post-item h2 {
	margin: 0 0 0.5rem 0;
}

.blog-content article h3 a,
.blog-content .blog-post-item h2 {
	color: var(--heading-color);
	text-decoration: none;
	font-size: 1.4rem;
}

.blog-content article h3 a:hover,
.blog-content .blog-post-item:hover h2 {
	text-shadow: var(--heading-shadow);
	color: #ffffff; /* use white on hover to match portfolio */
}

/* Ensure hover/focus color change transitions smoothly for links and their icons */
.blog-content article h3 a,
.blog-content .blog-post-item .post-image a,
.blog-content article a {
	transition:
		color 160ms ease,
		text-shadow 160ms ease;
}

/* Make external icons in blog content inherit the hover color (white) */
.blog-content a:hover .external-link-icon,
.blog-content a:focus .external-link-icon {
	color: #ffffff;
}

.blog-content article hr {
	border: none;
	border-top: 1px solid var(--border-color-strong);
	margin: 1.5rem 0;
}

/* Post meta (date/author) */
.post-meta {
	color: var(--text-muted);
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

/* Image link wrapper */
.blog-content:not(.single-post) .post-image a,
.blog-content:not(.single-post) .blog-post-link {
	display: block;
	text-decoration: none;
}

/* Blog list view cover containers */
.blog-content:not(.single-post) .post-image,
.blog-content .blog-post-item .post-image {
	max-width: 66%;
	position: relative;
	min-height: 220px;
}

.blog-content:not(.single-post) .post-image.is-loading::after,
.blog-content .blog-post-item .post-image.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	background: var(--code-bg);
}

.blog-content:not(.single-post) .post-image.is-loading::before,
.blog-content .blog-post-item .post-image.is-loading::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 2px solid var(--border-color-strong);
	border-top-color: var(--link-color);
	border-radius: 50%;
	animation: post-image-spin 0.8s linear infinite;
	z-index: 1;
}

@keyframes post-image-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.blog-content:not(.single-post) .post-image.is-loading::before,
	.blog-content .blog-post-item .post-image.is-loading::before {
		animation: none;
		border-top-color: var(--border-color-strong);
	}
}

/* Blog list view images - constrained for consistent cover look */
.blog-content:not(.single-post) .post-image img,
.blog-content .blog-post-item .post-image img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	margin-bottom: 15px;
	transition:
		border-color 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease,
		opacity 0.25s ease;
	position: relative;
	z-index: 2;
}

.blog-content:not(.single-post) .post-image img.is-loading,
.blog-content .blog-post-item .post-image img.is-loading {
	opacity: 0;
}

.blog-content:not(.single-post) .post-image a:hover img,
.blog-content .blog-post-item:hover .post-image img {
	border-color: var(--link-color);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px var(--shadow-color);
}

/* Single post styles */
.single-post .post-image {
	margin-bottom: 2rem;
}

.single-post .post-image img {
	width: auto;
	max-width: 100%;
	max-height: 600px;
	object-fit: contain;
	display: inline;
	margin: 0 auto;
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
}

@media (max-width: 768px) {
	.blog-content:not(.single-post) .post-image,
	.blog-content .blog-post-item .post-image {
		max-width: 100%;
	}
}

.single-post h1 {
	font-size: 2.2rem;
	margin-bottom: 0.5rem;
}

.single-post h2 {
	color: var(--heading-color);
	font-size: 1.6rem;
	margin-top: 2.5rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border-color-strong);
}

.single-post h3 {
	color: var(--subheading-color);
	font-size: 1.3rem;
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}

.single-post h4 {
	color: var(--subheading-color);
	font-size: 1.1rem;
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
}

.single-post p {
	margin-bottom: 1.2rem;
	line-height: 1.7;
}

.single-post a {
	color: var(--link-color);
}

.single-post a:hover {
	text-decoration: underline;
}

/* Ensure all in-article links have a clear hover effect and a smooth transition */
.single-post a {
	transition:
		color 160ms ease,
		text-decoration-color 160ms ease;
}
.single-post a:focus,
.single-post a:hover {
	text-decoration-thickness: 2px;
	text-decoration-color: var(--link-color);
	outline: none;
}

/* Stronger hover for attribution links where !important rules exist */
.single-post .attributions a:hover {
	color: var(--link-color) !important;
	text-decoration: underline !important;
}

/* Lists */
.single-post ul,
.single-post ol {
	margin-bottom: 1.2rem;
	padding-left: 2rem;
}

.single-post li {
	margin-bottom: 0.5rem;
	line-height: 1.6;
}

/* Blockquotes */
.single-post blockquote {
	border-left: 3px solid var(--accent-color);
	margin: 1.5rem 0;
	padding: 1rem 1.5rem;
	background: var(--code-bg);
	border-radius: 0 4px 4px 0;
}

.single-post blockquote p {
	margin-bottom: 0.5rem;
}

.single-post blockquote p:last-child {
	margin-bottom: 0;
}

.single-post blockquote cite {
	display: block;
	color: var(--text-muted);
	font-style: italic;
	margin-top: 0.5rem;
}

.single-post blockquote.pullquote {
	border-left-width: 4px;
	font-size: 1.1rem;
	font-style: italic;
}

/* Code blocks */
.single-post code {
	font-family: "Consolas", "Monaco", monospace;
	background: var(--code-bg);
	border-radius: 3px;
	font-size: 0.9em;
	color: var(--text-color);
}

.single-post pre {
	background: var(--code-bg);
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	padding: 1rem;
	overflow-x: auto;
	margin: 1.5rem 0;
}

.single-post pre code {
	background: none;
	padding: 0;
	font-size: 0.85rem;
	line-height: 1.5;
}

/* Video layout helpers */
.video-wrap {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	margin: 1.5rem 0;
}
.video-wrap > div {
	flex: none;
	width: 100%;
	max-width: 860px;
}
.video-right {
	flex: none;
	width: 100%;
	float: none;
	margin-left: 0;
}
.embed {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
}
.embed iframe {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.embed-full {
	width: 100%;
	max-width: 860px;
	margin: 1.2rem 0;
	/* Keep original 16:9 aspect ratio */
	padding-top: 56.25%;
	position: relative;
}
.embed-full iframe {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

/* Override site-wide iframe rule under #content which forces height:auto in overlay.css
   Make sure embeds inside the article fill their aspect-ratio box. */
#content .embed iframe,
#content .embed-full iframe {
	height: 100%;
}

/* Diagram layout with arrows */
.diagram {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: center;
	margin: 1.2rem 0;
}

.diagram-wrap {
	display: flex;
	align-items: stretch;
	gap: 1rem;
	justify-content: center;
}
.abstraction-arrow {
	width: 56px;
	display: flex;
	position: relative;
	flex-shrink: 0;
	align-items: stretch; /* stretch to match .diagram height */
	justify-content: center;
	color: var(--text-muted);
}
.abstraction-line {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	background: currentColor;
	opacity: 0.9;
	transform: translateX(-50%);
	z-index: 1;
}
.arrow-head {
	position: absolute;
	left: 50%;
	top: 0;
	transform: translate(-50%, -50%) rotate(0deg);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 10px solid currentColor; /* triangle tip upward */
	z-index: 2;
}
.abstraction-label {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) rotate(-90deg);
	z-index: 3;
	white-space: nowrap;
	padding: 8px 10px;
	background: var(
		--bg-color-solid,
		#ffffff
	); /* use solid background to avoid underlying rules bleeding through */
	color: var(--text-color);
	font-weight: 800;
	font-family:
		system-ui,
		-apple-system,
		"Segoe UI",
		Roboto,
		"Helvetica Neue",
		Arial,
		sans-serif;
	font-size: 1.25rem;
	letter-spacing: 0.02em;
	border-radius: 4px;
}
.implementation-arrow {
	width: 56px;
	display: flex;
	position: relative;
	flex-shrink: 0;
	align-items: stretch; /* stretch to match .diagram height */
	justify-content: center;
	color: var(--text-muted);
}
.implementation-line {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	background: currentColor;
	opacity: 0.9;
	transform: translateX(-50%);
	z-index: 1;
}
.implementation-arrow .arrow-head {
	position: absolute;
	left: 50%;
	top: auto; /* ensure this is not anchored at the top */
	bottom: 0;
	transform: translate(-50%, 50%);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 10px solid currentColor; /* triangle tip downward */
	border-bottom: none; /* explicitly remove any upward tip from global rule */
	z-index: 2;
}
.implementation-label {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) rotate(90deg);
	z-index: 3;
	white-space: nowrap;
	padding: 8px 10px;
	background: var(
		--bg-color-solid,
		#ffffff
	); /* solid background to block underlying rule lines */
	color: var(--text-color);
	font-weight: 800;
	font-family:
		system-ui,
		-apple-system,
		"Segoe UI",
		Roboto,
		"Helvetica Neue",
		Arial,
		sans-serif;
	font-size: 1.25rem;
	letter-spacing: 0.02em;
	border-radius: 4px;
}
.diagram .step {
	background: var(--code-bg);
	padding: 0.8rem 1rem;
	border-radius: 6px;
	width: 100%;
	max-width: 860px;
	text-align: center;
	border: 1px solid var(--border-color-strong);
}
.diagram .arrow {
	width: 24px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.diagram .arrow svg {
	width: 18px;
	height: 28px;
	fill: var(--text-muted);
	transform-box: fill-box;
	/* rotate small arrows to point upward */
	transform: rotate(180deg);
}

@media (max-width: 800px) {
	.video-wrap {
		flex-direction: column;
	}
	.video-right {
		width: 100%;
		float: none;
	}
	.embed-full {
		padding-top: 56.25%;
	}
}

.single-post pre.error-output {
	border-color: #ff6666;
	background: rgba(255, 0, 0, 0.1);
}

.single-post pre.error-output code {
	color: #ff9999;
}

/* Figures and images */
.single-post figure.post-figure {
	margin: 1.5rem 0;
}

.single-post figure.post-figure img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
}

.single-post figure.post-figure.book-cover {
	float: right;
	margin: 0 0 1rem 1.5rem;
	max-width: 250px;
}

.single-post figure.post-figure figcaption {
	color: var(--text-muted);
	font-size: 0.85rem;
	font-style: italic;
	margin-top: 0.5rem;
}

/* In-article images (not in figures) */
.single-post img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	margin-bottom: 15px;
}

/* Click-to-zoom diagrams (opt-in via .diagram-zoom) */
.diagram-zoom {
	margin: 0 0 15px;
}

.diagram-zoom__trigger {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: zoom-in;
	text-align: left;
}

.diagram-zoom__trigger img {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 0;
}

.diagram-zoom__trigger:hover img,
.diagram-zoom__trigger:focus-visible img {
	border-color: var(--link-color);
}

.diagram-zoom__dialog {
	position: relative;
	max-width: min(96vw, 1400px);
	max-height: 96vh;
	padding: 2.5rem 1rem 1rem;
	border: 1px solid var(--border-color-strong);
	border-radius: 6px;
	background: var(--bg-color-solid, #111);
	color: var(--text-color);
}

.diagram-zoom__dialog::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.diagram-zoom__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 1;
	padding: 0.35rem 0.75rem;
	font: inherit;
	color: var(--text-color);
	background: var(--code-bg);
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	cursor: pointer;
}

.diagram-zoom__close:hover,
.diagram-zoom__close:focus-visible {
	border-color: var(--link-color);
	color: var(--link-color);
}

.diagram-zoom__dialog-image {
	display: block;
	max-width: 96vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: 0 auto;
	border: none;
}

/* Edit notes */
.single-post .edit-note {
	background: rgba(255, 200, 0, 0.1);
	border-left: 3px solid #ffcc00;
	padding: 0.75rem 1rem;
	border-radius: 0 4px 4px 0;
	font-size: 0.95rem;
}

/* Prominent callout warnings (spoilers, photosensitivity, etc.) */
.single-post .post-callout {
	margin: 1em 0;
}

.single-post .photosensitivity-warning,
.blog-content .photosensitivity-warning {
	background: #fff4e5;
	border-left: 4px solid #ffae00;
	padding: 12px;
	margin: 0 0 1em;
	color: #222;
}

.blog-content a.warning-link {
	color: #0366d6;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: currentColor;
}

.blog-content a.warning-link:hover,
.blog-content a.warning-link:focus {
	color: #16b3f1 !important;
	text-decoration-color: currentColor !important;
}

/* Highlighted text */
.single-post .highlight {
	background: var(--shadow-color);
	padding: 1rem;
	border-radius: 4px;
	font-size: 1.05rem;
}

/* Table of contents */
.single-post .toc {
	background: var(--code-bg);
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	padding: 1rem 1.5rem;
	margin: 1.5rem 0;
}

/* Post-specific floating TOC placed to the right of the opening section */
.post-toc {
	float: right;
	width: 240px;
	margin-left: calc(
		1.25rem + 6px
	); /* slightly larger breathing room to ensure visibility in Chrome */
	margin-top: 1rem;
	padding-left: 1rem;
	position: relative; /* allow z-index to take effect */
	z-index: 9999;
	isolation: isolate;
	mix-blend-mode: normal;
	background-color: var(--bg-color-solid, #ffffff) !important;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	border-radius: 6px;
	border: 1px solid var(--border-color-strong);
}

/* Solid backing to prevent underlying rules bleeding through */
.post-toc::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--bg-color-solid, #ffffff);
	z-index: 10000;
	border-radius: inherit;
	pointer-events: none;
}
.post-toc > * {
	position: relative;
	z-index: 10001;
}

@media (max-width: 980px) {
	.post-toc {
		float: none;
		width: 100%;
		margin-left: 0;
	}
}

/* Layout wrapper for the TOC plus the intro paragraph/blockquote */
.toc-intro-wrap {
	display: flex;
	gap: 0.75rem; /* breathing room between content and TOC */
	align-items: flex-start;
}
.toc-intro-wrap .toc-content {
	flex: 1 1 auto;
	min-width: 0; /* allow proper shrinking in flex layout */
}
.toc-intro-wrap .post-toc {
	flex: 0 0 240px;
	width: 240px;
	margin-left: 0; /* gap handled by flex gap */
}

@media (max-width: 980px) {
	.toc-intro-wrap {
		display: block;
	}
	.toc-intro-wrap .post-toc {
		width: 100%;
		margin: 0 0 1rem 0;
	}
}

/* Let the article body use the full available width. TOC spacing is handled by
   .toc-intro-wrap when present, so the whole post should not permanently reserve
   space on the right. */
.blog-content.single-post {
	position: relative;
	padding-right: 2rem;
}

@media (max-width: 980px) {
	.blog-content.single-post {
		padding-right: 1.5rem;
	}
}

.single-post .toc-heading {
	font-family: "Helvetica", sans-serif;
	color: var(--heading-color);
	margin: 0 0 0.75rem 0;
	font-size: 1rem;
}

.single-post .toc ol {
	margin: 0;
	padding-left: 1.5rem;
}

.single-post .toc li {
	margin-bottom: 0.25rem;
}

.single-post .toc a {
	color: var(--text-muted);
}

.single-post .toc a:hover {
	color: var(--link-color);
}

/* Collapsible details/summary */
.single-post details {
	margin: 1.5rem 0;
	border: 1px solid var(--border-color-strong);
	border-radius: 4px;
	overflow: hidden;
}

.single-post details summary {
	background: var(--code-bg);
	padding: 0.75rem 1rem;
	cursor: pointer;
	color: var(--heading-color);
	font-weight: 600;
}

.single-post details summary:hover {
	background: var(--shadow-color);
}

.single-post details[open] summary {
	border-bottom: 1px solid var(--border-color-strong);
}

.single-post details > *:not(summary) {
	padding: 0 1rem;
}

/* Attributions list */
.single-post .attributions {
	text-align: left;
	font-size: 0.9rem;
	color: var(--text-muted);
}

/* Ensure attributions and the final thanks line are left-aligned within the article */
.single-post .attributions,
.single-post .thanks {
	text-align: left;
	margin-left: 0;
}

/* Ensure the final thanks and attributions do not float beside the TOC */
.single-post .thanks {
	clear: both;
	display: block;
}

.single-post .attributions {
	clear: both;
	display: block;
	margin-top: 1rem;
}

/* Strong overrides to ensure left alignment and full-width layout for final blocks */
.single-post .attributions,
.single-post .thanks {
	clear: both !important;
	float: none !important;
	display: block !important;
	width: 100% !important;
	margin-left: 0 !important;
	padding-left: 0.5rem !important;
	text-align: left !important;
}
.single-post ul.attributions {
	list-style-position: outside !important;
}

.single-post .attributions a {
	color: var(--link-color);
	text-decoration: none;
}

/* Make the Attributions header full-width and left-aligned (clear floating TOC) */
.single-post h2#attributions {
	clear: both !important;
	float: none !important;
	width: 100% !important;
	text-align: left !important;
	margin-left: 0 !important;
	padding-left: 0 !important;
}

/* Normalize attributions list styling to match article content */
.single-post ul.attributions {
	list-style: disc outside;
	padding-left: 1.25rem !important;
	margin-left: 0 !important;
	color: var(--text-muted);
	font-size: 1rem !important;
	line-height: 1.7 !important;
	font-family: inherit !important;
}

.single-post ul.attributions li {
	margin-bottom: 0.5rem !important;
	color: var(--text-color) !important;
}

.single-post ul.attributions a {
	color: var(--link-color) !important;
}

/* Strikethrough */
.single-post s {
	color: #888888;
}

/* Mark/highlight in code */
.single-post mark {
	background: rgba(255, 255, 0, 0.3);
	color: inherit;
	padding: 0.1rem 0.2rem;
	border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	header {
		flex-direction: column;
		align-items: flex-start;
	}

	.contact-info {
		text-align: left;
		margin-top: 1rem;
	}

	.blog-content {
		padding: 1.5rem;
		margin-left: 1rem;
		margin-right: 1rem;
	}

	.single-post h1 {
		font-size: 1.8rem;
	}

	.single-post h2 {
		font-size: 1.4rem;
	}

	.single-post figure.post-figure.book-cover {
		float: none;
		margin: 1rem auto;
		max-width: 200px;
	}
}

/* Portrait mode adjustments (vertical monitors) */
@media (max-aspect-ratio: 1/1) {
	.blog-content {
		max-width: none;
	}
}

/* Large screens: no special absolute positioning; keep a single consistent TOC rule above */

/* High-specificity safety override to prevent the TOC from expanding to full width
   in browsers that might interpret earlier rules differently (Chrome caching
   or conflicting selectors). Targets the TOC when it's a direct child of the
   article content container. */
.single-post .blog-content > .post-toc {
	float: right !important;
	display: block !important;
	width: 240px !important;
	max-width: 240px !important;
	margin-left: calc(1.25rem + 6px) !important; /* match global TOC gap */
}
