/* Atlas
   One instrument: search bar, results, and map share a single hairline-bordered
   surface. One accent, spent on pins, the primary action, and rank chips. */

.atlas {
	--atlas-accent: #4A1D20;
	--atlas-pin: var(--atlas-accent);
	--atlas-btn: var(--atlas-accent);
	--atlas-link: var(--atlas-accent);
	--atlas-ink: #191a1c;
	--atlas-muted: #74767c;
	--atlas-faint: #a3a5ab;
	--atlas-line: #e7e5e1;
	--atlas-surface: #ffffff;
	--atlas-canvas: #f7f6f4;
	--atlas-h: 620px;

	color: var(--atlas-ink);
	font-size: 15px;
	line-height: 1.45;
	border: 1px solid var(--atlas-line);
	border-radius: 14px;
	background: var(--atlas-surface);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(20, 18, 16, 0.04);
}

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

.atlas .atlas-i {
	width: 16px;
	height: 16px;
	flex: none;
	display: block;
}

/* ------------------------------------------------------------------ *
 * Command bar
 * ------------------------------------------------------------------ */

.atlas-bar {
	display: flex;
	gap: 10px;
	padding: 14px;
	border-bottom: 1px solid var(--atlas-line);
	background: var(--atlas-surface);
}

.atlas-field {
	flex: 1 1 220px;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding: 0 14px;
	height: 44px;
	border: 1px solid var(--atlas-line);
	border-radius: 10px;
	background: var(--atlas-canvas);
	color: var(--atlas-faint);
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	cursor: text;
}

.atlas-field:focus-within {
	background: var(--atlas-surface);
	border-color: var(--atlas-btn);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-btn) 12%, transparent);
	color: var(--atlas-btn);
}

.atlas-zip {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: var(--atlas-ink);
	padding: 0;
	height: 100%;
	box-shadow: none;
}

.atlas-zip::placeholder { color: var(--atlas-faint); }

.atlas-radius-wrap {
	position: relative;
	display: flex;
	align-items: center;
	height: 44px;
	border: 1px solid var(--atlas-line);
	border-radius: 10px;
	background: var(--atlas-surface);
	color: var(--atlas-muted);
}

.atlas-radius {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 14px;
	color: var(--atlas-ink);
	height: 100%;
	padding: 0 34px 0 14px;
	cursor: pointer;
	box-shadow: none;
}

.atlas-radius-wrap .atlas-i {
	position: absolute;
	right: 12px;
	width: 14px;
	height: 14px;
	pointer-events: none;
}

.atlas-radius:focus-visible { outline: none; }
.atlas-radius-wrap:focus-within {
	border-color: var(--atlas-btn);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-btn) 12%, transparent);
}

.atlas-search-btn {
	height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 10px;
	background: var(--atlas-btn);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.atlas-search-btn:hover { filter: brightness(1.12); }
.atlas-search-btn:active { transform: translateY(1px); }

.atlas-geo-btn {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 1px solid var(--atlas-line);
	border-radius: 10px;
	background: var(--atlas-surface);
	color: var(--atlas-muted);
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.atlas-geo-btn:hover { color: var(--atlas-btn); border-color: var(--atlas-btn); }
.atlas-geo-btn .atlas-i { width: 18px; height: 18px; }

.atlas-search-btn:focus-visible,
.atlas-geo-btn:focus-visible,
.atlas-clear:focus-visible,
.atlas-card-item:focus-visible {
	outline: 2px solid var(--atlas-btn);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Body: panel + map
 * ------------------------------------------------------------------ */

.atlas-body {
	display: grid;
	grid-template-columns: 372px 1fr;
	height: var(--atlas-h);
}

.atlas-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 1px solid var(--atlas-line);
	background: var(--atlas-surface);
}

.atlas-panel-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 18px;
	border-bottom: 1px solid var(--atlas-line);
	min-height: 43px;
}

.atlas-count {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--atlas-muted);
	font-variant-numeric: tabular-nums;
}

.atlas-clear {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: 13px;
	color: var(--atlas-muted);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--atlas-line);
	transition: color 0.15s ease;
}

.atlas-clear:hover { color: var(--atlas-link); text-decoration-color: currentColor; }

.atlas-results {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--atlas-line) transparent;
}

/* ------------------------------------------------------------------ *
 * Cards
 * ------------------------------------------------------------------ */

.atlas-card-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--atlas-line);
	cursor: pointer;
	transition: background-color 0.15s ease;
	animation: atlas-rise 0.35s ease backwards;
}

.atlas-card-item:hover,
.atlas-card-item.is-active { background: var(--atlas-canvas); }

.atlas-card-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.atlas-rank {
	flex: none;
	width: 26px;
	height: 26px;
	margin-top: 1px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--atlas-pin);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.atlas-card-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
}

.atlas-card-name {
	font-size: 15.5px;
	font-weight: 650;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.atlas-card-distance {
	flex: none;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--atlas-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.atlas-card-address {
	color: var(--atlas-muted);
	font-size: 13.5px;
	line-height: 1.45;
}

.atlas-card-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin-top: 7px;
}

.atlas-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 550;
	color: var(--atlas-ink);
	text-decoration: none;
	transition: color 0.15s ease;
}

.atlas-link .atlas-i { width: 13px; height: 13px; color: var(--atlas-faint); transition: color 0.15s ease; }
.atlas-link:hover { color: var(--atlas-link); text-decoration: none; }
.atlas-link:hover .atlas-i { color: var(--atlas-link); }

@keyframes atlas-rise {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* Skeletons */
.atlas-skel {
	padding: 18px;
	border-bottom: 1px solid var(--atlas-line);
}
.atlas-skel span {
	display: block;
	height: 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--atlas-canvas) 25%, #efedea 50%, var(--atlas-canvas) 75%);
	background-size: 200% 100%;
	animation: atlas-shimmer 1.4s linear infinite;
	margin-bottom: 9px;
}
.atlas-skel span:nth-child(1) { width: 55%; height: 14px; }
.atlas-skel span:nth-child(2) { width: 80%; }
.atlas-skel span:nth-child(3) { width: 40%; margin-bottom: 0; }

@keyframes atlas-shimmer {
	from { background-position: 200% 0; }
	to   { background-position: -200% 0; }
}

/* Empty state */
.atlas-empty {
	padding: 56px 28px;
	text-align: center;
	color: var(--atlas-muted);
}
.atlas-empty .atlas-i {
	width: 26px;
	height: 26px;
	margin: 0 auto 14px;
	color: var(--atlas-faint);
}
.atlas-empty strong {
	display: block;
	color: var(--atlas-ink);
	font-size: 15px;
	font-weight: 650;
	margin-bottom: 4px;
}
.atlas-empty p { margin: 0 0 16px; font-size: 13.5px; }
.atlas-empty button {
	border: 1px solid var(--atlas-line);
	background: var(--atlas-surface);
	border-radius: 8px;
	padding: 8px 16px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--atlas-ink);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.atlas-empty button:hover { border-color: var(--atlas-btn); color: var(--atlas-btn); }

/* ------------------------------------------------------------------ *
 * Map
 * ------------------------------------------------------------------ */

.atlas-map {
	min-height: 0;
	background: var(--atlas-canvas);
	z-index: 0;
}

/* Pins: SVG drop with a punched hole; ranked pins carry their number */
.atlas-pin { background: none; border: 0; }

.atlas-pin svg {
	display: block;
	filter: drop-shadow(0 2px 3px rgba(20, 18, 16, 0.3));
	transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
	transform-origin: 50% 100%;
}

.atlas-pin.is-active svg,
.atlas-pin:hover svg { transform: scale(1.22); }

/* Clusters */
.atlas-cluster {
	background: var(--atlas-accent);
	border: 2.5px solid #fff;
	border-radius: 50%;
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 2px 6px rgba(20, 18, 16, 0.28);
	transition: transform 0.15s ease;
}
.atlas-cluster:hover { transform: scale(1.08); }


/* ------------------------------------------------------------------ *
 * Responsive + reduced motion
 * ------------------------------------------------------------------ */

@media (max-width: 860px) {
	.atlas-body {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(280px, 42%) 1fr;
		height: min(var(--atlas-h), 78vh);
	}
	.atlas-panel { order: 2; border-right: 0; border-top: 1px solid var(--atlas-line); }
	.atlas-map { order: 1; }
	.atlas-bar { flex-wrap: wrap; }
	.atlas-field { flex-basis: 100%; }
	.atlas-radius-wrap { flex: 0 1 auto; min-width: 118px; }
	.atlas-radius { width: 100%; padding-right: 30px; }
	.atlas-search-btn { flex: 1 1 0; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.atlas *, .atlas *::before, .atlas *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* MapLibre popup */
.atlas-popup .maplibregl-popup-content {
	border-radius: 14px;
	box-shadow: 0 8px 28px rgba(20, 18, 16, 0.16);
	padding: 18px 20px 16px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.55;
	color: var(--atlas-ink, #191a1c);
	min-width: 220px;
}

.atlas-popup .maplibregl-popup-content strong {
	display: block;
	font-size: 15.5px;
	font-weight: 650;
	letter-spacing: -0.01em;
	margin: 0 22px 3px 0;
}

.atlas-popup .atlas-pop-addr { color: #74767c; display: block; margin-bottom: 12px; }

.atlas-popup .maplibregl-popup-content a {
	color: var(--atlas-link, #4A1D20);
	font-weight: 600;
	text-decoration: none;
	margin-right: 18px;
}

.atlas-popup .maplibregl-popup-content a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* MapLibre controls */
.atlas .maplibregl-ctrl-group {
	border-radius: 10px;
	box-shadow: 0 1px 4px rgba(20, 18, 16, 0.1);
	border: 1px solid var(--atlas-line);
	overflow: hidden;
}

.atlas .maplibregl-ctrl-group button { width: 32px; height: 32px; }
.atlas .maplibregl-ctrl-attrib { font-size: 10.5px; }

/* ------------------------------------------------------------------ *
 * Theme hardening: WordPress themes love to restyle buttons, inputs,
 * and svgs. Pin every property the controls depend on.
 * ------------------------------------------------------------------ */

.atlas button,
.atlas input,
.atlas select {
	font-family: inherit;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	text-shadow: none;
	vertical-align: middle;
}

.atlas button.atlas-search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	height: 44px;
	min-height: 44px;
	white-space: nowrap;
	text-decoration: none;
	border: 0;
	background: var(--atlas-btn);
	background-image: none;
	color: #fff;
	border-radius: 10px;
	padding: 0 22px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0.01em;
	box-shadow: none;
}

.atlas button.atlas-search-btn:hover {
	background: var(--atlas-btn);
	color: #fff;
	filter: brightness(1.12);
}

.atlas button.atlas-geo-btn {
	line-height: 1;
	padding: 0;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	background: var(--atlas-surface);
	background-image: none;
	color: var(--atlas-muted);
	border: 1px solid var(--atlas-line);
	border-radius: 10px;
	box-shadow: none;
}

/* The clear-search text button and empty-state button */
.atlas button.atlas-clear {
	display: inline;
	background: none;
	background-image: none;
	border: 0;
	box-shadow: none;
	padding: 0;
	min-width: 0;
	min-height: 0;
	height: auto;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
	color: var(--atlas-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--atlas-line);
	border-radius: 0;
	line-height: inherit;
}

.atlas button.atlas-clear:hover {
	background: none;
	color: var(--atlas-link);
	text-decoration-color: currentColor;
}

.atlas .atlas-empty button {
	background: var(--atlas-surface);
	background-image: none;
	border: 1px solid var(--atlas-line);
	border-radius: 8px;
	box-shadow: none;
	padding: 8px 16px;
	min-height: 0;
	height: auto;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
	color: var(--atlas-ink);
}

/* MapLibre zoom controls: strip theme button styling entirely */
.atlas .maplibregl-ctrl-group button,
.atlas .maplibregl-ctrl-group button:hover,
.atlas .maplibregl-ctrl-group button:focus {
	background-color: #fff;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
	width: 32px;
	height: 32px;
	min-width: 0;
	min-height: 0;
	color: #191a1c;
	text-transform: none;
	line-height: 1;
}

.atlas .maplibregl-ctrl-group button + button {
	border-top: 1px solid var(--atlas-line);
}

.atlas .maplibregl-ctrl-group button:hover {
	background-color: #f7f6f4;
}

.atlas button.atlas-geo-btn:hover {
	background: var(--atlas-surface);
	color: var(--atlas-btn);
	border-color: var(--atlas-btn);
}

/* Kill the theme's inner focus ring on the zip input; the wrapper
   (.atlas-field:focus-within) carries the focus treatment. */
.atlas input.atlas-zip,
.atlas input.atlas-zip:focus,
.atlas input.atlas-zip:focus-visible,
.atlas input.atlas-zip:active {
	outline: none;
	border: 0;
	box-shadow: none;
	background: transparent;
}

/* Popup close button: themes paint <button> backgrounds; strip everything
   and center the glyph. */
.atlas-popup button.maplibregl-popup-close-button {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	background-image: none;
	border: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
	min-width: 0;
	min-height: 0;
	width: 28px;
	height: 28px;
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	line-height: 1;
	font-size: 20px;
	font-weight: 400;
	color: #a3a5ab;
	border-radius: 8px;
	cursor: pointer;
}

.atlas-popup button.maplibregl-popup-close-button:hover {
	background: #f4f2ef;
	color: #191a1c;
}

.atlas .atlas-i,
.atlas svg.atlas-i {
	width: 16px;
	height: 16px;
	max-width: none;
	min-width: 0;
	flex: none;
	fill: none;
}

.atlas .atlas-geo-btn .atlas-i { width: 18px; height: 18px; }
.atlas .atlas-link .atlas-i { width: 13px; height: 13px; }

.atlas .atlas-zip {
	min-height: 0;
	line-height: normal;
}

/* Custom image pins */
.atlas-pin-custom { position: relative; }

.atlas-pin-img {
	display: block;
	height: 38px;
	width: auto;
	filter: drop-shadow(0 2px 3px rgba(20, 18, 16, 0.3));
	transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
	transform-origin: 50% 100%;
}

.atlas-pin-custom.is-active .atlas-pin-img,
.atlas-pin-custom:hover .atlas-pin-img { transform: scale(1.18); }

.atlas-pin-badge {
	position: absolute;
	top: -6px;
	right: -10px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	border: 2px solid #fff;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: grid;
	place-items: center;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 1px 3px rgba(20, 18, 16, 0.3);
}

/* Dot pins scale from center */
.atlas-pin-dot svg { transform-origin: 50% 50%; }
