/* =================================
   08-BLOG.CSS
   Blog index + article pages
   ================================= */

.blog-hero,
.article-header,
.article-hero {
	background: var(--bg-primary);
	padding: var(--section-padding) 0 var(--space-8);
	margin-top: var(--nav-height);
}

.blog-hero {
	margin-top: var(--nav-height);
	text-align: center;
}

.blog-hero h1 {
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	margin-bottom: var(--space-2);
	letter-spacing: -0.02em;
}

.blog-hero p {
	max-width: 760px;
	margin: 0 auto;
	color: var(--text-secondary);
}

.blog-section {
	padding: 0 0 var(--section-padding);
	background: var(--bg-primary);
}

.blog-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-4);
}

.blog-card {
	background: var(--bg-elevated);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--transition-base), transform var(--transition-fast), border-color var(--transition-base);
}

.blog-card:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
	border-color: var(--border-strong);
}

.blog-card-link {
	display: block;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.blog-card-image {
	background: var(--bg-muted);
	border-bottom: 1px solid var(--border-color);
}

.blog-card-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.blog-card-content {
	padding: var(--space-4);
}

.blog-card-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-2);
	margin-bottom: var(--space-2);
	font-size: var(--text-xs);
	color: var(--text-muted);
}

.blog-card h2 {
	font-size: var(--text-lg);
	line-height: 1.35;
	margin-bottom: var(--space-2);
}

.blog-card p {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	margin-bottom: var(--space-3);
}

.blog-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: var(--text-sm);
	font-weight: var(--font-semibold);
	color: var(--accent-primary);
}

.blog-card-cta svg {
	transition: transform var(--transition-base);
}

.blog-card:hover .blog-card-cta svg {
	transform: translateX(2px);
}

.article-content {
	background: var(--bg-primary);
	padding-bottom: var(--section-padding);
}

.article-header .container,
.article-body .container,
.article-featured-image .container {
	max-width: 840px;
}

.article-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--text-sm);
	color: var(--text-muted);
	margin-bottom: var(--space-4);
}

.article-title {
	font-size: clamp(2rem, 4.5vw, 2.8rem);
	line-height: var(--leading-tight);
	margin-bottom: var(--space-3);
	letter-spacing: -0.02em;
}

.article-description {
	font-size: var(--text-lg);
	line-height: var(--leading-relaxed);
	color: var(--text-secondary);
	max-width: 70ch;
}

.article-featured-image {
	padding-bottom: var(--space-8);
}

.article-featured-image .featured-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-lg);
	border: 1px solid var(--border-color);
	box-shadow: var(--shadow-sm);
}

.article-body {
	padding-top: 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
	margin-top: var(--space-8);
	margin-bottom: var(--space-3);
}

.article-body h2 {
	font-size: var(--text-2xl);
}

.article-body h3 {
	font-size: var(--text-xl);
}

.article-body h4 {
	font-size: var(--text-lg);
}

.article-body p,
.article-body li {
	font-size: var(--text-base);
	color: var(--text-secondary);
	line-height: var(--leading-relaxed);
}

.article-body ul,
.article-body ol {
	padding-left: 1.2rem;
	margin: var(--space-3) 0;
}

.article-body hr {
	border: 0;
	border-top: 1px solid var(--border-color);
	margin: var(--space-8) 0;
}

.article-body code {
	font-family: var(--font-mono);
	font-size: 0.86em;
	background: var(--bg-tertiary);
	padding: 0.1rem 0.35rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border-color);
}

.article-body pre,
.cm-editor {
	background: #111827;
	color: #e5e7eb;
	border: 1px solid #1f2937;
	border-radius: var(--radius-md);
	overflow: auto;
	padding: 0.9rem;
	margin: var(--space-4) 0;
}

.cm-scroller,
.cm-content {
	background: transparent;
	padding: 0;
}

.cm-content {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	line-height: 1.55;
}

.cm-cursorLayer,
.cm-selectionLayer {
	display: none;
}

.tool-image img,
.article-body img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-color);
	margin: var(--space-3) 0;
}

.tool-image img[src$="batch-iso-creator.png"] {
	max-width: 220px;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
}

.article-body table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: var(--space-5) 0;
	background: #ffffff;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.article-body thead th {
	background: #eff6ff;
	color: #1e3a8a;
	font-weight: var(--font-semibold);
	font-size: var(--text-sm);
	text-align: left;
	padding: 0.72rem 0.76rem;
	border-bottom: 1px solid #c7d9f8;
}

.article-body th,
.article-body td {
	padding: 0.68rem 0.76rem;
	font-size: var(--text-sm);
	line-height: 1.45;
	vertical-align: top;
	text-align: left;
	border-right: 1px solid var(--border-color);
	border-bottom: 1px solid var(--border-color);
}

.article-body tr:last-child td {
	border-bottom: 0;
}

.article-body th:last-child,
.article-body td:last-child {
	border-right: 0;
}

.article-body tbody tr:nth-child(even) td {
	background: #f8fbff;
}

.article-body tbody tr:hover td {
	background: #f1f6ff;
}

.back-to-blog {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: var(--text-sm);
	font-weight: var(--font-semibold);
}

.article-nav {
	padding-top: var(--space-8);
	border-top: 1px solid var(--border-color);
	margin-top: var(--space-8);
}

.article-nav .container {
	max-width: 840px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-4);
}

.back-to-blog {
	color: var(--accent-primary);
	text-decoration: none;
	flex-shrink: 0;
}

.back-to-blog:hover {
	color: var(--accent-secondary);
}

.article-cta {
	margin-left: auto;
	max-width: 520px;
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: var(--space-4);
	box-shadow: var(--shadow-sm);
}

.article-cta h3 {
	margin: 0 0 var(--space-2);
	font-size: var(--text-lg);
	line-height: var(--leading-tight);
	color: var(--text-primary);
}

.article-cta p {
	margin: 0 0 var(--space-3);
	color: var(--text-secondary);
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
}

.article-cta .btn {
	width: 100%;
	justify-content: center;
}

@media (max-width: 860px) {
	.article-nav .container {
		flex-direction: column;
	}

	.article-cta {
		margin-left: 0;
		max-width: 100%;
		width: 100%;
	}

	.article-body table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}
