/* ============================================================
   Wilder Map Element — Program Grid Widget
   ============================================================ */

/* ---- Filter bar ---- */

.wme-program-filters {
	display: flex;
	align-items: flex-end;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: 40px;
}

.wme-filter-groups {
	display: flex;
	align-items: flex-end;
	gap: 50px;
	flex: 1;
	flex-wrap: wrap;
}

.wme-filter-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wme-filter-group__label {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #1d2327;
}

/* Vertical divider between groups */
.wme-filter-sep {
	display: none;
	width: 1px;
	height: 58px;
	background: #d4d4d4;
	align-self: flex-end;
	flex-shrink: 0;
}

.wme-filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wme-filter-pill {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	font-weight: 500;
	border-radius: 9999px;
	border-width: 1.5px;
	border-style: solid;
	border-color: #1d2327;
	background: transparent;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
	font-family: inherit;
	text-decoration: none;
}

.wme-filter-pill:hover,
.wme-filter-pill.is-active {
	background: #1d2327;
	color: #fff;
	text-decoration: none !important;
}

.wme-filter-reset {
	padding: 8px 4px;
	border: none;
	background: transparent;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	color: #1d2327;
	white-space: nowrap;
	font-family: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	align-self: flex-end;
}

.wme-filter-reset:hover {
	opacity: 0.65;
}

/* ---- Region select ---- */

.wme-region-select {
	display: block;
	padding: 8px 36px 8px 18px;
	border-radius: 9999px;
	border-width: 1.5px;
	border-style: solid;
	border-color: #1d2327;
	background: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231d2327' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 10px 7px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	font-size: 14px;
	font-family: inherit;
	color: #1d2327;
	cursor: pointer;
	min-width: 160px;
	line-height: 1.4;
}

.wme-region-select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba( 34, 113, 177, 0.2 );
}

/* ---- Program cards grid ---- */

.wme-program-cards {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 20px;
}

/* ---- Individual card ---- */

.wme-program-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}

.wme-program-card:hover .wme-program-card__image img {
	transform: scale( 1.03 );
}

.wme-program-card__image {
	position: relative;
	width: 100%;
	padding-bottom: 75%;   /* 4:3 default; overridden by Elementor slider */
	overflow: hidden;
	background: #d4d4d4;
}

.wme-program-card__image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.wme-program-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 14px;
	text-align: center;
	line-height: 1.4;
}

/* Status badge — overlaid on image */
.wme-program-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 4px 10px;
	line-height: 1.4;
}

.wme-program-card__badge--active {
	background: #1d2327;
	color: #fff;
}

.wme-program-card__badge--complete {
	background: #fff;
	color: #1d2327;
	border: 1.5px solid #1d2327;
}

.wme-program-card__body {
	padding: 14px 0 0;
}

.wme-program-card__title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	line-height: 1.35;
}

/* ---- Empty state ---- */

.wme-program-grid__empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #646970;
	padding: 48px 0;
	font-size: 15px;
	margin: 0;
}

/* ---- AJAX program grid ---- */

.wpf-program-grid__items {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 20px;
}

.wpf-program-grid {
	transition: opacity 0.2s ease;
}

.wpf-program-grid.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

/* ---- Load more ---- */

.wpf-load-more {
	text-align: center;
	margin-top: 48px;
}

.wpf-load-more__btn {
	display: inline-flex;
	align-items: center;
	padding: 10px 32px;
	border-radius: 9999px;
	border: 1.5px solid #1d2327;
	background: transparent;
	color: #1d2327;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wpf-load-more__btn:hover {
	background: #1d2327;
	color: #fff;
}

[hidden] { display: none !important; }

/* ---- Responsive ---- */

@media ( max-width: 1024px ) {
	.wme-program-cards,
	.wpf-program-grid__items {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 768px ) {
	.wme-program-cards,
	.wpf-program-grid__items {
		grid-template-columns: repeat( 2, 1fr );
	}
	.wme-filter-sep {
		display: none;
	}
	.wme-program-filters {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media ( max-width: 480px ) {
	.wme-program-cards,
	.wpf-program-grid__items {
		grid-template-columns: 1fr;
	}
}

/* ---- AJAX grid loading state ---- */

.wpf-ajax-grid {
	transition: opacity 0.2s ease;
}

.wpf-ajax-grid.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

/* Equalise loop-item row heights after AJAX content injection.
   Elementor may set align-items:start on the loop container (or rely on JS
   it runs at page-load which doesn't re-fire after innerHTML replacement).
   Overriding with stretch here is the CSS half of the fix; the JS half
   measures and sets min-height after each AJAX response. */
.wpf-ajax-grid .elementor-loop-container {
	align-items: stretch !important;
}

.wpf-ajax-grid .e-loop-item {
	display: flex !important;
	flex-direction: column;
}
