/* ==========================================================================
   Event Card — Reusable card component for event listings
   Used on Homepage, What's On, Search, and cross-sell sections
   ========================================================================== */

.event-card {
	background-color: var(--color-bg);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--color-border);
	display: flex;
	flex-direction: column;
}

.event-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.event-card__link:hover {
	color: inherit;
}

.event-card__link:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: -3px;
	border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Image area
   -------------------------------------------------------------------------- */

.event-card__image {
	position: relative;
	aspect-ratio: 16 / 10;
	background-size: cover;
	background-position: center;
	overflow: hidden;
	display: flex;
	align-items: flex-end;
}

.event-card__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Category badge — top left */
.event-card__category {
	position: absolute;
	top: var(--space-sm);
	left: var(--space-sm);
	z-index: 2;
}

/* Availability badge — top right */
.event-card__availability {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	z-index: 2;
}

/* Dark overlay at bottom for text readability when card has no body text in image */
.event-card__image::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 40%;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
	pointer-events: none;
	z-index: 1;
}

/* --------------------------------------------------------------------------
   Body / content area
   -------------------------------------------------------------------------- */

.event-card__body {
	padding: var(--space-md);
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: var(--space-xs);
}

.event-card__title {
	font-family: var(--font-heading);
	font-size: var(--text-xl);
	font-weight: var(--weight-bold);
	line-height: var(--leading-snug);
	color: var(--color-dark);
	margin: 0;
}

.event-card__date {
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--color-primary);
	margin: 0;
}

.event-card__summary {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	line-height: var(--leading-normal);
	margin: 0;
	/* Clamp to 3 lines */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.event-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	margin-top: auto;
	padding-top: var(--space-xs);
}

.event-card__price {
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	color: var(--color-dark);
}

.event-card__runtime {
	font-size: var(--text-xs);
	color: var(--color-text-muted);
}

.event-card__cta {
	margin-top: var(--space-sm);
	align-self: flex-start;
}

/* --------------------------------------------------------------------------
   Variant: Compact — smaller card for sidebars and cross-sell
   -------------------------------------------------------------------------- */

.event-card--compact .event-card__image {
	aspect-ratio: 16 / 9;
}

.event-card--compact .event-card__body {
	padding: var(--space-sm) var(--space-md);
}

.event-card--compact .event-card__title {
	font-size: var(--text-lg);
}

/* --------------------------------------------------------------------------
   Variant: Featured — larger card for hero-adjacent placement
   -------------------------------------------------------------------------- */

.event-card--featured .event-card__image {
	aspect-ratio: 16 / 12;
}

.event-card--featured .event-card__title {
	font-size: var(--text-2xl);
}

.event-card--featured .event-card__summary {
	-webkit-line-clamp: 4;
}

/* --------------------------------------------------------------------------
   Event grid layouts
   -------------------------------------------------------------------------- */

.event-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-lg);
}

@media (min-width: 480px) {
	.event-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.event-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.event-grid--4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Stagger the fade-in animation for grid items */
@media (prefers-reduced-motion: no-preference) {
	.event-grid .event-card:nth-child(1) { transition-delay: 0ms; }
	.event-grid .event-card:nth-child(2) { transition-delay: 80ms; }
	.event-grid .event-card:nth-child(3) { transition-delay: 160ms; }
	.event-grid .event-card:nth-child(4) { transition-delay: 240ms; }
	.event-grid .event-card:nth-child(5) { transition-delay: 320ms; }
	.event-grid .event-card:nth-child(6) { transition-delay: 400ms; }
}
