/* Block: News Grid */
.block--news-grid .news__heading { margin-bottom: 2.5rem; text-align: center; }

/* Ensure the `hidden` attribute wins over .c-button's inline-flex display. */
.block--news-grid [hidden] { display: none !important; }

/* Category filter bar -------------------------------------------------------- */
.block--news-grid .news__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}
.block--news-grid .news__filter {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 1.15rem;
	font-family: var(--font-body);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1;
	color: var(--color-space);
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: color 0.18s ease, background-color 0.18s ease,
	            border-color 0.18s ease, transform 0.18s ease;
}
.block--news-grid .news__filter:hover {
	border-color: var(--color-terracotta);
	color: var(--color-terracotta);
	transform: translateY(-1px);
}
.block--news-grid .news__filter:focus-visible {
	outline: 2px solid var(--color-terracotta);
	outline-offset: 2px;
}
.block--news-grid .news__filter.is-active {
	color: var(--color-white);
	background: var(--color-terracotta);
	border-color: var(--color-terracotta);
}
/* Small count badge inside each pill. Its look stays identical whether or not
   the pill is active (only the pill itself changes colour). */
.block--news-grid .news__filter-count {
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	padding: 0.15em 0.5em;
	border-radius: 999px;
	color: var(--color-space);
	background: var(--color-ivory);
}

.block--news-grid .news__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	transition: opacity 0.25s ease;
}
/* While a filter loads, dim the grid and block interaction. */
.block--news-grid .news__grid.is-loading {
	opacity: 0.45;
	pointer-events: none;
}
/* "No posts in this category" message. */
.block--news-grid .news__empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: clamp(2rem, 5vw, 3.5rem) 1rem;
	text-align: center;
	color: var(--color-muted);
	font-size: 1.0625rem;
}

/* Mobile: turn the filter bar into a horizontal, edge-to-edge carousel so the
   pills never wrap — they scroll sideways instead. */
@media (max-width: 720px) {
	.block--news-grid .news__filters {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		/* Bleed past the container padding so pills scroll to the screen edge. */
		margin-inline: calc(var(--container-pad) * -1);
		padding-inline: var(--container-pad);
		scrollbar-width: none;            /* Firefox: hide scrollbar */
	}
	.block--news-grid .news__filters::-webkit-scrollbar { display: none; } /* WebKit */
	.block--news-grid .news__filter {
		flex: 0 0 auto;                   /* don't shrink; keep labels on one line */
		scroll-snap-align: start;
	}
}
.block--news-grid .news__card {
	background: var(--color-terracotta);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.block--news-grid .news__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 18px 40px -22px rgba(50, 62, 80, 0.5);
}
.block--news-grid .news__card-link {
	display: grid;
	grid-template-columns: 40% 1fr;
	align-items: stretch;
	gap: 1.25rem;
	padding: 1rem;
	color: var(--color-white);
}
.block--news-grid .news__card-media {
	border-radius: calc(var(--radius) - 1px);
	overflow: hidden;
	background: var(--color-white);
	aspect-ratio: 1 / 1;
}
.block--news-grid .news__card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.block--news-grid .news__card-media-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--color-ivory);
}
.block--news-grid .news__card-body {
	align-self: start; /* top-align so every card's title starts at the same point */
	padding-right: 0.5rem;
	min-width: 0; /* let the text column shrink instead of spilling over the image */
}
.block--news-grid .news__card-title {
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 1.4rem;
	line-height: 1.25;
	color: var(--color-white);
	margin-bottom: 0.425rem; /* space before the excerpt */
}
.block--news-grid .news__card-excerpt {
	font-size: 0.975rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.88);
	margin: 0;
}

/* Horizontal (desktop) cards: reserve a uniform 3-line title height so every
   card's excerpt starts at the same point regardless of title length. */
@media (min-width: 901px) {
	.block--news-grid .news__card-title {
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
		min-height: calc(1.4rem * 1.25 * 3);
	}
}

/* Tablet & down: stack the image above the text so they can never collide,
   and give the (now full-width) image a landscape crop instead of a square. */
@media (max-width: 900px) {
	.block--news-grid .news__card-link {
		grid-template-columns: 1fr;
		gap: 0.9rem;
	}
	.block--news-grid .news__card-media { aspect-ratio: 16 / 10; }
	.block--news-grid .news__card-body { align-self: start; padding-right: 0; }
}

@media (max-width: 720px) {
	.block--news-grid .news__grid { grid-template-columns: 1fr; }
}

/* "See more" load-more button */
.block--news-grid .news__more-wrap { text-align: center; margin-top: clamp(2rem, 4vw, 3rem); }
.block--news-grid .news__more { min-width: 170px; justify-content: center; }
.block--news-grid .news__more.is-loading { opacity: 0.75; cursor: wait; }
