/* Segmented tab bar: one rounded container, active tab is a filled navy pill. */
.omg-filtered-posts__tabs {
	width: fit-content;
	max-width: 100%;
	margin: 0 auto var(--wp--preset--spacing--space-32);
	border: 1px solid var(--wp--preset--color--primary-tint-4);
	border-radius: 100px;
	background-color: var(--wp--preset--color--white);
}

.omg-filtered-posts__pills {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--space-8);
	padding: 6px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.omg-filtered-posts__pills::-webkit-scrollbar {
	display: none;
}

/* Mouse users drag the overflowing bar (view.js); grab cursor signals it. */
.omg-filtered-posts__pills.is-scrollable {
	cursor: grab;
}

.omg-filtered-posts__pills.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	user-select: none;
}

.omg-filtered-posts__pill {
	flex: 0 0 auto;
	padding: 12px 24px;
	border: 0;
	border-radius: 100px;
	background-color: transparent;
	color: var(--wp--preset--color--dark-blue);
	font-family: var(--wp--preset--font-family--inter);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.omg-filtered-posts__pill:hover {
	color: var(--wp--preset--color--primary);
}

.omg-filtered-posts__pill[aria-pressed="true"] {
	background-color: var(--omg-active-pill-bg, var(--wp--preset--color--dark-blue));
	color: var(--wp--preset--color--white);
}

/* Multi-taxonomy filter: a centred row of rounded dropdowns. */
.omg-filtered-posts__dropdowns {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wp--preset--spacing--space-16);
	margin: 0 auto var(--wp--preset--spacing--space-32);
}

.omg-filtered-posts__select {
	min-width: 220px;
	max-width: 100%;
	padding: 14px 48px 14px 24px;
	border: 1px solid var(--wp--preset--color--primary-tint-4);
	border-radius: 100px;
	background-color: var(--wp--preset--color--white);
	background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23001C44%27 stroke-width=%272.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 20px center;
	background-size: 16px;
	color: var(--wp--preset--color--dark-blue);
	font-family: var(--wp--preset--font-family--inter);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	appearance: none;
}

.omg-filtered-posts__select:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

@media (max-width: 1024px) {

	.omg-filtered-posts__dropdown,
	.omg-filtered-posts__select {
		width: 100%;
	}
}

.omg-filtered-posts__grid {
	display: grid;
	grid-template-columns: repeat(var(--omg-columns, 3), minmax(0, 1fr));
	gap: var(--wp--preset--spacing--space-20);
	outline: none;
	transition: opacity 0.2s ease;
}

.omg-filtered-posts__grid[aria-busy="true"] {
	opacity: 0.5;
	pointer-events: none;
}

/* Cards fade and rise in each time the grid is (re)populated. */
.omg-filtered-posts__grid > * {
	animation: omg-fp-card-in 0.35s ease both;
}

@keyframes omg-fp-card-in {

	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

@media (prefers-reduced-motion: reduce) {

	.omg-filtered-posts__grid,
	.omg-filtered-posts__grid > *,
	.omg-filtered-posts__pill {
		transition: none;
		animation: none;
	}

	.omg-filtered-posts__pills {
		scroll-behavior: auto;
	}
}

@media (max-width: 1024px) {

	.omg-filtered-posts__grid {
		grid-template-columns: 1fr;
	}
}

.omg-filtered-posts__pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--space-8);
	margin-top: var(--wp--preset--spacing--space-32);
}

.omg-filtered-posts__page {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 100px;
	background-color: transparent;
	color: var(--wp--preset--color--dark-blue);
	font-family: var(--wp--preset--font-family--archivo);
	font-size: 20px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}

.omg-filtered-posts__page[aria-current="page"] {
	width: 48px;
	height: 48px;
	background-color: var(--wp--preset--color--dark-blue);
	color: var(--wp--preset--color--white);
}

.omg-filtered-posts__page:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

a.omg-filtered-posts__page {
	text-decoration: none;
}

.omg-filtered-posts__view-all {
	display: flex;
	justify-content: center;
	margin-top: var(--wp--preset--spacing--space-32);
}

.omg-filtered-posts__view-all .wp-block-button__link {
	padding: 14px 32px;
	border-radius: 100px;
	background-color: var(--wp--preset--color--dark-blue);
	color: var(--wp--preset--color--white);
	font-weight: 700;
}

.omg-filtered-posts__empty {
	grid-column: 1 / -1;
	text-align: center;
}

