/**
 * Previous Events listing.
 */

.pe-events {
	--pe-columns: 2;
	--pe-gap: 28px;
	--pe-radius: 16px;
	--pe-media-radius: 12px;
	--pe-media-ratio: 2.6;

	--pe-surface: #ffffff;
	--pe-border: #e6e8ee;
	--pe-title: #0f1d33;
	--pe-muted: #8b93a7;
	--pe-text: #5b6577;
	--pe-accent: #c8102e;
	--pe-pill-bg: #ffffff;
	--pe-pill-text: #475569;
	--pe-pill-active-bg: #101828;
	--pe-pill-active-text: #ffffff;

	position: relative;
	box-sizing: border-box;
}

.pe-events *,
.pe-events *::before,
.pe-events *::after {
	box-sizing: inherit;
}

/* ------------------------------------------------------------------ Toolbar */

.pe-events__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 26px;
}

.pe-events__toolbar-spacer {
	flex: 1 1 auto;
}

.pe-events__filters {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.pe-events__pill {
	display: inline-flex;
	align-items: center;
	padding: 9px 20px;
	border: 1px solid var(--pe-border);
	border-radius: 999px;
	background: var(--pe-pill-bg);
	color: var(--pe-pill-text)!important;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.pe-events__pill:hover,
.pe-events__pill:focus-visible {
	border-color: #c9ced9;
	color: var(--pe-title);
	text-decoration: none;
}

.pe-events__pill.is-active {
	background: var(--pe-pill-active-bg)!important;
	border-color: var(--pe-pill-active-bg)!important;
	color: var(--pe-pill-active-text)!important;
}

/* -------------------------------------------------------------------- Order */

.pe-events__sort {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	margin-left: auto;
}

.pe-events__sort-label {
	font-size: 14px;
	font-weight: 500;
	color: var(--pe-muted);
}

.pe-events__select {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.pe-events__select select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	margin: 0;
	padding: 9px 38px 9px 18px;
	border: 1px solid var(--pe-border);
	border-radius: 999px;
	background: var(--pe-surface);
	color: var(--pe-title);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	max-width: 100%;
}

.pe-events__select select:focus-visible {
	outline: 2px solid var(--pe-title);
	outline-offset: 1px;
}

.pe-events__select-icon {
	position: absolute;
	right: 16px;
	pointer-events: none;
	color: var(--pe-muted);
}

.pe-events__sort-submit {
	padding: 9px 16px;
	border: 1px solid var(--pe-border);
	border-radius: 999px;
	background: var(--pe-surface);
	font-size: 14px;
	cursor: pointer;
}

/* --------------------------------------------------------------------- Grid */

.pe-events__grid {
	display: grid;
	grid-template-columns: repeat(var(--pe-columns), minmax(0, 1fr));
	gap: var(--pe-gap);
}

.pe-events__results {
	transition: opacity .18s ease;
}

.pe-events.is-loading .pe-events__results {
	opacity: .45;
	pointer-events: none;
}

.pe-events__empty {
	margin: 0;
	padding: 40px 0;
	color: var(--pe-muted);
	text-align: center;
}

/* --------------------------------------------------------------------- Card */

.pe-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--pe-border);
	border-radius: var(--pe-radius);
	background: var(--pe-surface);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	transition: box-shadow .2s ease, transform .2s ease;
}

.pe-card:hover {
	box-shadow: 0 10px 28px rgba(16, 24, 40, .08);
	transform: translateY(-2px);
}

.pe-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-top-left-radius: var(--pe-media-radius);
	border-top-right-radius: var(--pe-media-radius);
	aspect-ratio: var(--pe-media-ratio);
	background: #eef0f4;
	text-decoration: none;
}

.pe-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

.pe-card:hover .pe-card__image {
	transform: scale(1.03);
}

.pe-card__image--placeholder {
	background: linear-gradient(135deg, #e9ecf2 0%, #dfe3ea 100%);
}

.pe-card__play {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(16, 24, 40, .55);
	color: #ffffff;
	backdrop-filter: blur(2px);
}

.pe-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 24px;
}

.pe-card__meta {
	margin: 0 0 8px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--pe-muted);
}

.pe-card__title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--pe-title);
}

.pe-card__title a {
	color: inherit;
	text-decoration: none;
}

.pe-card__title a:hover,
.pe-card__title a:focus-visible {
	text-decoration: underline;
}

.pe-card__excerpt {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.65;
	color: var(--pe-text);
}

.pe-card__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	color: var(--pe-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	align-self: flex-start;
}

.pe-card__link svg {
	transition: transform .2s ease;
}

.pe-card__link:hover svg,
.pe-card:hover .pe-card__link svg {
	transform: translateX(4px);
}

.pe-card__link:hover,
.pe-card__link:focus-visible {
	color: var(--pe-accent);
	text-decoration: none;
}

/* --------------------------------------------------------------- Pagination */

.pe-events__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 32px;
}

.pe-events__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--pe-border);
	border-radius: 999px;
	background: var(--pe-surface);
	color: var(--pe-pill-text)!important;
	font-size: 14px;
	text-decoration: none;
}

.pe-events__pagination .page-numbers.current {
	background: var(--pe-pill-active-bg);
	border-color: var(--pe-pill-active-bg);
	color: var(--pe-pill-active-text);
}

.pe-events__pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ------------------------------------------------------------------ Loading */

.pe-events__loader {
	position: absolute;
	top: 50%;
	left: 50%;
	display: none;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	pointer-events: none;
}

.pe-events.is-loading .pe-events__loader {
	display: block;
}

.pe-events__loader span {
	display: block;
	width: 100%;
	height: 100%;
	border: 2px solid rgba(16, 24, 40, .15);
	border-top-color: var(--pe-accent);
	border-radius: 50%;
	animation: pe-events-spin .7s linear infinite;
}

@keyframes pe-events-spin {
	to {
		transform: rotate(360deg);
	}
}

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

	.pe-events *,
	.pe-events *::before,
	.pe-events *::after {
		transition: none !important;
		animation: none !important;
	}
}

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

@media (max-width: 1024px) {
	.pe-events {
		--pe-gap: 22px;
	}

	.pe-events__grid {
		grid-template-columns: repeat(min(var(--pe-columns), 2), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.pe-events__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.pe-events__toolbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.pe-events__sort {
		margin-left: 0;
		width: 100%;
	}

	.pe-events__select,
	.pe-events__select select {
		width: 100%;
	}

	.pe-card__title {
		font-size: 18px;
	}
}

/* Fallback for themes that do not ship the class. */
.pe-events .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}