/* ==========================================================================
   Upcoming Events — [upcoming_events] shortcode
   ========================================================================== */

.ue-events {
	padding: 0;
	overflow-x: clip; /* never let the grid cause a horizontal scroll */
}

.ue-events__inner {
	/* Falls back to 1260px; the Barebone theme defines --site-width to match
	   Elementor's Content Width so every container lines up. */
	max-width: var(--site-width, 1260px);
	margin: 0 auto;
}

.ue-events__title {
	margin: 0 0 36px;
	text-align: center;
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	line-height: 1.15;
	color: #1a1a2e;
}

.ue-events__empty {
	text-align: center;
	color: #666;
}

/* Single-event featured image — force the 600 x 350 crop in CSS.
   The ue_event_thumb size is used when a real cropped file exists (needs the
   GD/Imagick PHP extension); otherwise object-fit shows the same framing. */
.single-event .event-featured {
	aspect-ratio: 600 / 350;
	overflow: hidden;
	border-radius: 4px;
}
.single-event .event-featured img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ue-events__grid {
	display: grid;
	/* minmax(0, 1fr) — not 1fr — so a card can shrink below its content's
	   intrinsic width instead of overflowing the row on small screens. */
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

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

.ue-event-card {
	display: flex;
	flex-direction: column;
	min-width: 0; /* allow the card to shrink inside the grid track */
	background: #f6f6f6;
	border-radius: 4px;
	overflow: hidden;
}

.ue-event-card__media {
	position: relative;
	aspect-ratio: 600 / 350; /* matches the ue_event_thumb crop size */
	background: #e2e2e2;
	overflow: hidden;
}

.ue-event-card__media-link {
	display: block;
	width: 100%;
	height: 100%;
}

.ue-event-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.ue-event-card__media-link:hover .ue-event-card__img,
.ue-event-card__media-link:focus-visible .ue-event-card__img {
	transform: scale(1.05);
}

.ue-event-card__badge {
	position: absolute;
	top: 18px;
	left: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 16px;
	background: rgba(20, 20, 20, 0.62);
	color: #ffffff;
	text-align: center;
}

.ue-event-card__day {
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}

.ue-event-card__month {
	margin-top: 3px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ue-event-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	padding: 20px;
}

.ue-event-card__meta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border-radius: 999px;
	background: #e9e9e9;
	color: #555555;
	font-size: 13px;
	line-height: 1;
}

.ue-event-card__meta svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.ue-event-card__btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 18px;
	background: #111111;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 2px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ue-event-card__btn:hover,
.ue-event-card__btn:focus {
	background: var(--accent, #ea6a0a);
	color: #ffffff;
}

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

@media (max-width: 991px) {
	.ue-events__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}
}

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