/* ─── Archive post count ─────────────────────────────────────────── */

.archive-post-count {
	font-family: var(--wp--preset--font-family--karla);
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--muted);
	margin: 0;
	white-space: nowrap;
}

/* ─── Archive card grid: 2-col desktop, 1-col mobile ─────────────── */

.archive .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	align-items: start;
}

/*
 * .is-layout-flow adds margin-block-start to every li + li via WordPress-generated
 * CSS. In a grid that stacks on top of our gap, creating double spacing. Zero it out.
 */
.archive .wp-block-post-template .wp-block-post {
	margin-block-start: 0;
}

@media (max-width: 767px) {
	.archive .wp-block-post-template {
		grid-template-columns: 1fr;
	}
}

/* ─── Archive cards ──────────────────────────────────────────────── */

.archive-card {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 5 / 2;
	background-color: #3d3631;
}

/* Featured image: 5:2 panoramic crop */
.archive-card .wp-block-post-featured-image {
	margin: 0;
}

.archive-card .wp-block-post-featured-image a,
.archive-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
}

.archive-card .wp-block-post-featured-image img {
	aspect-ratio: 5 / 2;
	object-fit: cover;
	height: auto;
}

/* Gradient scrim — sits above the image */
.archive-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
	z-index: 1;
	pointer-events: none;
}

/* Hover/focus darkening overlay */
.archive-card::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.3);
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 1;
	pointer-events: none;
}

.archive-card:is(:hover, :focus-within)::after {
	opacity: 1;
}

/* Title centered over the image */
.archive-card .wp-block-post-title {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	z-index: 2;
	margin: 0;
	padding: 0 var(--wp--preset--spacing--50);
}

/*
 * Stretched link: the title <a> expands via ::after to fill the entire card.
 * .archive-card is position:relative; the title and its <a> are not, so the
 * ::after positions relative to .archive-card. z-index:3 puts it above
 * scrim(1), hover overlay(1), and title text(2). This keeps one focusable
 * link per card — the featured image is not linked (isLink omitted).
 */
.archive-card .wp-block-post-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 3;
}

/* ─── 404 recent posts cards ────────────────────────────────────── */

.recent-post-card__image {
	aspect-ratio: 4 / 3;
	background-color: #3d3631;
	overflow: hidden;
	margin-bottom: 12px;
}

.recent-post-card__image .wp-block-post-featured-image {
	margin: 0;
}

.recent-post-card__image .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	height: auto;
	display: block;
}

/* ─── Load More button ──────────────────────────────────────────── */

/*
 * Selector (0,2,0) beats WP core's .wp-block-button__link (0,1,1) without
 * needing !important, so we can override border-radius, font, and color.
 */
.wp-block-button .wp-load-more__button {
	font-family: var(--wp--preset--font-family--playfair-display);
	font-style: italic;
	font-size: var(--wp--preset--font-size--base);
	background-color: #26211C;
	color: #ffffff;
	border-radius: 6px;
	padding: 14px 28px;
	min-height: 44px;
	text-decoration: none;
	border: none;
	transition: background-color 0.2s ease;
}

.wp-block-button .wp-load-more__button:is(:hover, :focus-visible) {
	background-color: #3d3631;
	color: #ffffff;
}
