/**
 * 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 {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-end;
	margin: 0 0 28px;
	/* Extra bottom room reserves a fixed strip for the "Clear filters" link so
	   showing/hiding it never changes the bar height or reflows the filters. */
	padding: 16px 18px 38px;
	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 {
	display: flex;
	align-items: flex-end;
	flex: 0 0 auto;
}

/* "Clear" reset sits in the reserved strip directly below the Apply button,
   right-aligned to it. Pinned to the bar's bottom padding so its slot exists
   at all times; only its visibility/opacity toggles, so showing/hiding it
   never shifts the bar or the filters. Styled to match the Resource Room's
   .resource-search-clear (danger red, no underline). */
.cle-catalog__clear {
	position: absolute;
	right: 18px;
	bottom: 12px;
	border: 0;
	background: transparent;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	color: var( --color-danger, #dc143c );
	text-decoration: none;
	cursor: pointer;
	transition: opacity 200ms ease, visibility 200ms ease;
}

.cle-catalog__clear.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.cle-catalog__clear:hover,
.cle-catalog__clear:focus {
	color: var( --color-primary, #c39454 );
}

/* 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 — full-cover overlay with a centered spinner. */
.cle-catalog__results-wrap {
	position: relative;
	min-height: 160px;
	/* Absorb the Bootstrap .row negative gutter so the cards sit inside this
	   box; otherwise the cards protrude past the overlay and their edges show
	   un-blurred ("cut off") during the AJAX loading state. */
	padding-left: calc( var( --bs-gutter-x, 1.5rem ) * 0.5 );
	padding-right: calc( var( --bs-gutter-x, 1.5rem ) * 0.5 );
}

/* The overlay sits above the results and veils them while a request is in
   flight; the spinner is centred on both axes within the results area. */
.cle-catalog__results-wrap .blog-listing__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 250, 246, 238, 0.86 );
	opacity: 0;
	visibility: hidden;
	transition: opacity 220ms ease, visibility 220ms ease;
	z-index: 5;
	border-radius: 8px;
	margin-top: 20px;
}

@supports ( ( -webkit-backdrop-filter: blur( 4px ) ) or ( backdrop-filter: blur( 4px ) ) ) {
	.cle-catalog__results-wrap .blog-listing__overlay {
		background: rgba( 250, 246, 238, 0.6 );
		-webkit-backdrop-filter: blur( 4px ) saturate( 120% );
		backdrop-filter: blur( 4px ) saturate( 120% );
	}
}

/* Spinner presented as a soft white chip so it reads as an intentional
   loader rather than a stray ring floating over the content. */
.cle-catalog__results-wrap .blog-listing__spinner {
	width: 52px;
	height: 52px;
	box-sizing: border-box;
	border-radius: 50%;
	border: 4px solid rgba( 195, 148, 84, 0.2 );
	border-top-color: var( --color-primary, #c39454 );
	background: #ffffff;
	box-shadow: 0 6px 18px rgba( 33, 24, 8, 0.12 );
	animation: cleCatalogSpin 0.7s linear infinite;
}

.cle-catalog.is-loading .blog-listing__overlay {
	opacity: 1;
	visibility: visible;
}

/* Lock interaction while a request is in flight so the loading state reads
   clearly and stray clicks can't reach the veiled content. */
.cle-catalog.is-loading .cle-catalog__filters,
.cle-catalog.is-loading .cle-catalog__results {
	pointer-events: none;
	user-select: none;
}

@keyframes cleCatalogSpin {
	to {
		transform: rotate( 360deg );
	}
}
/* Featured Courses row */
.cle-featured {
	position: relative;
	z-index: 2;
	padding: var( --space-100-30, 3rem ) 0 0;
}

.cle-featured__title {
	margin: 0 0 24px;
	font-family: var( --font-udt-500, inherit );
	font-size: var( --h5, 25px );
	font-weight: 500;
	line-height: 1.3;
}

.cle-featured__grid {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 20px;
}

.cle-featured__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cle-featured__image {
	display: block;
	overflow: hidden;
	border-radius: 17px;
	outline: 2px solid var( --color-primary, #c39454 );
	outline-offset: -2px;
	background: #000000;
}

.cle-featured__image img,
.cle-featured__image .aws-course-card__placeholder {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: contain;
	transition: filter 0.2s ease;
}

.cle-featured__image:hover img {
	filter: brightness( 1.08 );
}

.cle-featured__label {
	margin: 18px 0 7px;
	color: #886026;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.1px;
	text-transform: uppercase;
}

.cle-featured__name {
	min-height: 86px;
	margin: 0 0 10px;
	font-family: var( --font-udt-600, inherit );
	font-size: 23px;
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.cle-featured__name a {
	color: var( --color-dark, #0b0b0b );
	text-decoration: none;
}

.cle-featured__name a:hover {
	color: var( --color-primary, #c39454 );
}

.cle-featured__focus {
	margin: 0 0 14px;
	color: #505050;
	font-size: 14px;
	line-height: 1.5;
}

.cle-featured__status {
	margin: 0 0 12px;
	color: #626262;
	font-size: 14px;
	line-height: 1.5;
}

.cle-featured .cle-featured__more,
.cle-catalog .aws-course-card .btn-link {
	display: inline-block;
	margin-top: auto;
	color: var( --color-dark, #0b0b0b );
	font-size: 14px;
	font-weight: 500;
	text-transform: uppercase;
	text-decoration: none;
}

.cle-featured .cle-featured__more:hover,
.cle-catalog .aws-course-card:hover .btn-link {
	color: var( --color-primary-dark, #a87e45 );
}

@media ( max-width: 800px ) {
	.cle-featured__name {
		min-height: 100px;
		font-size: 20px;
	}

	.cle-featured__focus,
	.cle-featured__status {
		font-size: 13px;
	}
}

@media ( max-width: 700px ) {
	.cle-featured__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		gap: 16px;
	}
}

@media ( max-width: 420px ) {
	.cle-featured__name {
		min-height: 0;
	}
}

/* Course Catalog — reference layout */
.cle-catalog .aws-course-catalog__header {
	margin-bottom: 45px;
}

.cle-catalog__filters {
	display: grid;
	grid-template-columns: repeat( 5, minmax( 0, 1fr ) ) auto;
	gap: 15px;
	padding: 18px 18px 38px;
	background: #faf7f0;
	border-color: #ece4d4;
	border-radius: 7px;
}

.cle-catalog__filter {
	min-width: 0;
	gap: 12px;
}

.cle-catalog__filter select {
	min-height: 44px;
	border-color: #dddddd;
	border-radius: 3px;
}

.cle-catalog__filter-actions .btn {
	height: 51px;
	white-space: nowrap;
}

.cle-catalog__filters:has( #cle-f-tag ) {
	grid-template-columns: repeat( 6, minmax( 0, 1fr ) ) auto;
}

@media ( max-width: 1050px ) {
	.cle-catalog__filters,
	.cle-catalog__filters:has( #cle-f-tag ) {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 700px ) {
	.cle-catalog__filters,
	.cle-catalog__filters:has( #cle-f-tag ) {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	.cle-catalog__filter-actions {
		grid-column: 1 / -1;
	}

	.cle-catalog__filter-actions .btn {
		width: 100%;
	}
}

.cle-catalog .blog-grid.row {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 48px 28px;
	margin: 28px 0 0;
}

.cle-catalog .blog-grid.row > .aws-course-card {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.cle-catalog .aws-course-card .blog-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: transparent;
	border-radius: 0;
}

.cle-catalog .aws-course-card .img-wrapper {
	margin-bottom: 0;
	border-radius: 17px;
	box-shadow: none;
	outline: 2px solid var( --color-primary, #c39454 );
	outline-offset: -2px;
}

.cle-catalog .aws-course-card .img-wrapper img {
	border-radius: 17px;
	transition: filter 0.2s ease;
}

.cle-catalog .aws-course-card:hover .img-wrapper img {
	transform: none;
	filter: brightness( 1.08 );
}

.cle-catalog .aws-course-card .content {
	padding: 0;
}

.cle-catalog .aws-course-card .tag {
	margin: 17px 0 0;
	padding: 3px 10px;
	border-radius: 30px;
	font-size: 12px;
	line-height: 1.5;
	text-transform: uppercase;
}

.cle-catalog .aws-course-card h5 {
	min-height: 60px;
	margin: 16px 0;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	text-wrap: pretty;
}

.cle-catalog .cle-card__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
}

.cle-catalog .cle-card__meta {
	margin: 16px 0;
	color: #626262;
	font-size: 14px;
	line-height: 21px;
}

.cle-catalog .cle-card__credit {
	color: #626262;
}

@media ( max-width: 1000px ) {
	.cle-catalog .blog-grid.row {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 600px ) {
	.cle-catalog .blog-grid.row {
		grid-template-columns: minmax( 0, 1fr );
	}

	.cle-catalog .aws-course-card h5 {
		min-height: 0;
	}

	.cle-catalog .aws-course-card .content {
		padding: 0;
	}
}

.cle-catalog .cle-catalog__results-wrap:has( .blog-grid ) {
	padding-left: 0;
	padding-right: 0;
}
