/*
 * SpeakEasy Events List — frontend styles.
 *
 * Layout-only defaults; everything visual is configurable from Elementor's
 * Style tab via the widget's `selectors` (see class-...-widget-events-list.php).
 *
 * CSS var: --se-events-aspect = width / height (e.g. 0.5625 for 9:16 flyer).
 */

.se-events-list {
	width: 100%;
}

.se-events-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	column-gap: 16px;
	row-gap: 32px;
	width: 100%;
}

.se-events-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.se-events-card__media {
	position: relative;
	width: 100%;
	overflow: hidden;
	aspect-ratio: var(--se-events-aspect, 0.5625) / 1;
	/* Fallback for browsers without aspect-ratio support. */
	padding-top: calc(100% / var(--se-events-aspect, 0.5625));
}

/* Browsers that DO support aspect-ratio remove the padding-top hack. */
@supports (aspect-ratio: 1) {
	.se-events-card__media {
		padding-top: 0;
	}
}

.se-events-card__image,
.se-events-card__placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

/*
 * Flyer image — fits inside the aspect-ratio slot without cropping, centered
 * both horizontally and vertically. `contain` is used uniformly because flyers
 * delivered by SpeakEasy may have arbitrary aspect ratios (real promo art OR
 * a venue-logo placeholder) and we always want to show the full image.
 */
.se-events-card__image {
	object-fit: contain;
	object-position: center center;
	width: 100%;
	height: 100% !important;
}

/* Empty-state placeholder when no flyer/logo URL is available. */
.se-events-card__placeholder {
	background-color: #1a1a1a;
}

.se-events-card__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 16px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 200ms ease;
	background-color: rgba(0, 0, 0, 0.55);
}

/* Reveal on hover (desktop) and on .is-active (mobile tap toggled by JS). */
.se-events-card:hover .se-events-card__overlay,
.se-events-card.is-active .se-events-card__overlay,
.se-events-card:focus-within .se-events-card__overlay {
	opacity: 1;
	pointer-events: auto;
}

.se-events-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	padding: 12px 24px;
	color: #fff;
	background-color: #c8102e;
	text-decoration: none;
	font-weight: 600;
	line-height: 1;
	border-radius: 4px;
	transition: background-color 150ms ease, color 150ms ease;
}

.se-events-card__btn:hover,
.se-events-card__btn:focus-visible {
	text-decoration: none;
}

/*
 * Date / title spacing.
 *
 * The element that sits IMMEDIATELY after the media gets a larger top gap;
 * the second one (whichever it is, depending on the `date_position` setting)
 * gets a tight gap to its sibling. This keeps the look consistent whether the
 * date is above or below the title.
 */
.se-events-card__date,
.se-events-card__title {
	margin: 4px 0 0;
	line-height: 1.25;
}

.se-events-card__media + .se-events-card__date,
.se-events-card__media + .se-events-card__title {
	margin-top: 12px;
}

.se-events-card__date {
	font-size: 0.85em;
	line-height: 1.4;
}

.se-events-card__title {
	font-size: 1em;
	text-transform: uppercase;
}

.se-events-empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 24px 0;
	text-align: center;
	opacity: 0.7;
}

.se-events-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.se-events-load-more-wrap[hidden] {
	display: none;
}

.se-events-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 32px;
	color: #fff;
	background-color: #c8102e;
	border: none;
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease;
}

.se-events-load-more[disabled] {
	opacity: 0.6;
	cursor: progress;
}
