/* ── Feed ─────────────────────────────────────────────────────────────────── */
/* The Feed block (inc/feed.php) — news articles or posts. The cards themselves —
   grid, card, image shape and colour — are the shared card in
   assets/css/cards.css (inc/cards.php). This file holds only what a feed adds:
   the visitor filter bar, the loading state and pagination. The aa-news-*
   class names predate posts feeds and are kept for existing content. */

/* ── Filter bar ────────────────────────────────────────────────────────────── */
/* Server-rendered as a working GET form. view.js adds .is-enhanced once it has
   taken over, which is the only thing that retires the Apply button — until
   then it is the sole way to apply a filter, so it must never be hidden by
   default. */

.aa-news-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--wp--preset--spacing--small, 1rem);
	margin-block: var(--wp--preset--spacing--small, 1.5rem);
	padding-block-end: var(--wp--preset--spacing--small, 1rem);
	border-bottom: 1px solid var(--wp--preset--color--light, #e0e1dd);
}

.aa-news-filters__fields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--small, 1rem);
	flex: 1;
}

.aa-news-filters__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 0;
	min-width: 12rem;
}

.aa-news-filters__field label {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--primary, #0c2a4e);
}

.aa-news-filters__field select {
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--wp--preset--color--primary, #0c2a4e);
	border-radius: var(--border-radius-default, 4px);
	background: var(--wp--preset--color--base, #fff);
	color: inherit;
	font: inherit;
	max-width: 100%;
}

.aa-news-filters__actions {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--small, 1rem);
}

/* Always rendered, revealed only once something is actually filtered — see the
   note in frost_news_filters_html(). */
.aa-news-filters__clear {
	display: none;
	font-size: 0.9rem;
}

.aa-news-feed.is-filtered .aa-news-filters__clear {
	display: inline;
}

.aa-news-feed.is-enhanced .aa-news-filters__submit {
	display: none;
}

/* ── Results / loading ─────────────────────────────────────────────────────── */

.aa-news-feed__results {
	transition: opacity 0.15s ease;
}

.aa-news-feed.is-loading .aa-news-feed__results {
	opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
	.aa-news-feed__results {
		transition: none;
	}
}

/* ── Pagination ────────────────────────────────────────────────────────────── */

.aa-news-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin-block: var(--wp--preset--spacing--medium, 2rem);
}

.aa-news-pagination__link {
	display: inline-block;
	min-width: 2.4rem;
	padding: 0.45rem 0.7rem;
	text-align: center;
	text-decoration: none;
	border: 1px solid #00000044;
	background-color: #ffffff44;
	border-radius: var(--border-radius-default, 4px);
	color: inherit;
}

.aa-news-pagination__link:hover,
.aa-news-pagination__link:focus-visible {
	border-color: var(--wp--preset--color--primary, #0c2a4e);
}

/* Current page is a span, not a link — it has nowhere to go. */
.aa-news-pagination__link.is-current {
	background: var(--wp--preset--color--primary, #0c2a4e);
	border-color: var(--wp--preset--color--primary, #0c2a4e);
	color: var(--wp--preset--color--base, #fff);
	font-weight: 600;
}

.aa-news-pagination__gap {
	padding-inline: 0.2rem;
	opacity: 0.6;
}
