/* ==========================================================================
   Recent Posts flexible section
   Light mode default; add .recent-posts--dark for dark variant.
   ========================================================================== */

.recent-posts {
	background: var(--color-bg-light);
	padding: calc(var(--space-2xl) / 2) var(--space-sm) var(--space-2xl);
}

.recent-posts--dark {
	background: var(--color-bg);
}

@media (min-width: 768px) {
	.recent-posts {
		padding: calc(var(--space-2xl) / 2) var(--space-lg) var(--space-2xl);
	}
}

.recent-posts__inner {
	max-width: 1280px;
	margin: 0 auto;
}

/* Section header
   ========================================================================== */

.recent-posts__header {
	margin-bottom: var(--space-xl);
}

.recent-posts__heading {
	font-family: var(--font-sans);
	font-weight: var(--fw-regular);
	font-size: clamp(1.8rem, 4vw, 3.5rem);
	color: var(--color-text-dark);
	letter-spacing: -0.03em;
	line-height: 1.1;
	margin: 0;
}

.recent-posts--dark .recent-posts__heading {
	color: var(--color-text);
}

/* Two-column grid
   ========================================================================== */

.recent-posts__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-md);
}

@media (min-width: 1024px) {
	.recent-posts__grid {
		grid-template-columns: 3fr 2fr;
		align-items: stretch;
	}
}

/* Sidebar: 3 compact cards fill the featured card height exactly
   ========================================================================== */

.recent-posts__sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

@media (min-width: 1024px) {
	.recent-posts__sidebar {
		height: 100%;
	}

	.recent-posts__sidebar .blog-card--compact {
		flex: 1;
		min-height: 0;
	}
}

/* Full-card stretch link
   ========================================================================== */

.blog-card--linked {
	position: relative;
}

.blog-card--linked .blog-card__title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* CTA and image links float above the stretched link */
.blog-card--linked .blog-card__cta,
.blog-card--linked .blog-card__image-wrap {
	position: relative;
	z-index: 2;
}

/* Featured card — taller image + accent circle on CTA hover
   ========================================================================== */

.blog-card--featured .blog-card__image-wrap {
	aspect-ratio: 16 / 10;
}

.blog-card--featured .blog-card__cta:hover .hero__cta-circle,
.recent-posts--dark .blog-card--featured .blog-card__cta:hover .hero__cta-circle {
	background: var(--color-accent);
}

/* Compact sidebar card — horizontal layout
   ========================================================================== */

.blog-card--compact {
	flex-direction: row;
	align-items: stretch;
}

.blog-card--compact .blog-card__image-wrap {
	width: 120px;
	flex-shrink: 0;
	aspect-ratio: auto;
	align-self: stretch;
}

.blog-card--compact .blog-card__image {
	height: 100%;
}

.blog-card--compact .blog-card__body {
	flex: 1;
	min-width: 0;
}

.blog-card--compact .blog-card__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (min-width: 480px) {
	.blog-card--compact .blog-card__image-wrap {
		width: 140px;
	}
}

/* Dark mode card overrides
   ========================================================================== */

.recent-posts--dark .blog-card {
	background: var(--color-bg-card);
	border-color: var(--color-border);
}

.recent-posts--dark .blog-card:hover {
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.recent-posts--dark .blog-card__date {
	color: var(--color-text-dim);
}

.recent-posts--dark .blog-card__title {
	color: var(--color-text);
}

.recent-posts--dark .blog-card__title a:hover {
	opacity: 0.65;
}

.recent-posts--dark .blog-card__excerpt {
	color: var(--color-text-dim);
}

.recent-posts--dark .blog-card__cta {
	border-color: var(--color-border);
	color: var(--color-text);
}

.recent-posts--dark .blog-card__cta .hero__cta-circle {
	background: rgba(254, 254, 254, 0.08);
}

.recent-posts--dark .blog-card__cta .hero__cta-circle svg {
	stroke: var(--color-text);
}

.recent-posts--dark .blog-card__cta:hover {
	background: var(--color-text);
	border-color: var(--color-text);
	color: var(--color-bg);
}

.recent-posts--dark .blog-card__cta:hover .hero__cta-circle {
	background: var(--color-bg);
}

.recent-posts--dark .blog-card__cta:hover .hero__cta-circle svg {
	stroke: var(--color-bg);
}
