/**
 * Article page: header, prose typography, post navigation.
 */

.article-header {
	max-width: var(--content-max);
	margin-inline: auto;
	padding-block: var(--space-7) var(--space-6);
	text-align: left;
}

.article-header__title {
	font-size: var(--fs-3xl);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.03em;
	margin-block: var(--space-3) var(--space-4);
}

.article-header__intro {
	font-size: var(--fs-md);
	color: var(--color-text-secondary);
	line-height: var(--lh-relaxed);
	margin-bottom: var(--space-4);
}

.article-header__meta {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding-top: var(--space-4);
	border-top: 1px solid var(--color-border);
}

.author-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--color-surface);
	flex-shrink: 0;
}

.author-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.author-meta__name {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-text);
}

.video-embed {
	position: relative;
	max-width: var(--content-max);
	margin-inline: auto;
	margin-bottom: var(--space-6);
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-lg);
	overflow: hidden;
	border: 1px solid var(--color-border);
	background: var(--color-bg-elevated);
	box-shadow: var(--shadow-md);
}

.video-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.article-featured-image {
	max-width: var(--container-max);
	margin-inline: auto;
	margin-bottom: var(--space-7);
	border-radius: var(--radius-lg);
	overflow: hidden;
	border: 1px solid var(--color-border);
	box-shadow: var(--shadow-md);
}

.article-body {
	max-width: var(--content-max);
	margin-inline: auto;
	font-size: var(--fs-base);
	line-height: var(--lh-relaxed);
	color: var(--color-text);
}

.article-body > * + * {
	margin-top: var(--space-5);
}

.article-body h2,
.article-body h3,
.article-body h4 {
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: var(--lh-tight);
	scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

.article-body h2 {
	position: relative;
	font-size: var(--fs-xl);
	font-weight: 800;
	margin-top: var(--space-7) !important;
	padding-top: var(--space-5);
}

.article-body h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 48px;
	height: 2px;
	background: var(--gradient-brand);
	border-radius: 2px;
}

.article-body h3 {
	font-size: var(--fs-lg);
	margin-top: var(--space-6) !important;
}

.article-body h4 {
	font-size: var(--fs-md);
	margin-top: var(--space-5) !important;
}

.article-body p {
	color: var(--color-text);
}

.article-body a {
	color: var(--color-accent-strong);
	text-decoration: none;
	background-image: var(--gradient-brand);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 100% 1px;
	padding-bottom: 1px;
	transition: background-size var(--transition-fast);
}

.article-body a:hover {
	background-size: 100% 2px;
}

.article-body ul,
.article-body ol {
	padding-inline-start: 1.4em;
}

.article-body ul {
	list-style: disc;
}

.article-body ol {
	list-style: decimal;
}

.article-body li + li {
	margin-top: var(--space-2);
}

.article-body li::marker {
	color: var(--color-accent-strong);
}

.article-body blockquote {
	position: relative;
	padding: var(--space-4) var(--space-5) var(--space-4) var(--space-6);
	background: var(--color-surface);
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
	color: var(--color-text-secondary);
	font-style: italic;
}

.article-body blockquote::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 3px;
	border-radius: 3px 0 0 3px;
	background: var(--gradient-brand);
}

.article-body blockquote p {
	margin: 0;
}

.article-body figure {
	margin: 0;
}

.article-body figure img {
	border-radius: var(--radius-md);
	border: 1px solid var(--color-border);
}

.article-body figcaption {
	margin-top: var(--space-2);
	font-size: 0.8125rem;
	color: var(--color-text-tertiary);
	text-align: center;
}

.article-body hr {
	border: none;
	border-top: 1px solid var(--color-border);
}

.article-body strong {
	color: var(--color-text);
	font-weight: 700;
}

/* Inline code only — fenced/pre code blocks are styled in code.css and must
   not inherit this (their color comes from Prism token classes). */
.article-body :not(pre) > code {
	font-family: var(--font-mono);
	font-size: 0.875em;
	color: var(--color-cyan);
	background: var(--color-bg-elevated);
	border: 1px solid var(--color-border);
	padding: 0.15em 0.45em;
	border-radius: var(--radius-sm);
}

.article-body table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-sm);
	display: block;
	overflow-x: auto;
}

.article-body th,
.article-body td {
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--color-border);
	text-align: left;
}

.article-body th {
	background: var(--color-surface);
	font-weight: 600;
	color: var(--color-text);
}

.article-tags {
	max-width: var(--content-max);
	margin-inline: auto;
	margin-top: var(--space-6);
}

/* ---------- Post navigation (prev/next) ---------- */
.post-nav {
	max-width: var(--content-max);
	margin-inline: auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-4);
}

.post-nav__link {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	padding: var(--space-5);
	border: 1px solid transparent;
	border-radius: var(--radius-lg);
	background: linear-gradient(var(--color-surface), var(--color-surface)) padding-box, linear-gradient(var(--color-border), var(--color-border)) border-box;
	transition: transform var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
	height: 100%;
}

.post-nav__link:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	background: linear-gradient(var(--color-surface), var(--color-surface)) padding-box, var(--gradient-border) border-box;
}

.post-nav__link--next {
	text-align: right;
	align-items: flex-end;
}

.post-nav__label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text-tertiary);
}

.post-nav__title {
	font-weight: 700;
	font-size: var(--fs-sm);
	line-height: var(--lh-tight);
}

@media (max-width: 640px) {
	.post-nav {
		grid-template-columns: 1fr;
	}

	.article-header__title {
		font-size: var(--fs-2xl);
	}
}

/* ---------- Related articles ---------- */
.related-articles {
	max-width: var(--container-max);
	margin-inline: auto;
}
