/* QA FIX: move article page styling out of article.html and improve reading hierarchy */
.article-container {
	width: 90%;
	max-width: 1260px;
	margin: 0 auto;
}

.article-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	position: relative;
}

@media (min-width: 1200px) {
	.article-layout {
		grid-template-columns: minmax(0, 820px) 280px;
		gap: 2.5rem;
		justify-content: center;
	}
}

.article-main {
	min-width: 0;
	max-width: 820px;
}

.article-header-modern {
	margin-bottom: 2.25rem;
	padding-bottom: 1.5rem;
	border-bottom: 2px solid var(--border);
	max-width: 65ch;
	margin-left: 0;
	margin-right: 0;
}

.article-header-kicker,
.toc-kicker {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #4b5563;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.75rem;
	margin-bottom: 0.75rem;
}

.article-title-modern {
	/* QA FIX: article headline should read like editorial copy, not a promo banner. */
	font-size: clamp(1.8rem, 3vw, 2.5rem);
	font-weight: 600;
	line-height: 1.18;
	margin: 0 0 0.75rem 0;
	color: #111827;
	max-width: 65ch;
	text-align: left;
	margin-left: 0;
	margin-right: 0;
}

.article-meta-modern {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.article-author-modern {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.article-author-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #374151;
	font-weight: 700;
	font-size: 0.95rem;
	flex-shrink: 0;
	overflow: hidden;
}

.article-author-avatar.has-photo {
	background: var(--border);
	padding: 0;
}

.article-author-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

.article-author-info {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
}

.article-author-name-modern {
	font-weight: 600;
	color: #111827;
	font-size: 0.98rem;
}

.article-author-name-modern:hover {
	color: #111827;
	text-decoration: underline;
}

.article-meta-details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.9rem;
	color: #4b5563;
}

.article-meta-bullet {
	color: #9ca3af;
}

.article-reading-time,
.article-date-modern {
	font-size: 0.9rem;
	color: #4b5563;
}

.article-content-wrapper {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
	position: static;
	overflow: visible;
}

.article-content-modern {
	font-size: 1.1rem;
	line-height: 1.85;
	color: var(--text);
}

.article-content-modern h2 {
	font-size: 1.85rem;
	font-weight: 750;
	line-height: 1.25;
	margin-top: 2.75rem;
	margin-bottom: 1rem;
	color: var(--text);
	scroll-margin-top: 120px;
}

.article-content-modern h2:first-of-type {
	margin-top: 0;
}

.article-content-modern h3 {
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.35;
	margin-top: 2rem;
	margin-bottom: 0.8rem;
	color: var(--text);
	scroll-margin-top: 120px;
}

.article-content-modern h4 {
	font-size: 1.2rem;
	font-weight: 700;
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
	color: var(--text);
}

.article-content-modern p {
	margin-bottom: 1.45rem;
	color: var(--text);
	max-width: 65ch;
}

.article-content-modern ul,
.article-content-modern ol {
	margin: 1.5rem 0;
	padding-left: 2rem;
	max-width: 65ch;
}

.article-content-modern li {
	margin-bottom: 0.75rem;
	line-height: 1.7;
}

.article-content-modern blockquote {
	border-left: 4px solid var(--accent);
	margin: 2rem 0;
	font-style: italic;
	color: var(--muted);
	background: var(--accent-light);
	padding: 1.5rem;
	border-radius: 8px;
	max-width: 65ch;
}

.article-content-modern img {
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	margin: 2rem 0;
}

.article-content-modern code {
	background: var(--background);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	font-size: 0.9em;
	border: 1px solid var(--border);
}

.article-content-modern pre {
	background: var(--background);
	padding: 1.5rem;
	border-radius: 8px;
	overflow-x: auto;
	border: 1px solid var(--border);
	margin: 1.5rem 0;
	max-width: 65ch;
}

.back-link-modern {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.85rem;
	padding: 0;
	background: transparent;
	color: #6b7280;
	text-decoration: none;
	border-radius: 0;
	font-weight: 500;
	font-size: 0.95rem;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.back-link-modern:hover {
	background: transparent;
	color: #374151;
	text-decoration: underline;
}

.related-articles-section {
	margin-top: 4rem;
	padding-top: 3rem;
	border-top: 2px solid var(--border);
}

.related-articles-section h3 {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0.35rem 0 0.85rem;
	color: var(--text);
}

.related-section-intro {
	max-width: 680px;
	margin: 0 0 2rem;
	color: var(--muted);
	line-height: 1.7;
}

.toc-container {
	display: none;
}

@media (min-width: 1200px) {
	.toc-container {
		display: block;
		position: relative;
	}
}

.toc-sticky {
	position: sticky;
	top: 100px;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 1.1rem 1rem 1rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.toc-sticky::-webkit-scrollbar {
	width: 6px;
}

.toc-sticky::-webkit-scrollbar-track {
	background: var(--bg);
	border-radius: 3px;
}

.toc-sticky::-webkit-scrollbar-thumb {
	background: var(--border);
	border-radius: 3px;
}

.toc-sticky::-webkit-scrollbar-thumb:hover {
	background: var(--accent);
}

.toc-title {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6b7280;
	margin: 0 0 0.75rem 0;
	padding-bottom: 0.65rem;
	border-bottom: 1px solid var(--border);
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.toc-item {
	margin-bottom: 0.25rem;
}

.toc-link {
	display: block;
	color: var(--muted);
	text-decoration: none;
	font-size: 0.875rem;
	line-height: 1.45;
	padding: 0.45rem 0.75rem;
	border-radius: 10px;
	transition: all 0.2s ease;
	border-left: 2px solid transparent;
}

.toc-link:hover {
	color: var(--accent);
	background: var(--accent-light);
	border-left-color: var(--accent);
	transform: translateX(2px);
}

.toc-link.active {
	color: var(--accent);
	background: var(--accent-light);
	border-left-color: var(--accent);
	font-weight: 600;
}

.toc-empty {
	color: var(--muted);
	font-size: 0.875rem;
	text-align: center;
	padding: 0.5rem 0;
}

@media (max-width: 1199px) {
	.article-layout {
		grid-template-columns: 1fr;
	}

	.toc-container {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.article-title-modern {
		font-size: 1.8rem;
	}

	.article-content-wrapper {
		padding: 0;
		border-radius: 0;
	}

	.article-content-modern {
		font-size: 1rem;
	}

	.article-content-modern h2 {
		font-size: 1.5rem;
	}

	.article-content-modern h3 {
		font-size: 1.25rem;
	}

	.article-meta-modern {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.article-author-modern {
		width: auto;
	}
}
