/*
 * Recent categorisations (prototype index.html "recent-categorisations"). Pattern cmc/recent-categorisations:
 *   backing (white) > section (white, py 40): a 20% charcoal hairline 40px above the heading row, then a Query Loop
 *   of the 3 newest statements as cards (1 / 2 from 768 / 3 from 1024 columns, 15 apart).
 * The card (.stat-card, off-white, cloud on hover): short title + category badge and month, a rule, the two bound
 * figures (style "Count up"), then "Read the full statement" (button style "Link", URL bound to the post's link).
 */
.recent-cats__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 25px;
	padding-top: 40px;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--charcoal) 20%, transparent);
}

@media (width >= 1024px) {
	.recent-cats__head {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
	}
}

.recent-cats__head > .wp-block-heading {
	min-width: 0;
}

.recent-cats__head > .wp-block-buttons {
	flex: none;
}

.section-recent-categorisations .recent-cats {
	margin-top: 30px;
}

.recent-cats .wp-block-post-template {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (width >= 768px) {
	.recent-cats .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (width >= 1024px) {
	.recent-cats .wp-block-post-template {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.stat-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	height: 100%;
	padding: 30px;
	border-radius: var(--wp--custom--radius--card);
	transition: background-color 300ms var(--wp--custom--ease);
}

.stat-card:hover {
	background-color: var(--wp--preset--color--cloud) !important;
}

.stat-card__top {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.stat-card__head {
	display: flex;
	gap: 20px;
}

.stat-card__title {
	flex: 1;
	min-width: 0;
}

.stat-card__badge {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 10px;
}

.stat-card .is-style-category-badge {
	width: 70px;
	height: 70px;
}

/* the 1px charcoal rule, then gap-20 + pt-6 to the figures */
.stat-card__figures {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-top: 26px;
	border-top: 1px solid var(--wp--preset--color--charcoal);
}

.stat-card__figure {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* "Read the full statement": a flex box, so the small link sits on no line box (no extra strut height) */
.stat-card .wp-block-button {
	display: flex;
}

/* "Organisations affected" with no number ("Unknown"): caption size, not the figure size (prototype: "an unknown is not
   a number"; class from inc/blocks/count-up-text.php). The impact keeps the figure size ("Below threshold"), as on
   the Statements page. */
.stat-card__figure:last-child > .is-not-number {
	font-size: var(--wp--preset--font-size--text-11) !important;
	font-weight: 400 !important;
	line-height: 1.3;
}

.stat-card__figure > p:empty {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.stat-card {
		transition: none;
	}
}
