/**
 * Map page styles.
 *
 * Page header sits above a full-bleed dark map canvas. Reuses the
 * .ce-map-marker pulse marker from event-instance.css and adds a
 * --clickable modifier so the entire marker is the click target for
 * its popup. Popup chrome is restyled to match the dark token palette.
 *
 * @since 2.3.0
 */

.ce-map-page {
	display: flex;
	flex-direction: column;
	min-height: calc( 100vh - var(--topnav-h, 64px) );
	background: var(--bg);
}

.ce-map-page__header {
	max-width: 960px;
	margin: 0 auto;
	padding: 48px 24px 24px;
	text-align: center;
}

.ce-map-page__title {
	margin: 8px 0 12px;
	font-size: clamp( 1.75rem, 4vw, 2.75rem );
	line-height: 1.1;
	color: var(--fg);
}

.ce-map-page__sub {
	margin: 0 auto;
	max-width: 56ch;
	color: var(--fg-muted, oklch(72% 0.02 250));
	font-size: 1rem;
	line-height: 1.5;
}

.ce-map-page__map {
	position: relative;
	flex: 1;
	min-height: 60vh;
	margin: 16px 0 0;
	background: oklch(14% 0.01 250);
	border-top: 1px solid oklch(22% 0.01 250);
	border-bottom: 1px solid oklch(22% 0.01 250);
}

.ce-map-page__map:focus {
	outline: none;
}

.ce-map-page__empty {
	position: absolute;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	padding: 10px 16px;
	border-radius: 999px;
	background: oklch(18% 0.01 250 / 0.92);
	color: var(--fg, #f8fafc);
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	box-shadow: 0 8px 24px oklch(0% 0 0 / 0.4);
}

.ce-map-page__noscript {
	padding: 24px;
	text-align: center;
	color: var(--fg-muted, oklch(72% 0.02 250));
}

/* Clickable variant of the shared marker — base sets pointer-events: none. */
.ce-map-marker--clickable {
	pointer-events: auto;
	cursor: pointer;
}

.ce-map-marker--clickable:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
	border-radius: 50%;
}

/* Popup chrome — light card on dark basemap for high contrast. */
.maplibregl-popup.ce-map-popup-wrap .maplibregl-popup-content {
	background: #ffffff;
	color: oklch(18% 0.01 250);
	border: 1px solid oklch(88% 0.01 250);
	border-radius: 12px;
	padding: 14px 16px;
	box-shadow: 0 16px 40px oklch(0% 0 0 / 0.55), 0 0 0 1px oklch(0% 0 0 / 0.25);
	font-family: var(--font-sans);
}

.maplibregl-popup.ce-map-popup-wrap .maplibregl-popup-close-button {
	color: oklch(42% 0.01 250);
	font-size: 20px;
	padding: 2px 8px;
}

.maplibregl-popup.ce-map-popup-wrap .maplibregl-popup-close-button:hover {
	color: oklch(18% 0.01 250);
	background: transparent;
}

.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
	border-bottom-color: #ffffff;
}

.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
	border-top-color: #ffffff;
}

.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-left .maplibregl-popup-tip {
	border-right-color: #ffffff;
}

.maplibregl-popup.ce-map-popup-wrap.maplibregl-popup-anchor-right .maplibregl-popup-tip {
	border-left-color: #ffffff;
}

.ce-map-popup {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 200px;
	max-width: 260px;
}

.ce-map-popup__title {
	color: oklch(18% 0.01 250);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.25;
	text-decoration: none;
}

.ce-map-popup__title:hover,
.ce-map-popup__title:focus-visible {
	color: oklch(40% 0.18 250);
	text-decoration: underline;
}

.ce-map-popup__when {
	color: oklch(40% 0.18 250);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ce-map-popup__city,
.ce-map-popup__series {
	color: oklch(38% 0.01 250);
	font-size: 0.875rem;
	line-height: 1.35;
}

@media ( max-width: 640px ) {
	.ce-map-page__header {
		padding: 24px 16px 16px;
	}
	.ce-map-page__map {
		min-height: 70vh;
	}
}
