/**
 * Map control overrides — Mapbox GL JS via HivePress Geolocation.
 *
 * WHY THIS FILE EXISTS
 * mapbox-gl.css loads at document position 1; theme.css at 29. The
 * vendor rule `.mapboxgl-ctrl-group button` and the theme rule
 * `.gm-theme button` are both specificity (0,1,1) — an exact tie,
 * broken by source order in the theme's favour. Result: control
 * buttons inherit background #2d7a4f (icons go dark-on-dark) and
 * display:inline-flex (buttons flow horizontally instead of stacking).
 *
 * Every selector here is scoped to (0,2,1) so it wins on specificity,
 * not source order. Do not "simplify" these selectors — the extra
 * class is load-bearing and survives enqueue reordering.
 *
 * SCOPE: Stage 1 only. Compass icon and green masked glyphs deferred.
 * DO NOT add .mapboxgl-* rules to theme.css. This file owns them.
 */

:root {
	--gm-map-ctrl-size: 40px;
	--gm-map-ctrl-icon: 20px;
	--gm-map-ctrl-bg: #fff;
	--gm-map-ctrl-bg-hover: #f4f6f3;
	--gm-map-ctrl-fg: var(--gm-green);
	--gm-map-ctrl-divider: rgba(0, 0, 0, .08);
}

@media (max-width: 782px) {
	:root {
		--gm-map-ctrl-size: 44px;
	}
}

/* Group is the white card; buttons are transparent segments of it. */
.gm-theme .mapboxgl-ctrl-group {
	background: var(--gm-map-ctrl-bg);
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
	overflow: hidden;
}

/* Undo .gm-theme button; restore vendor geometry. */
.gm-theme .mapboxgl-ctrl-group button {
	display: block;
	width: var(--gm-map-ctrl-size);
	height: var(--gm-map-ctrl-size);
	min-height: 0;
	padding: 0;
	background-color: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	/* !important matches the theme's own !important on this property. */
	color: var(--gm-map-ctrl-fg) !important;
}

.gm-theme .mapboxgl-ctrl-group button + button {
	border-top: 1px solid var(--gm-map-ctrl-divider);
}

.gm-theme .mapboxgl-ctrl-group button:hover {
	background-color: var(--gm-map-ctrl-bg-hover);
}

/* Inset ring — the group clips with overflow:hidden. */
.gm-theme .mapboxgl-ctrl-group button:focus-visible {
	outline: 2px solid var(--gm-map-ctrl-fg);
	outline-offset: -2px;
}

.gm-theme .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
	width: 100%;
	height: 100%;
	background-size: var(--gm-map-ctrl-icon) var(--gm-map-ctrl-icon);
	background-position: 50%;
	background-repeat: no-repeat;
}

/* Attribution toggle sits outside .mapboxgl-ctrl-group — needs its own
   rule. Never hide it: Mapbox ToS requires visible attribution. */
.gm-theme .mapboxgl-ctrl-attrib button.mapboxgl-ctrl-attrib-button {
	display: block;
	width: 24px;
	height: 24px;
	min-height: 0;
	padding: 0;
	background-color: transparent;
	border-radius: 50%;
	box-shadow: none;
}
