/* ===================================
   NEWS ARTICLE STYLES
   =================================== */

/* Article Infographics */
.article-infographic img {
	border-radius: 8px;
}

.article-infographic-hero {
	margin: 0 0 30px 0;
}

.article-infographic-hero img {
	width: 100%;
	height: auto;
}

.article-wrapper {
	max-width: 1440px;
	margin: 0 auto;
	padding: 40px 20px;
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(32px, 5vw, 60px);
}

.article-wrapper > * {
	min-width: 0;
}

#news-bottom-toplist {
	width: 100%;
}

#news-bottom-toplist .container {
	width: 100%;
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

#news-bottom-toplist .toplist-card {
	max-width: 100%;
}

@media (min-width: 768px) {
	#news-bottom-toplist .container {
		max-width: var(--container-max-width);
		padding-left: 0;
		padding-right: 0;
	}
}

/* Offset fixed header so content is not obscured */
.header + .article-wrapper {
	margin-top: var(--header-offset, 126px);
}

/* Article Container */
.article-container {
	max-width: 800px;
	width: 100%;
}

/* Article Header */
.article-header {
	margin-bottom: 30px;
}

.article-category {
	display: inline-block;
	background: var(--color-primary);
	color: var(--color-dark);
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 20px;
}

.article-title {
	font-size: 42px;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 20px;
	color: var(--color-dark);
}

@media (max-width: 768px) {
	.article-wrapper {
		padding: 20px 16px;
		overflow-x: hidden;
	}

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

	.article-content {
		font-size: 16px;
		overflow-x: hidden;
	}

	.article-content h2 {
		font-size: 26px;
	}

	.article-content h3 {
		font-size: 20px;
	}
}

.article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	color: rgba(28, 28, 28, 0.6);
	font-size: 15px;
}

.article-author {
	font-weight: 600;
	color: var(--color-dark);
}

.article-date::before,
.article-read-time::before {
	content: "•";
	margin-right: 20px;
}

/* Featured Image */
.article-featured-image {
	width: 100%;
	margin: 0 0 40px 0;
	border-radius: 12px;
	overflow: hidden;
}

.article-featured-image img {
	width: 100%;
	height: auto;
	display: block;
}

/* Article Content */
.article-content {
	font-size: 18px;
	line-height: 1.8;
	color: var(--color-dark);
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.article-content p {
	margin-bottom: 24px;
}

.article-content h2 {
	font-size: 32px;
	font-weight: 700;
	margin: 40px 0 20px 0;
	color: var(--color-dark);
}

.article-content h3 {
	font-size: 24px;
	font-weight: 600;
	margin: 32px 0 16px 0;
	color: var(--color-dark);
}

.article-content h4 {
	font-size: 20px;
	font-weight: 600;
	margin: 24px 0 12px 0;
	color: var(--color-dark);
}

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

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

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

.article-content li {
	margin-bottom: 12px;
}

.article-content a {
	color: var(--color-primary);
	text-decoration: underline;
	transition: color var(--transition-speed) var(--transition-easing);
}

.article-content a:hover {
	color: var(--color-primary-hover);
}

.article-content blockquote {
	border-left: 4px solid var(--color-primary);
	padding-left: 24px;
	margin: 32px 0;
	font-style: italic;
	color: rgba(28, 28, 28, 0.8);
}

.article-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 32px 0;
}

.article-content code {
	background: var(--color-light);
	padding: 2px 8px;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 16px;
}

.article-content pre {
	background: var(--color-light);
	padding: 20px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 24px 0;
}

.article-content pre code {
	background: none;
	padding: 0;
}

/* Tables in article content */
.article-content table {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	display: block;
	border-collapse: collapse;
	margin: 24px 0;
}

.article-content .markdown-table {
	max-width: 100%;
	overflow-x: auto;
}

/* FAQ items */
.article-content .faq-item {
	max-width: 100%;
	overflow: hidden;
}

/* Long URLs and text */
.article-content a {
	word-break: break-word;
}

/* Article Footer */
.article-footer {
	margin-top: 60px;
	padding-top: 40px;
	border-top: 2px solid var(--color-light);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 20px;
}

.article-tags {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.tag {
	background: var(--color-light);
	color: var(--color-dark);
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 500;
}

.article-share {
	display: flex;
	align-items: center;
	gap: 12px;
}

.article-share span {
	font-weight: 600;
	color: var(--color-dark);
}

.share-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--color-light);
	color: var(--color-dark);
	transition: all var(--transition-speed) var(--transition-easing);
}

.share-btn:hover {
	background: var(--color-primary);
	color: var(--color-dark);
}

/* Sidebar */
.article-sidebar {
	width: 100%;
	margin: 0 auto;
}

.sidebar-section {
	margin-bottom: 36px;
}

.sidebar-section:last-child {
	margin-bottom: 0;
}

@media (min-width: 1024px) {
	.article-wrapper {
		grid-template-columns: minmax(0, 1fr) 460px;
		align-items: start;
		padding: 60px 40px;
	}

	.article-sidebar {
		margin: 0;
	}
}

.section-header {
	margin-bottom: 20px;
	padding-bottom: 12px;
	text-align: left;
}

.sidebar-title {
	margin: 0 0 8px 0;
	font-size: 1.9em;
	line-height: 1em;
	font-weight: 700;
	color: #111827;
}

.sidebar-subtitle {
	margin: 0;
	font-size: 1.2em;
	color: #949aa6;
	line-height: 1.0;
}

.sidebar-articles {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sidebar-article {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--color-light);
	transition: transform var(--transition-speed) var(--transition-easing);
}

.sidebar-article:hover {
	transform: translateX(4px);
}

.sidebar-article:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.sidebar-article-image {
	width: unset;
	height: unset;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
}

.sidebar-article-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sidebar-article-content {
	flex: 1;
}

.sidebar-article-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	margin-top: 16px;
	margin-bottom: 8px;
	color: var(--color-dark);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sidebar-article-date {
	font-size: 13px;
	color: rgba(28, 28, 28, 0.6);
}

/* ===================================
   GUIDE SIDEBAR ENHANCED CARDS
   =================================== */

/* Enhanced card - vertical layout with image on top */
.sidebar-article.enhanced-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin-bottom: 12px;
	padding: 0;
	transition: all 0.2s;
	text-decoration: none;
	color: inherit;
}

.sidebar-article.enhanced-card:hover {
	border-color: #d1d5db;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

/* Card thumbnail image */
.enhanced-card .sidebar-article-image {
	width: 100%;
	height: 250px;
	max-height: 250px;
	border-radius: 8px 8px 0 0;
	overflow: hidden;
	flex-shrink: 0;
}

.enhanced-card .sidebar-article-image img {
	width: 100%;
	height: 250px;
	object-fit: cover;
}

/* Card content area */
.enhanced-card .article-content {
	flex: 1 1 0%;
	min-width: 0;
	padding: 20px;
}

/* Card title */
.enhanced-card .article-title {
	margin: 0;
	font-size: 0.95em;
	line-height: 1.4;
	color: #111827;
	font-weight: 600;
}

/* Step number badge */
.step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: #10b981;
	color: white;
	border-radius: 50%;
	font-size: 0.75em;
	font-weight: bold;
	margin-right: 8px;
	flex-shrink: 0;
}

/* Difficulty badges */
.difficulty-badge {
	font-size: 0.85em;
	font-weight: 600;
}

.difficulty-badge-inline {
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Article type badge */
.article-type-badge {
	background: #f3f4f6;
	color: #6b7280;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75em;
	font-weight: 500;
}

/* Metadata row */
.enhanced-card .article-meta {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	flex-wrap: wrap;
	align-items: center;
}

/* Topics snippet */
.article-snippet {
	margin: 8px 0 0 0;
	font-size: 0.85em;
	color: #6b7280;
	line-height: 1.4;
}

/* "Why read this" text */
.article-why {
	margin: 8px 0 0 0;
	font-size: 0.85em;
	color: #059669;
	line-height: 1.4;
	font-style: italic;
}

/* Difficulty subsection headers */
.difficulty-subsection {
	margin-bottom: 20px;
}

.subsection-title {
	font-size: 0.9em;
	margin: 0 0 12px 0;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Title row with optional step number */
.enhanced-card .title-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

/* Read time badge */
.read-time {
	color: #9ca3af;
	font-size: 0.75em;
}

/* ===================================
   TABLE OF CONTENTS
   =================================== */

.table-of-contents {
	margin: 32px 0 40px 0;
	padding: 0 0 0 24px;
	border-left: 3px solid #f59e0b;
}

.table-of-contents h2 {
	font-size: 0.85em;
	font-weight: 600;
	color: #f59e0b;
	margin: 0 0 16px 0;
	padding: 0;
	text-transform: uppercase;
	letter-spacing: 1px;
	border: none;
}

.table-of-contents ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.table-of-contents li {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--color-light);
}

.table-of-contents li:last-child {
	border-bottom: none;
}

.table-of-contents a {
	display: block;
	color: #ea580c;
	text-decoration: none;
	font-size: 0.95em;
	padding: 10px 0;
	transition: color 0.2s ease;
}

.table-of-contents a:hover {
	color: #c2410c;
}

@media (max-width: 768px) {
	.table-of-contents {
		margin: 24px 0 32px 0;
		padding: 0 0 0 16px;
	}

	.table-of-contents a {
		padding: 8px 0;
		font-size: 0.9em;
	}
}
