/*
 * **********************************************************************
 * Events Popup Styles
 *
 * Modal that shows events occurring within the next seven days.
 * Displayed once per calendar day via a midnight-expiring cookie.
 * On mobile (≤ 480 px) renders as a bottom sheet.
 *
 * @version  1.0.0
 * @updated  2026-06-19
 * **********************************************************************
 */

/* =============================================================================
   Wrapper / overlay
   ============================================================================= */

.mah-ep {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	animation: mah-ep-fade .25s ease;
}

.mah-ep[hidden] {
	display: none;
}

@keyframes mah-ep-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.mah-ep__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

/* =============================================================================
   Dialog
   ============================================================================= */

.mah-ep__dialog {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border-radius: 14px;
	max-width: 440px;
	width: 100%;
	max-height: 85vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
	animation: mah-ep-rise .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes mah-ep-rise {
	from { transform: translateY(24px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* =============================================================================
   Header
   ============================================================================= */

.mah-ep__header {
	display: flex;
	align-items: center;
	gap: .5rem;
	background: #2b7f4b;
	color: #ffffff;
	padding: 1rem 1.25rem;
	flex-shrink: 0;
}

.mah-ep__icon {
	font-size: 1.2rem;
	line-height: 1;
	flex-shrink: 0;
}

.mah-ep__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	flex: 1;
	letter-spacing: .01em;
}

.mah-ep__close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, .8);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	flex-shrink: 0;
	transition: background .15s;
}

.mah-ep__close:hover,
.mah-ep__close:focus {
	background: rgba(255, 255, 255, .2);
	color: #ffffff;
	outline: none;
}

/* =============================================================================
   Body — scrollable event list
   ============================================================================= */

.mah-ep__body {
	padding: 1.25rem;
	overflow-y: auto;
	flex: 1;
}

.mah-ep__loading {
	color: #777;
	text-align: center;
	padding: 1rem 0;
	margin: 0;
	font-style: italic;
}

/* =============================================================================
   Event cards
   ============================================================================= */

.mah-ep__event {
	display: flex;
	flex-direction: column;
	gap: .2rem;
	padding: .7rem 0 .7rem 1rem;
	border-left: 3px solid #2b7f4b;
	margin-bottom: .75rem;
}

.mah-ep__event:last-child {
	margin-bottom: 0;
}

.mah-ep__event-name {
	font-weight: 700;
	color: #1a2e1f;
	font-size: .95rem;
	line-height: 1.3;
}

.mah-ep__event-when {
	color: #555;
	font-size: .85rem;
}

/* ── Status badges ───────────────────────────────────────────────────────── */

.mah-ep__badge {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: .15rem .45rem;
	border-radius: 4px;
	align-self: flex-start;
	margin-top: .1rem;
	background: #fdf3e7;
	color: #8a5200;
}

.mah-ep__badge--sold-out,
.mah-ep__badge--cancelled {
	background: #fde7e7;
	color: #8a0000;
}

.mah-ep__badge--postponed,
.mah-ep__badge--rescheduled {
	background: #fdf3e7;
	color: #8a5200;
}

/* =============================================================================
   Footer
   ============================================================================= */

.mah-ep__footer {
	padding: 1rem 1.25rem;
	border-top: 1px solid #eee;
	text-align: center;
	flex-shrink: 0;
}

.mah-ep__btn {
	display: inline-block;
	background: #2b7f4b;
	color: #ffffff;
	font-weight: 700;
	font-size: .9rem;
	padding: .6rem 1.75rem;
	border-radius: 6px;
	text-decoration: none;
	letter-spacing: .02em;
	transition: background .2s;
}

.mah-ep__btn:hover,
.mah-ep__btn:focus {
	background: #236640;
	color: #ffffff;
	outline: none;
}

/* =============================================================================
   Mobile — bottom sheet
   ============================================================================= */

@media (max-width: 480px) {
	.mah-ep {
		align-items: flex-end;
		padding: 0;
	}

	.mah-ep__dialog {
		max-height: 90vh;
		border-radius: 14px 14px 0 0;
	}
}

/* =============================================================================
   Reduced motion
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
	.mah-ep,
	.mah-ep__dialog {
		animation: none;
	}
}
