/* Layout: Post archive */

.post-archive__header {
	margin-bottom: var(--space-xl);
	text-align: center;
}

.post-archive__header .section__intro {
	margin-inline: auto;
}

.post-archive__grid {
	display: grid;
	gap: var(--space-l);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40rem) {
	.post-archive__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 60rem) {
	.post-archive__grid[data-columns="3"] {
		grid-template-columns: repeat(3, 1fr);
	}
}

/*
 * The card is declared in full here rather than borrowed from post-slider.css.
 *
 * Two reasons: a page carrying only this section never loads that stylesheet,
 * and ACF Extended's acfe_flexible_render_style resolves exactly one file per
 * layout — so a preview relying on the slider's CSS would render unstyled.
 *
 * Scoped under .section--post-archive so that when both layouts do appear on
 * one page, these win on specificity instead of on load order. The shapes genuinely
 * differ: the slider card is image-beside-text, this one is stacked.
 */
.section--post-archive .post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--color-bg);
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-s);
	transition: transform var(--transition), box-shadow var(--transition);
}

.section--post-archive .post-card:hover,
.section--post-archive .post-card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--shadow-m);
}

.section--post-archive .post-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background-color: var(--color-surface-alt);
}

.section--post-archive .post-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}

.section--post-archive .post-card:hover .post-card__image,
.section--post-archive .post-card:focus-within .post-card__image {
	transform: scale(1.03);
}

.section--post-archive .post-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: var(--space-m) var(--space-m) var(--space-l);
	text-align: left;
}

/* The category as a small label, same voice as the section kicker. */
.section--post-archive .post-card__category {
	margin-bottom: var(--space-2xs);
	color: var(--color-muted);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.section--post-archive .post-card__title {
	margin-bottom: var(--space-xs);
	font-size: var(--text-xl);
	line-height: var(--leading-tight);
}

.section--post-archive .post-card__link {
	color: inherit;
	text-decoration: none;
}

.section--post-archive .post-card__link:hover,
.section--post-archive .post-card__link:focus-visible {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Stretched link: the whole card is the target, the title is the one tab stop. */
.section--post-archive .post-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.section--post-archive .post-card {
	position: relative;
}

.section--post-archive .post-card__excerpt {
	flex: 1;
	color: var(--color-muted);
}

/* Date left, "Weiterlesen" right, pinned to the card's foot. */
.section--post-archive .post-card__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-s);
	margin: var(--space-m) 0 0;
	font-size: var(--text-sm);
}

.section--post-archive .post-card__meta time {
	color: var(--color-muted);
}

.section--post-archive .post-card__more {
	color: var(--color-text);
	font-weight: 600;
	text-decoration: none;
}

.post-archive__empty {
	text-align: center;
}

/* Pagination — paginate_links( type => list ) markup. */
.post-archive__pagination {
	margin-top: var(--space-xl);
}

.post-archive__pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-archive__pagination li {
	margin: 0;
}

.post-archive__pagination a,
.post-archive__pagination span {
	display: grid;
	place-items: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0 var(--space-2xs);
	color: var(--color-text);
	text-decoration: none;
	border-radius: var(--radius-full);
	transition: background-color var(--transition);
}

.post-archive__pagination a:hover,
.post-archive__pagination a:focus-visible {
	background-color: var(--color-surface);
}

.post-archive__pagination .current {
	background-color: var(--color-brand);
	color: var(--color-bg);
}
