.abbazia-event-popup {
	width: min(560px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
	max-width: none;
	max-height: calc(100vh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 1px solid var(--bronze, #8b7c61);
	border-radius: 2px;
	background: var(--paper, #f6f1e6);
	color: var(--ink, #2c2318);
	font-family: var(--sans, sans-serif);
	box-shadow: 0 24px 80px rgba(26, 20, 12, 0.35);
	overscroll-behavior: contain;
	scrollbar-color: var(--bronze, #8b7c61) var(--paper, #f6f1e6);
}

.abbazia-event-popup:not([open]) {
	display: none;
}

.abbazia-event-popup::backdrop {
	background: rgba(26, 20, 12, 0.8);
}

.abbazia-event-popup-header {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 12px 10px 24px;
	background: var(--paper, #f6f1e6);
}

.abbazia-event-popup-heading {
	min-width: 0;
}

.abbazia-event-popup-header h2 {
	margin: 0;
	font-family: var(--serif, Georgia, serif);
	font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
	font-weight: 500;
	line-height: 1.1;
}

.abbazia-event-popup-date {
	display: block;
	margin-top: 6px;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.5;
	text-wrap: balance;
}

.abbazia-event-popup-close {
	display: grid;
	flex: 0 0 44px;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: transparent;
	color: var(--ink, #2c2318);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.abbazia-event-popup-close:hover {
	background: var(--paper-3, #e8dfcc);
}

.abbazia-event-popup :focus-visible {
	outline: 2px solid var(--gold-text, #776035);
	outline-offset: 2px;
}

.abbazia-event-popup-poster {
	display: flex;
	justify-content: center;
	padding: 0 12px;
}

.abbazia-event-popup-poster img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100vh - 184px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	max-height: calc(100dvh - 184px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	object-fit: contain;
}

.abbazia-event-popup-footer {
	padding: 8px 24px 12px;
	text-align: center;
	font-size: 0.875rem;
	line-height: 1.5;
}

.abbazia-event-popup-footer a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	color: var(--gold-text, #776035);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.abbazia-event-popup-footer a:hover {
	color: var(--ink, #2c2318);
}

.abbazia-event-popup-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 600px) {

	.abbazia-event-popup {
		width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
		max-height: calc(100vh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
		max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	}

	.abbazia-event-popup-header {
		gap: 8px;
		padding: 10px 8px 10px 12px;
	}

	.abbazia-event-popup-header h2 {
		font-size: 1.625rem;
	}

	.abbazia-event-popup-date {
		margin-top: 4px;
		font-size: 0.75rem;
	}

	.abbazia-event-popup-poster {
		padding: 0 8px;
	}

	.abbazia-event-popup-poster img {
		width: 100%;
		max-height: none;
	}

	.abbazia-event-popup-footer {
		padding: 4px 12px 8px;
	}
}

@media (max-height: 600px) {

	.abbazia-event-popup-poster img {
		width: 100%;
		max-height: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.abbazia-event-popup-close {
		transition: none;
	}
}
