/**
 * Minimal baseline for [events_list] / .custom-event-listing.
 * Add theme or site CSS to build out layout and presentation.
 */

.custom-event-listing,
.custom-event-listing__items {
	display: block;
	margin: 0;
	padding: 0;
}

.custom-event-listing .event-item {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 0.75rem;
	margin: 0 0 20px;
	padding: 0;
	box-sizing: border-box;
}

.custom-event-listing .event-item:last-child {
	margin-bottom: 0;
}

.custom-event-listing .event-image {
	flex: 0 0 auto;
	width: 75px;
	margin: 0;
	padding: 0;
	line-height: 0;
	overflow: hidden;
}

.custom-event-listing .event-image a {
	display: block;
	line-height: 0;
}

.custom-event-listing .event-image img {
	display: block;
	width: 75px;
	height: 75px;
	max-width: 75px;
	max-height: 75px;
	object-fit: cover;
	margin: 0;
}

.custom-event-listing .event-content {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.custom-event-listing .event-title-text,
.custom-event-listing .event-date-text {
	display: block;
	margin: 0;
	padding: 0;
}

.custom-event-listing .event-title-text + .event-date-text {
	margin-top: 0.15rem;
}

.custom-event-listing .event-image:empty,
.custom-event-listing .event-image a:empty {
	display: none;
}

/* Multi-column grid via columns="2|3|4" on [events_list]. */
.custom-event-listing--cols-2 .custom-event-listing__items,
.custom-event-listing--cols-3 .custom-event-listing__items,
.custom-event-listing--cols-4 .custom-event-listing__items {
	display: grid;
	gap: 1.25rem;
	align-items: start;
}

.custom-event-listing--cols-2 .custom-event-listing__items {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custom-event-listing--cols-3 .custom-event-listing__items {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-event-listing--cols-4 .custom-event-listing__items {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.custom-event-listing--cols-2 .event-item,
.custom-event-listing--cols-3 .event-item,
.custom-event-listing--cols-4 .event-item {
	margin-bottom: 0;
}

@media (max-width: 640px) {
	.custom-event-listing--cols-2 .custom-event-listing__items,
	.custom-event-listing--cols-3 .custom-event-listing__items,
	.custom-event-listing--cols-4 .custom-event-listing__items {
		grid-template-columns: 1fr;
	}
}

/**
 * [delegatr_event_cards] — each occurrence is its own card; no outer list border.
 * Border/surface use Elementor kit globals when present; orange/white are fallbacks.
 * Title/date typography inherits from the surrounding Elementor widget / theme.
 */
.custom-event-listing.delegatr-event-cards {
	--delegatr-card-border: var(--e-global-color-primary, var(--e-global-color-accent, #e07a3a));
	--delegatr-card-border-hover: var(--e-global-color-accent, var(--e-global-color-secondary, #c45f28));
	--delegatr-card-bg: var(--e-global-color-secondary, #fff);
	border: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	transform: none !important;
	filter: none !important;
	opacity: 1 !important;
	font-family: inherit;
	color: inherit;
}

/* Multi-column: let shared --cols-* grid rules own layout (avoid flex fighting grid). */
.custom-event-listing.delegatr-event-cards.custom-event-listing--cols-2,
.custom-event-listing.delegatr-event-cards.custom-event-listing--cols-3,
.custom-event-listing.delegatr-event-cards.custom-event-listing--cols-4 {
	display: block;
	gap: 0;
}

.custom-event-listing.delegatr-event-cards.custom-event-listing--cols-2 .custom-event-listing__items,
.custom-event-listing.delegatr-event-cards.custom-event-listing--cols-3 .custom-event-listing__items,
.custom-event-listing.delegatr-event-cards.custom-event-listing--cols-4 .custom-event-listing__items {
	gap: 0.75rem;
}

/* Theme often styles .custom-event-listing:hover as one block — keep wrapper inert. */
.custom-event-listing.delegatr-event-cards:hover {
	border: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	transform: none !important;
	filter: none !important;
	opacity: 1 !important;
}

.custom-event-listing.delegatr-event-cards .event-item,
.custom-event-listing.delegatr-event-cards a.event-item {
	margin: 0;
	padding: 0.85rem 1rem;
	border: 2px solid var(--delegatr-card-border);
	border-radius: 10px;
	background: var(--delegatr-card-bg);
	box-sizing: border-box;
	transform: none;
	box-shadow: none;
	opacity: 1;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

.custom-event-listing.delegatr-event-cards .event-item:last-child {
	margin-bottom: 0;
}

.custom-event-listing.delegatr-event-cards .event-title-text,
.custom-event-listing.delegatr-event-cards .event-date-text,
.custom-event-listing.delegatr-event-cards .event-title-text a,
.custom-event-listing.delegatr-event-cards .event-content a {
	font-family: inherit;
	color: var(--e-global-color-text, inherit);
	text-decoration: none;
}

.custom-event-listing.delegatr-event-cards .event-image {
	width: 60px;
}

.custom-event-listing.delegatr-event-cards .event-image img {
	width: 60px;
	height: 60px;
	max-width: 60px;
	max-height: 60px;
}

.custom-event-listing.delegatr-event-cards .event-title-text {
	font-size: 0.875em;
	font-weight: 400;
}

.custom-event-listing.delegatr-event-cards .event-date-text {
	font-size: 0.9em;
	font-weight: 700;
}

/*
 * Theme may use .custom-event-listing:hover .event-item (styles ALL cards when any
 * child is hovered). Reset siblings to the resting card look.
 */
.custom-event-listing.delegatr-event-cards:hover .event-item {
	border-color: var(--delegatr-card-border) !important;
	background: var(--delegatr-card-bg) !important;
	box-shadow: none !important;
	transform: none !important;
	opacity: 1 !important;
	filter: none !important;
}

/* Only the card under the cursor gets hover treatment. */
.custom-event-listing.delegatr-event-cards .event-item:hover,
.custom-event-listing.delegatr-event-cards:hover .event-item:hover {
	border-color: var(--delegatr-card-border-hover) !important;
	background: var(--delegatr-card-bg) !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;
	transform: none !important;
	opacity: 1 !important;
	filter: none !important;
}
