/* NSCW Event Map */

.nscw-map {
	--nscw-blue: #23323e;
	--nscw-yellow: #fbb906;
	--nscw-beach: #f0e9dc;
	--nscw-ink: #1f2a33;
	--nscw-muted: #55606a;
	--nscw-surface: #ffffff;
	--nscw-water: #1b252e;
	--nscw-shadow: 0 2px 8px rgba(15, 25, 35, 0.28);
	position: relative;
	font-family: inherit;
	color: var(--nscw-ink);
}

.nscw-map [hidden] {
	display: none !important;
}

.nscw-map *,
.nscw-map *::before,
.nscw-map *::after {
	box-sizing: border-box;
}

.nscw-map__sr,
.nscw-map__skip:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.nscw-map__skip:focus {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 20;
	padding: 10px 14px;
	border-radius: 6px;
	background: var(--nscw-surface);
	color: var(--nscw-blue);
	font-weight: 600;
	text-decoration: underline;
	box-shadow: var(--nscw-shadow);
}

.nscw-map button,
.nscw-map a {
	font-family: inherit;
}

.nscw-map button:focus-visible,
.nscw-map a:focus-visible,
.nscw-map__panel-desc:focus-visible {
	outline: 3px solid var(--nscw-yellow);
	outline-offset: 2px;
}

.nscw-map .nscw-map__panel-title:focus {
	outline: none;
}

/* Frame */

.nscw-map__frame {
	position: relative;
	height: var(--nscw-map-height, 460px);
	overflow: hidden;
	background: var(--nscw-water);
}

.nscw-map__canvas {
	position: absolute;
	inset: 0;
}

.nscw-map__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 24px;
	color: #d7dde2;
	font-size: 15px;
	text-align: center;
	pointer-events: none;
}

.nscw-map__frame.is-ready .nscw-map__loading {
	display: none;
}

.nscw-map__frame.is-error .nscw-map__loading {
	pointer-events: auto;
	background: var(--nscw-water);
	z-index: 15;
}

.nscw-map__loading a {
	color: var(--nscw-yellow);
	font-weight: 600;
}

.nscw-map__frame:fullscreen {
	height: 100%;
	width: 100%;
}

.nscw-map__frame:-webkit-full-screen {
	height: 100%;
	width: 100%;
}

.nscw-map__frame.is-pseudo-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 100000;
	height: 100%;
	height: 100dvh;
}

html.nscw-map-lock,
html.nscw-map-lock body {
	overflow: hidden;
}

/* Filters */

.nscw-map__filters {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	padding: 8px;
	pointer-events: none;
}

.nscw-map__filter-track {
	flex: 0 1 auto;
	min-width: 0;
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
	pointer-events: auto;
}

.nscw-map__filter-track::-webkit-scrollbar {
	display: none;
}

.nscw-map__pill {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 6px 14px 6px 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--nscw-surface);
	color: var(--nscw-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: var(--nscw-shadow);
}

.nscw-map__pill img {
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.nscw-map__pill:hover {
	border-color: var(--nscw-blue);
}

.nscw-map__pill[aria-pressed="true"] {
	background: var(--nscw-blue);
	border-color: var(--nscw-yellow);
	color: #ffffff;
}

.nscw-map__pill[aria-pressed="true"] img {
	background: var(--nscw-surface);
	border-radius: 50%;
	padding: 2px;
}

.nscw-map__pill--reset {
	padding-left: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.nscw-map__scroll {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin-left: 8px;
	border: 0;
	border-radius: 50%;
	background: var(--nscw-surface);
	color: var(--nscw-ink);
	cursor: pointer;
	box-shadow: var(--nscw-shadow);
	pointer-events: auto;
}

.nscw-map__scroll svg {
	width: 20px;
	height: 20px;
}

/* Pins */

.nscw-map__pin {
	z-index: 2;
	display: block;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.nscw-map__pin-badge {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--nscw-surface);
	box-shadow: var(--nscw-shadow);
	transition: transform 0.15s ease;
}

.nscw-map__pin-badge img {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.nscw-map__pin:hover .nscw-map__pin-badge,
.nscw-map__pin:focus-visible .nscw-map__pin-badge,
.nscw-map__pin.is-active .nscw-map__pin-badge {
	transform: scale(1.15);
}

.nscw-map__pin.is-active .nscw-map__pin-badge {
	box-shadow: 0 0 0 3px var(--nscw-yellow), var(--nscw-shadow);
}

.nscw-map__pin:focus-visible {
	outline: none;
}

.nscw-map__pin:focus-visible .nscw-map__pin-badge {
	box-shadow: 0 0 0 3px var(--nscw-yellow), var(--nscw-shadow);
}

.nscw-map__pin:hover,
.nscw-map__pin:focus-visible,
.nscw-map__pin.is-active {
	z-index: 3;
}

.nscw-map__pin-label {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: 150px;
	padding: 4px 8px;
	border-radius: 4px;
	background: var(--nscw-surface);
	color: var(--nscw-ink);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	box-shadow: var(--nscw-shadow);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.nscw-map__pin:hover .nscw-map__pin-label,
.nscw-map__pin:focus-visible .nscw-map__pin-label {
	opacity: 1;
	visibility: visible;
}

.nscw-map__pin.is-active .nscw-map__pin-label {
	visibility: hidden;
}

.nscw-map__me {
	z-index: 1;
	pointer-events: none;
	display: block;
	width: 18px;
	height: 18px;
	border: 3px solid #ffffff;
	border-radius: 50%;
	background: #2f80ed;
	box-shadow: 0 0 0 6px rgba(47, 128, 237, 0.3);
}

/* Event panel */

.nscw-map__panel {
	position: absolute;
	top: 60px;
	left: 12px;
	z-index: 10;
	display: flex;
	flex-direction: column;
	width: 330px;
	max-width: calc(100% - 24px);
	max-height: calc(100% - 72px);
	padding: 14px 16px 16px;
	border-radius: 12px;
	background: var(--nscw-surface);
	box-shadow: 0 6px 24px rgba(15, 25, 35, 0.35);
}

.nscw-map__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.nscw-map__panel-type {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--nscw-muted);
	font-size: 14px;
}

.nscw-map__panel-type img {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.nscw-map__close {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex: none;
	padding: 0;
	border: 1px solid #d5dade;
	border-radius: 50%;
	background: var(--nscw-surface);
	color: var(--nscw-ink);
	cursor: pointer;
}

.nscw-map__close:hover {
	background: #f1f3f5;
}

.nscw-map__icon {
	display: inline-flex;
	flex: none;
}

.nscw-map__icon svg {
	width: 18px;
	height: 18px;
}

.nscw-map .nscw-map__panel-title {
	margin: 0 0 6px;
	color: var(--nscw-ink);
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
}

.nscw-map .nscw-map__panel-address {
	display: flex;
	gap: 6px;
	margin: 0 0 10px;
	color: var(--nscw-ink);
	font-size: 14px;
	line-height: 1.4;
}

.nscw-map__panel-address .nscw-map__icon {
	margin-top: 1px;
}

.nscw-map__panel-address .nscw-map__icon svg {
	width: 16px;
	height: 16px;
}

.nscw-map__panel-desc {
	flex: 1 1 auto;
	min-height: 60px;
	overflow-y: auto;
	padding-right: 4px;
	color: var(--nscw-muted);
	font-size: 14px;
	line-height: 1.5;
}

.nscw-map .nscw-map__panel-desc p {
	margin: 0 0 10px;
}

.nscw-map .nscw-map__panel-desc p:last-child {
	margin-bottom: 0;
}

.nscw-map__panel-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.nscw-map .nscw-map__button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 12px;
	border-radius: 6px;
	background: var(--nscw-blue);
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.nscw-map .nscw-map__button:hover {
	background: #344a5b;
	color: #ffffff;
}

/* Controls */

.nscw-map__controls {
	position: absolute;
	right: 10px;
	bottom: 34px;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.nscw-map__zoom {
	display: flex;
	flex-direction: column;
	border-radius: 6px;
	background: var(--nscw-surface);
	box-shadow: var(--nscw-shadow);
	overflow: hidden;
}

.nscw-map__control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 0;
	background: var(--nscw-surface);
	color: var(--nscw-ink);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.nscw-map__zoom .nscw-map__control + .nscw-map__control {
	border-top: 1px solid #e1e5e8;
}

.nscw-map__control--text {
	padding: 0 12px;
	border-radius: 6px;
	box-shadow: var(--nscw-shadow);
}

.nscw-map__control:hover {
	background: #f1f3f5;
}

.nscw-map__control .nscw-map__icon svg {
	width: 16px;
	height: 16px;
}

.nscw-map__jumps {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.nscw-map__jump {
	padding: 6px 10px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--nscw-ink);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: var(--nscw-shadow);
}

.nscw-map__jump:hover {
	background: var(--nscw-surface);
}

.nscw-map__status {
	position: absolute;
	left: 50%;
	bottom: 52px;
	z-index: 12;
	transform: translateX(-50%);
	max-width: calc(100% - 140px);
	margin: 0;
	padding: 8px 14px;
	border-radius: 6px;
	background: var(--nscw-blue);
	color: #ffffff;
	font-size: 14px;
	line-height: 1.35;
	text-align: center;
	box-shadow: var(--nscw-shadow);
}

.nscw-map__status:empty {
	padding: 0;
	box-shadow: none;
	background: none;
}

/* MapLibre attribution and gesture hint */

.nscw-map .maplibregl-ctrl-attrib {
	font-size: 11px;
}

.nscw-map .maplibregl-cooperative-gesture-screen {
	font-family: inherit;
}

/* Small screens */

@media (max-width: 640px) {
	.nscw-map__frame {
		height: max(440px, min(var(--nscw-map-height, 460px), 75vh));
	}

	.nscw-map__frame.is-pseudo-fullscreen,
	.nscw-map__frame:fullscreen {
		height: 100%;
	}

	.nscw-map__panel {
		top: auto;
		left: 8px;
		right: 8px;
		bottom: 8px;
		width: auto;
		max-width: none;
		max-height: 65%;
	}

	.nscw-map__control--text span:not(.nscw-map__icon) {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.nscw-map__control--text {
		width: 36px;
		padding: 0;
	}

	.nscw-map__status {
		max-width: calc(100% - 80px);
		bottom: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nscw-map__pin-badge {
		transition: none;
	}
}

/*
 * Theme button resets.
 * Kadence and other themes style every <button> on hover and focus. These
 * rules are more specific so map buttons keep their own look.
 */

html body .nscw-map .nscw-map__pin,
html body .nscw-map .nscw-map__pin:hover,
html body .nscw-map .nscw-map__pin:focus,
html body .nscw-map .nscw-map__pin:active {
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit !important;
}

.nscw-map .nscw-map__pill:hover,
.nscw-map .nscw-map__pill:focus,
.nscw-map .nscw-map__pill:active {
	background: var(--nscw-surface);
	color: var(--nscw-ink);
	box-shadow: var(--nscw-shadow);
}

.nscw-map .nscw-map__pill:hover {
	border-color: var(--nscw-blue);
}

.nscw-map .nscw-map__pill[aria-pressed="true"],
.nscw-map .nscw-map__pill[aria-pressed="true"]:hover,
.nscw-map .nscw-map__pill[aria-pressed="true"]:focus {
	background: var(--nscw-blue);
	border-color: var(--nscw-yellow);
	color: #ffffff;
}

.nscw-map .nscw-map__control:hover,
.nscw-map .nscw-map__control:focus,
.nscw-map .nscw-map__control:active,
.nscw-map .nscw-map__close:hover,
.nscw-map .nscw-map__close:focus,
.nscw-map .nscw-map__close:active,
.nscw-map .nscw-map__scroll:hover,
.nscw-map .nscw-map__scroll:focus,
.nscw-map .nscw-map__jump:hover,
.nscw-map .nscw-map__jump:focus {
	background: #f1f3f5;
	color: var(--nscw-ink);
}

.nscw-map .nscw-map__close:hover,
.nscw-map .nscw-map__close:focus {
	border-color: #d5dade;
}

/* Keyboard focus stays visible for accessibility. */
.nscw-map .nscw-map__pin:focus-visible .nscw-map__pin-badge {
	box-shadow: 0 0 0 3px var(--nscw-yellow), var(--nscw-shadow);
}

.nscw-map .nscw-map__pin:hover:not(:focus-visible):not(.is-active) .nscw-map__pin-badge {
	box-shadow: var(--nscw-shadow);
}
