/**
 * CLE Course Catalog — filter bar, CLE badges, pagination.
 * Layered on top of the theme's existing .aws-course-card / .blog-card styles
 * (which this catalog reuses for visual parity).
 */

.cle-catalog__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-end;
	margin: 0 0 28px;
	padding: 16px 18px;
	background: #faf6ee;
	border: 1px solid #efe2cd;
	border-radius: 8px;
}

.cle-catalog__filter {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 150px;
	flex: 1 1 150px;
}

.cle-catalog__filter label {
	font-size: 12px;
	font-weight: 600;
	color: #555555;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.cle-catalog__filter select {
	width: 100%;
	padding: 8px 32px 8px 10px;
	border: 1px solid #d9cdb5;
	border-radius: 6px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-color: #ffffff;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23555555' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 14px;
	cursor: pointer;
}

.cle-catalog__filter-actions {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/* Clear sits below the Apply button (absolute so it never shifts the bar). */
.cle-catalog__clear {
	position: absolute;
	top: calc( 100% + 8px );
	left: 0;
	right: 0;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var( --color-primary-dark, #a87e45 );
	background: none;
	border: 0;
	padding: 0;
	text-decoration: underline;
	cursor: pointer;
}

.cle-catalog__clear[hidden] {
	display: none;
}

.cle-catalog__clear:hover,
.cle-catalog__clear:focus {
	color: var( --color-primary, #c39454 );
	text-decoration: underline;
}

/* CLE status badge on the card (reuses the theme .tag pill shape) */
.cle-badge {
	display: inline-block;
}

.cle-badge--approved {
	background: #e6f4ea;
	color: #1e8449;
}

.cle-badge--pending {
	background: #fdf3e6;
	color: #b26a00;
}

.cle-badge--noteligible {
	background: #f0f0f1;
	color: #646970;
}

.cle-card__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
	margin: 4px 0 10px;
}

.cle-card__credit {
	font-weight: 700;
	color: var( --color-primary-dark, #a87e45 );
}

.cle-card__elig {
	color: #555555;
}

/* Empty state */
.cle-catalog__empty {
	text-align: center;
	padding: 40px 20px;
	color: #666666;
}

/* Pagination */
.cle-catalog__pagination {
	margin-top: 28px;
}

.cle-catalog__pagination .page-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	justify-content: center;
}

.cle-catalog__pagination .page-numbers li .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #d9cdb5;
	border-radius: 6px;
	text-decoration: none;
	color: var( --color-primary-dark, #a87e45 );
}

.cle-catalog__pagination .page-numbers li .page-numbers.current {
	background: var( --color-primary, #c39454 );
	border-color: var( --color-primary, #c39454 );
	color: #ffffff;
}

/* AJAX loading state — blur overlay + spinner (matches the theme's
   blog/resource/shop listings via .blog-listing__overlay / __spinner). */
.cle-catalog__results-wrap {
	position: relative;
	min-height: 120px;
}

.cle-catalog__results-wrap .blog-listing__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 48px;
	background: rgba( 255, 255, 255, 0.85 );
	opacity: 0;
	visibility: hidden;
	transition: opacity 200ms ease, visibility 200ms ease;
	z-index: 5;
}

@supports ( ( -webkit-backdrop-filter: blur( 5px ) ) or ( backdrop-filter: blur( 5px ) ) ) {
	.cle-catalog__results-wrap .blog-listing__overlay {
		background: rgba( 255, 255, 255, 0.1 );
		-webkit-backdrop-filter: blur( 5px );
		backdrop-filter: blur( 5px );
	}
}

.cle-catalog__results-wrap .blog-listing__spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 3px solid rgba( 0, 0, 0, 0.08 );
	border-top-color: var( --color-primary, #c39454 );
	animation: cleCatalogSpin 0.8s linear infinite;
}

.cle-catalog.is-loading .blog-listing__overlay {
	opacity: 1;
	visibility: visible;
}

.cle-catalog.is-loading .cle-catalog__filters,
.cle-catalog.is-loading .cle-catalog__results {
	pointer-events: none;
}

@keyframes cleCatalogSpin {
	to {
		transform: rotate( 360deg );
	}
}