/**
 * Blog stylesheet.
 *
 * Scoped styles for single posts, blog index (home.php), and post
 * archives (archive.php). Conditionally enqueued from inc/enqueue.php
 * on is_singular('post') / is_home() / standard post archives.
 *
 * Uses existing design tokens (--midnight, --accent, --space-*, etc).
 * Borders use the Stripe-style #e6e6e6 convention shared with checkout.
 */

/* ─── Blog hero (single post) ─── */

.blog-single__hero {
	position: relative;
	overflow: hidden;
	background-color: var(--midnight);
	color: var(--white);
	padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-2xl);
	text-align: center;
}

.blog-single__hero-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.blog-single__hero-bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.blog-single__hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(14, 10, 24, 0.55) 0%, rgba(14, 10, 24, 0.88) 100%);
}

.blog-single__hero-content {
	position: relative;
	z-index: 1;
}

.blog-single__hero--has-media .blog-single__title,
.blog-single__hero--has-media .blog-single__meta {
	text-shadow: 0 2px 18px rgba(14, 10, 24, 0.45);
}

.blog-single__meta {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--space-sm);
	margin-bottom: var(--space-md);
	font-size: var(--text-s);
	color: var(--subtle);
}

.blog-single__category {
	color: var(--accent);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-decoration: none;
	transition: color 0.15s ease;
}

.blog-single__category:hover,
.blog-single__category:focus-visible {
	color: var(--accent-light);
}

.blog-single__meta-sep {
	color: var(--subtle);
	opacity: 0.6;
}

.blog-single__title {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.15;
	color: var(--white);
}

/* ─── Blog content (single post) ─── */

.blog-single__content {
	/* The .content-default class handles prose typography; we only
	   need section-level spacing on top. */
}

.blog-single__page-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
	margin-top: var(--space-xl);
	padding-top: var(--space-lg);
	border-top: 1px solid #e6e6e6;
	color: var(--text-mid);
	font-size: var(--text-s);
}

.blog-single__page-links a,
.blog-single__page-links > span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	border-radius: var(--radius-md);
	background: var(--white);
	border: 1px solid #e6e6e6;
	color: var(--text-dark);
	text-decoration: none;
	font-weight: 600;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.blog-single__page-links a:hover,
.blog-single__page-links a:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

/* ─── Archive / index hero ─── */

.blog-archive__header {
	position: relative;
	background-color: var(--midnight);
	color: var(--white);
	padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-2xl);
	text-align: center;
}

.blog-archive__header-content {
	text-align: center;
}

.blog-archive__title {
	margin: 0 0 var(--space-md);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.15;
	color: var(--white);
}

.blog-archive__desc {
	color: var(--subtle);
	font-size: var(--text-m);
	max-width: 600px;
	margin: 0 auto;
}

.blog-archive__desc p {
	color: inherit;
	margin: 0;
}

.blog-archive__desc p + p {
	margin-top: var(--space-sm);
}

.blog-archive__empty {
	text-align: center;
	color: var(--text-mid);
	font-size: var(--text-m);
	padding-block: var(--space-2xl);
	margin: 0;
}

/* ─── Listing grid ─── */

.blog-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-lg);
}

@media (min-width: 640px) {
	.blog-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.blog-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ─── Card ─── */

.blog-card {
	height: 100%;
	background: var(--white);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-card);
	transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}

.blog-card:hover,
.blog-card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(14, 10, 24, 0.12);
}

.blog-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.blog-card__link:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.blog-card__image {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--surface);
}

.blog-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s var(--ease-out-expo);
}

.blog-card:hover .blog-card__image img {
	transform: scale(1.04);
}

.blog-card__image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--surface) 0%, var(--white) 100%);
}

.blog-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	padding: var(--space-lg);
}

.blog-card__category {
	display: inline-block;
	color: var(--accent);
	font-size: var(--text-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.blog-card__title {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--text-m);
	line-height: 1.3;
	color: var(--text-dark);
}

.blog-card__excerpt {
	margin: 0;
	color: var(--text-mid);
	font-size: var(--text-body);
	line-height: 1.55;
	flex: 1;
}

.blog-card__footer {
	display: flex;
	align-items: center;
	margin-top: var(--space-sm);
}

.blog-card__date {
	color: var(--text-mid);
	font-size: var(--text-xs);
}

/* ─── Related strip ─── */

.blog-related {
	padding: var(--space-2xl) 0;
	background: var(--surface);
	border-top: 1px solid #e6e6e6;
}

.blog-related__title {
	margin: 0 0 var(--space-xl);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--text-h3);
	color: var(--text-dark);
	text-align: center;
}

/* ─── Pagination ─── */

.blog-pagination {
	display: flex;
	justify-content: center;
	margin-top: var(--space-2xl);
}

.blog-pagination .nav-links {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	justify-content: center;
}

.blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 14px;
	border-radius: var(--radius-md);
	background: var(--white);
	color: var(--text-dark);
	font-weight: 600;
	text-decoration: none;
	border: 1px solid #e6e6e6;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}

.blog-pagination .page-numbers.current {
	background: var(--accent);
	color: var(--white);
	border-color: var(--accent);
	cursor: default;
}

.blog-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	color: var(--text-mid);
	cursor: default;
}

.blog-pagination .page-numbers svg {
	flex-shrink: 0;
}
