/* SWDS project map: uses the theme's tokens with safe fallbacks. */
.swds-map-app {
	--m-accent: var(--swds-accent, #CA8A04);
	--m-black: var(--swds-black, #171717);
	--m-line: rgba(255, 255, 255, 0.1);
	--m-ease: cubic-bezier(.2, .7, .2, 1);
	color: #fff;
}

/* Toolbar: tally, type chips, search. */
.swds-map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 1.25rem; }
.swds-map-tally { margin: 0 !important; color: rgba(255, 255, 255, 0.7) !important; font-size: 0.875rem; }
.swds-map-tally strong { color: var(--m-accent); font-family: var(--wp--preset--font-family--display, inherit); font-size: 1.125rem; font-weight: 500; }
.swds-map-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swds-map-chips button,
.swds-map-reset {
	padding: 0.55em 1.1em;
	border: 1px solid var(--m-line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--m-ease);
}
.swds-map-chips button:hover { border-color: rgba(202, 138, 4, 0.6); transform: translateY(-1px); }
.swds-map-chips button.is-active { background: var(--m-accent); border-color: var(--m-accent); color: var(--m-black); }
.swds-map-search { flex: 1 1 15rem; display: block; margin-left: auto; max-width: 22rem; }
.swds-map-search input {
	box-sizing: border-box;
	width: 100%;
	padding: 0.8rem 1rem 0.8rem 2.6rem;
	border: 1px solid var(--m-line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CA8A04' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 1rem center / 16px no-repeat;
	color: #fff;
	font: inherit;
	font-size: 0.9375rem;
}
.swds-map-search input::placeholder { color: rgba(255, 255, 255, 0.5); }
.swds-map-search input:focus { border-color: var(--m-accent); outline: none; box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.2); }

/* Map + list layout. */
.swds-map-body { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1rem; }
.swds-map-canvas {
	position: relative;
	height: clamp(460px, 72vh, 720px);
	overflow: hidden;
	border: 1px solid var(--m-line);
	border-radius: 24px;
	background: #1a1b19;
	outline: none;
}
.swds-map-canvas:focus-visible { box-shadow: 0 0 0 3px var(--m-accent); }
.swds-map-hint {
	position: absolute;
	top: 1rem;
	left: 50%;
	z-index: 500;
	margin: 0 !important;
	padding: 0.45em 1em;
	border-radius: 999px;
	background: rgba(23, 23, 23, 0.75);
	color: #fff !important;
	font-size: 0.75rem;
	pointer-events: none;
	transform: translateX(-50%);
	transition: opacity .3s;
}
.swds-map-app.is-awake .swds-map-hint { opacity: 0; }
/* Before the 3D map loads: one clear button in the middle of the empty map. */
.swds-map-start {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 500;
	padding: 0.85em 1.6em;
	border: 0;
	border-radius: 999px;
	background: var(--m-accent);
	color: var(--m-black);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transform: translate(-50%, -50%);
}
.swds-map-start:disabled { opacity: 0.85; cursor: progress; }
.swds-map-start:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.swds-map-app.is-idle .swds-map-hint { display: none; }
/* Tools over the map: reset, tour, 2D/3D. */
.swds-map-tools { position: absolute; top: 1rem; left: 1rem; z-index: 500; display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: calc(100% - 2rem); }
.swds-map-tools button {
	padding: 0.55em 1.1em;
	border: 1px solid var(--m-line);
	border-radius: 999px;
	background: rgba(23, 23, 23, 0.8);
	backdrop-filter: blur(6px);
	color: #fff;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--m-ease);
}
.swds-map-tools button:hover { background: var(--m-accent); border-color: var(--m-accent); color: var(--m-black); transform: translateY(-1px); }
.swds-map-tour { padding-left: 2.1em !important; position: relative; }
.swds-map-tour::before { content: ""; position: absolute; top: 50%; left: 0.95em; width: 0; height: 0; border-left: 7px solid var(--m-accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transform: translateY(-50%); transition: border-color .25s; }
.swds-map-tour:hover::before { border-left-color: var(--m-black); }
.swds-map-app.is-touring .swds-map-tour { background: var(--m-accent); color: var(--m-black); border-color: var(--m-accent); }
.swds-map-app.is-touring .swds-map-tour::before { width: 8px; height: 8px; border: 0; background: var(--m-black); }
.swds-map-app:not(.is-3d) .is-3d-only { display: none; }
.swds-map-app.is-3d .swds-map-hint { left: auto; right: 1rem; transform: none; }
.swds-map-app.is-3d .swds-map-canvas { background: #0c0d0b; }

.swds-map-list {
	height: clamp(460px, 72vh, 720px);
	margin: 0 !important;
	padding: 0.5rem;
	overflow-y: auto;
	border: 1px solid var(--m-line);
	border-radius: 24px;
	background: rgba(255, 255, 255, 0.03);
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.swds-map-list:empty::before { content: attr(data-empty); display: block; padding: 1.5rem; color: rgba(255, 255, 255, 0.6); font-size: 0.875rem; }
.swds-map-list li { margin: 0; }
.swds-map-list button,
.swds-map-list a {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 0.85rem;
	align-items: center;
	width: 100%;
	padding: 0.6rem;
	border: 0;
	border-radius: 16px;
	background: none;
	color: #fff;
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .25s, transform .3s var(--m-ease);
}
.swds-map-list button:hover,
.swds-map-list a:hover { background: rgba(255, 255, 255, 0.06); transform: translateX(4px); }
.swds-map-list li.is-active button { background: rgba(202, 138, 4, 0.14); box-shadow: inset 3px 0 0 var(--m-accent); }
.swds-map-list img,
.swds-map-list__ph { width: 64px; height: 50px; border-radius: 10px; object-fit: cover; background: #2a2b28; }
.swds-map-list__text { min-width: 0; }
.swds-map-list__text strong { display: block; overflow: hidden; font-size: 0.9375rem; text-overflow: ellipsis; white-space: nowrap; }
.swds-map-list__text span { display: block; overflow: hidden; color: rgba(255, 255, 255, 0.6); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }

/* Default OpenStreetMap tiles, turned into a dark charcoal map that suits the theme. */
.swds-map-app.is-darkened .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.92) saturate(0.25); }

/* Pins: yellow dot with a pulse ring; approximate (city-centre) pins are hollow. */
.swds-pin { background: none; border: 0; }
.swds-pin__dot {
	position: absolute;
	inset: 8px;
	border: 3px solid var(--m-black);
	border-radius: 50%;
	background: var(--m-accent);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: translateY(-26px) scale(.6);
	transition: transform .7s cubic-bezier(.3, 1.6, .5, 1) calc(var(--i, 0) * 70ms), opacity .4s ease calc(var(--i, 0) * 70ms);
}
.swds-pin__dot::after {
	content: "";
	position: absolute;
	inset: -9px;
	border: 2px solid var(--m-accent);
	border-radius: 50%;
	opacity: 0;
}
.swds-map-app.is-live .swds-pin__dot { opacity: 1; transform: none; }
.swds-map-app.is-live .swds-pin__dot::after { animation: swds-pin-pulse 2.6s calc(var(--i, 0) * 70ms + .8s) infinite; }
.swds-pin.is-approx .swds-pin__dot { background: var(--m-black); border-color: var(--m-accent); }
.leaflet-marker-icon.swds-pin:hover .swds-pin__dot { transform: scale(1.2); }
@keyframes swds-pin-pulse { 0% { opacity: .8; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(1.6); } }

/* Clusters. */
.swds-cluster { display: grid; place-items: center; border-radius: 50%; background: rgba(202, 138, 4, 0.28); }
.swds-cluster span {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 2px solid var(--m-accent);
	border-radius: 50%;
	background: var(--m-black);
	color: var(--m-accent);
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: 0.875rem;
	font-weight: 500;
	transition: transform .3s var(--m-ease);
}
.swds-cluster:hover span { transform: scale(1.12); }

/* Popup card. */
.swds-popup .leaflet-popup-content-wrapper { overflow: hidden; padding: 0; border-radius: 20px; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.6); }
.swds-popup .leaflet-popup-content { width: 280px !important; margin: 0; }
.swds-popup .leaflet-popup-tip { box-shadow: none; }
.swds-popup a.leaflet-popup-close-button { top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(23, 23, 23, 0.7); color: #fff; font: 18px/26px sans-serif; }
.swds-pop__img { aspect-ratio: 16 / 10; overflow: hidden; background: #ddd; }
.swds-pop__img img { display: block; width: 100%; height: 100%; object-fit: cover; animation: swds-pop-in .7s var(--m-ease) both; }
.swds-pop__body { padding: 1rem 1.15rem 1.15rem; color: var(--m-black); }
.swds-pop__body p { margin: 0 !important; }
.swds-pop__type { color: var(--swds-accent-ink) !important; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.swds-pop__title { margin: 0.25rem 0 0.2rem !important; font-family: var(--wp--preset--font-family--display, inherit); font-size: 1.125rem; font-weight: 500; line-height: 1.2; }
.swds-pop__place { color: #6b6d69 !important; font-size: 0.8125rem; }
.swds-pop__note { margin-top: 0.5rem !important; padding-top: 0.5rem; border-top: 1px solid rgba(23, 23, 23, 0.08); color: #6b6d69 !important; font-size: 0.75rem; }
@keyframes swds-pop-in { from { transform: scale(1.12); } }
.swds-pop__link { display: inline-block; margin-top: 0.75rem; color: var(--m-black); font-size: 0.8125rem; font-weight: 700; text-decoration: underline; text-decoration-color: var(--m-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Leaflet chrome in the SWDS look. */
.swds-map-canvas .leaflet-control-zoom { border: 0; box-shadow: none; margin: 0 1rem 1.5rem 0; }
.swds-map-canvas .leaflet-control-zoom a {
	width: 38px;
	height: 38px;
	margin-top: 6px;
	border: 1px solid var(--m-line);
	border-radius: 50% !important;
	background: rgba(23, 23, 23, 0.85);
	color: #fff;
	line-height: 36px;
}
.swds-map-canvas .leaflet-control-zoom a:hover { background: var(--m-accent); color: var(--m-black); }
.swds-map-canvas .leaflet-control-attribution { background: rgba(23, 23, 23, 0.7); color: rgba(255, 255, 255, 0.6); font-size: 10px; }
.swds-map-canvas .leaflet-control-attribution a { color: rgba(255, 255, 255, 0.85); }
.swds-map-empty { color: rgba(255, 255, 255, 0.7); }

/* ---------- 3D map (MapLibre) ---------- */
.swds-map-canvas .maplibregl-canvas { outline: none; }
.swds-popup3d .maplibregl-popup-content { overflow: hidden; padding: 0; border-radius: 20px; background: #fff; box-shadow: 0 28px 60px -20px rgba(0, 0, 0, 0.7); }
.swds-popup3d .maplibregl-popup-tip { border-top-color: #fff !important; border-bottom-color: #fff !important; }
.swds-popup3d .maplibregl-popup-close-button { top: 10px; right: 10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; background: rgba(23, 23, 23, 0.72); color: #fff; font-size: 18px; line-height: 26px; }
.swds-popup3d .maplibregl-popup-close-button:hover { background: var(--m-accent); color: var(--m-black); }
.swds-popup3d .swds-pop { width: 280px; animation: swds-pop-rise .45s var(--m-ease) both; }
@keyframes swds-pop-rise { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.swds-pop__back { margin: 0 0 0.6rem; padding: 0; border: 0; background: none; color: var(--swds-accent-ink); font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.swds-pop__back:hover { text-decoration: underline; }
.swds-pop--list ul { max-height: 230px; margin: 0.75rem -0.4rem 0; padding: 0; overflow-y: auto; list-style: none; }
.swds-pop--list li button { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 0.7rem; align-items: center; width: 100%; padding: 0.4rem; border: 0; border-radius: 12px; background: none; font: inherit; text-align: left; cursor: pointer; transition: background-color .2s; }
.swds-pop--list li button:hover { background: #f4f6f0; }
.swds-pop--list img { width: 48px; height: 38px; border-radius: 8px; object-fit: cover; }
.swds-pop--list strong { display: block; overflow: hidden; color: var(--m-black); font-size: 0.875rem; text-overflow: ellipsis; white-space: nowrap; }
.swds-pop--list li span span { display: block; color: #6b6d69; font-size: 0.75rem; }
.swds-map-canvas .maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--m-line); border-radius: 18px; background: rgba(23, 23, 23, 0.85); box-shadow: none; }
.swds-map-canvas .maplibregl-ctrl-group button { width: 38px; height: 38px; }
.swds-map-canvas .maplibregl-ctrl-group button + button { border-top: 1px solid var(--m-line); }
.swds-map-canvas .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.swds-map-canvas .maplibregl-ctrl-group button:hover { background: var(--m-accent); }
.swds-map-canvas .maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon { filter: none; }
.swds-map-canvas .maplibregl-ctrl-bottom-right { margin: 0 0.75rem 1.5rem 0; }
.swds-map-canvas .maplibregl-ctrl-attrib { background: rgba(23, 23, 23, 0.7) !important; color: rgba(255, 255, 255, 0.65); }
.swds-map-canvas .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.85); }
.swds-map-canvas .maplibregl-ctrl-attrib-button { filter: invert(1); }
.swds-map-canvas .maplibregl-cooperative-gesture-screen { z-index: 600; background: rgba(23, 23, 23, 0.6); color: #fff; font-size: 1rem; }

@media (max-width: 900px) {
	.swds-map-body { grid-template-columns: 1fr; }
	.swds-map-canvas { height: 62vh; min-height: 380px; }
	.swds-map-list { height: auto; max-height: 26rem; }
	.swds-map-search { margin-left: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
	.swds-pin__dot,
	.swds-pin__dot::after,
	.swds-pop__img img { animation: none !important; transition: none !important; }
}

/* Touch: comfortable tap targets. */
@media (pointer: coarse) {
	.swds-map-chips button,
	.swds-map-tools button { min-height: 44px; }
	.swds-map-canvas .maplibregl-ctrl-group button,
	.swds-map-canvas .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 42px; }
	.swds-popup a.leaflet-popup-close-button,
	.swds-popup3d .maplibregl-popup-close-button { width: 36px; height: 36px; line-height: 34px; }
}
