/**
 * Shared Google-style map chrome (Layers BL + dark stack BR).
 * Used by hub explorer and auto-attached site-wide maps.
 *
 * @package The_Duchy
 */

.duchy-map-chrome-host {
	position: relative;
	/* Trap Layers / stack z-indexes so they cannot paint over the fixed filter dock. */
	isolation: isolate;
}

.duchy-map-chrome-host .leaflet-control-zoom,
.leaflet-container.duchy-map-chrome-host .leaflet-control-zoom {
	display: none !important;
}

/* LAYERS tile — Google Maps style, bottom-left base-layer toggle. */
.hub-explorer-layers-btn,
.duchy-map-chrome-layers {
	position: absolute;
	left: 12px;
	right: auto;
	bottom: 28px;
	z-index: 40;
	width: 72px;
	height: 72px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	background: #cdd8e2 center / cover no-repeat;
	background-image: url('https://a.basemaps.cartocdn.com/rastertiles/voyager/11/995/691.png');
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.hub-explorer-layers-btn.is-satellite,
.duchy-map-chrome-layers.is-satellite {
	background-color: #2d4a2e;
	background-image: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/11/691/995');
}

.hub-explorer-layers-btn__cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	background: rgba(32, 33, 36, 0.82);
	color: #fff;
	font: 700 10px/1.2 'Roboto', 'Inter', system-ui, sans-serif;
	letter-spacing: 0.01em;
	padding: 4px 2px;
	text-align: center;
}

.hub-explorer-layers-btn__ico {
	flex: 0 0 auto;
	display: block;
}

.hub-explorer-layers-btn:hover,
.duchy-map-chrome-layers:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hub-explorer-layers-btn:focus-visible,
.duchy-map-chrome-layers:focus-visible {
	outline: 3px solid #4285f4;
	outline-offset: 2px;
}

/* Google Maps-style dark control stack — bottom-right. */
.hub-explorer-gmaps-stack,
.duchy-map-chrome-stack {
	position: absolute;
	right: 12px;
	bottom: 28px;
	z-index: 40;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 6px;
	background: #202124;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.hub-explorer-gmaps-stack__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: background 0.12s ease;
}

.hub-explorer-gmaps-stack__btn:hover {
	background: rgba(255, 255, 255, 0.12);
}

.hub-explorer-gmaps-stack__btn:active {
	background: rgba(255, 255, 255, 0.2);
}

.hub-explorer-gmaps-stack__btn:focus-visible {
	outline: 2px solid #8ab4f8;
	outline-offset: 1px;
}

.hub-explorer-gmaps-stack__btn.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.hub-explorer-gmaps-stack__btn svg {
	display: block;
}

@media (max-width: 768px) {
	.hub-explorer-layers-btn,
	.duchy-map-chrome-layers {
		width: 48px;
		height: 48px;
		left: 10px;
		bottom: 16px;
	}

	.hub-explorer-layers-btn__cap {
		font-size: clamp(6px, 1.8vw, 8px);
		letter-spacing: 0;
		line-height: 1;
		padding: 2px 0;
		gap: 0;
		white-space: nowrap;
	}

	.hub-explorer-layers-btn__ico {
		display: none;
	}

	.hub-explorer-gmaps-stack,
	.duchy-map-chrome-stack {
		right: 10px;
		bottom: 16px;
		padding: 4px;
	}

	.hub-explorer-gmaps-stack__btn {
		width: 34px;
		height: 34px;
	}

	.hub-explorer-gmaps-stack__btn svg {
		width: 18px;
		height: 18px;
	}
}

/* Village map: keep chrome clear of parish hint / caption */
.map-stage--village .hub-explorer-layers-btn,
.map-stage--village .duchy-map-chrome-layers,
.map-stage--village .hub-explorer-gmaps-stack,
.map-stage--village .duchy-map-chrome-stack {
	bottom: 52px;
}

/* Parish-only caption sits above Layers (bottom-left) */
.map-stage--village.duchy-map-chrome-host .map-hint,
.map-stage--village-bleed.duchy-map-chrome-host .map-hint {
	bottom: 132px;
	left: 12px;
	z-index: 40;
}
