/* LocationMapper — frontend styles (scoped to .lawmed-map-component) */
.lawmed-map-component {
	position: relative;
	z-index: 0;
	--c-primary: #009E91;
	--c-primary-dk: #007d73;
	--c-primary-lt: #e6f6f5;
	--c-accent: #E05B2B;
	--c-accent-dk: #b84820;
	--c-bg: #f4f6f5;
	--c-surface: #ffffff;
	--c-text: #1c2422;
	--c-muted: #6b7775;
	--c-border: #dde5e3;
	--panel-w: 340px;
	--shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
	--shadow-md: 0 4px 20px rgba(0,0,0,0.10);
	--shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
	--transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);

	width: 100%;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--shadow-lg);
	display: flex;
	flex-direction: column;
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif;
	color: var(--c-text);
	margin: 0 auto;
}

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

@media (max-width: 640px) {
	.lawmed-map-component {
		border-radius: 0;
		border: none;
		box-shadow: none;
	}
}

.lawmed-map-component .map-header {
	background: var(--c-primary);
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
	z-index: 1000;
}
.lawmed-map-component .map-header h1 { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 0.01em; margin: 0; }
.lawmed-map-component .map-header p { font-size: 12px; color: rgba(255,255,255,0.75); margin: 6px 0 0; line-height: 12px; }
.lawmed-map-component .header-badge {
	display: inline-flex; align-items: center;
	background: rgba(255,255,255,0.15); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
	padding: 5px 10px; border-radius: 20px; letter-spacing: 0.02em; white-space: nowrap;
	flex-shrink: 0; flex-grow: 0; width: auto; height: auto;
	border: 1px solid rgba(255,255,255,0.25);
}

.lawmed-map-component .map-wrapper { position: relative; flex: 1; overflow: hidden; display: flex; min-height: 0; }
.lawmed-map-component .lm-map { flex: 1; z-index: 1; width: 100%; height: 100%; }
.lawmed-map-component .mapboxgl-ctrl-attrib, .lawmed-map-component .leaflet-control-attribution { font-size: 10px !important; opacity: 0.6; }

/* pins rendered as DOM markers for leaflet */
.lm-pin { cursor: pointer; transition: transform var(--transition); transform-origin: center bottom; }
.lm-pin:hover { transform: scale(1.08); }

.lawmed-map-component .location-panel {
	position: absolute; top: 0; right: 0; height: 100%; width: var(--panel-w);
	background: var(--c-surface); box-shadow: var(--shadow-lg); z-index: 500;
	display: flex; flex-direction: column; transform: translateX(100%);
	transition: transform var(--transition); border-left: 1px solid var(--c-border);
}
.lawmed-map-component .location-panel.open { transform: translateX(0); }

@media (max-width: 640px) {
	.lawmed-map-component .location-panel {
		top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto;
		max-height: 68dvh; border-left: none; border-top: 1px solid var(--c-border);
		border-radius: 18px 18px 0 0; transform: translateY(100%);
		box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
		overflow: hidden; /* clip the coloured panel head to the rounded corners */
	}
	.lawmed-map-component .location-panel.open { transform: translateY(0); }
}

.lawmed-map-component .panel-head {
	padding: 16px 18px 14px; background: var(--c-primary);
	display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.lawmed-map-component .panel-location-name { font-size: 17px; font-weight: 800; color: #fff; line-height: 1.2; margin: 0; }
.lawmed-map-component .panel-location-city {
	font-size: 12px; line-height: 1.4; color: rgba(255,255,255,0.72); margin: 4px 0 0;
	display: flex; align-items: flex-start; gap: 5px;
}
.lawmed-map-component .panel-location-city svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 2px; }
.lawmed-map-component .panel-location-city span { font-size: 12px; line-height: 1.4; }
.lawmed-map-component .panel-close {
	-webkit-appearance: none; appearance: none;
	background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
	width: 30px; height: 30px; min-width: 30px; min-height: 30px; max-width: 30px; max-height: 30px;
	padding: 0; margin: 0; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer; color: #fff; flex-shrink: 0; flex-grow: 0; transition: background 0.2s;
	font-size: 0; line-height: 0; box-shadow: none;
}
.lawmed-map-component .panel-close:hover { background: rgba(255,255,255,0.28); }
.lawmed-map-component .panel-close svg { width: 16px; height: 16px; display: block; }

.lawmed-map-component .panel-body {
	flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--c-bg);
}
.lawmed-map-component .panel-section-label { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-primary); margin-bottom: 2px; }
.lawmed-map-component .staff-card {
	background: var(--c-surface); border-radius: 10px; padding: 12px 14px;
	display: flex; align-items: center; gap: 12px; border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.lawmed-map-component .staff-photo {
	width: 48px; height: 48px; border-radius: 50%; background: var(--c-primary); flex-shrink: 0;
	overflow: hidden; display: flex; align-items: center; justify-content: center;
	border: 2px solid var(--c-primary-lt); font-weight: 800; font-size: 15px; color: #fff; letter-spacing: 0.03em;
}
.lawmed-map-component .staff-photo img { width: 100%; height: 100%; object-fit: cover; }
.lawmed-map-component .staff-info { flex: 1; min-width: 0; }
.lawmed-map-component .staff-name { font-weight: 700; font-size: 14px; }
.lawmed-map-component .staff-role { font-size: 12px; color: var(--c-muted); margin-top: 2px; line-height: 1.4; }
.lawmed-map-component .staff-role-note { font-size: 11px; color: var(--c-primary); margin-top: 1px; font-weight: 600; display: block; }

.lawmed-map-component .btn-contact {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--c-accent); color: #fff; border: none; border-radius: 8px;
	padding: 12px 18px; font-size: 13px; font-weight: 800; cursor: pointer;
	text-decoration: none; transition: background 0.2s, transform 0.15s; width: 100%; letter-spacing: 0.02em;
}
.lawmed-map-component .btn-contact:hover { background: var(--c-accent-dk); transform: translateY(-1px); }
.lawmed-map-component .btn-contact:active { transform: translateY(0); }

.lawmed-map-component .panel-foot { padding: 14px 16px; border-top: 1px solid var(--c-border); flex-shrink: 0; background: var(--c-surface); }

.lawmed-map-component .map-overlay {
	position: absolute; inset: 0; z-index: 400;
	background: rgba(10, 20, 18, 0); opacity: 0; pointer-events: none;
	transition: background 0.25s ease, opacity 0.25s ease;
}
.lawmed-map-component .map-overlay.visible {
	background: rgba(10, 20, 18, 0.35); opacity: 1; pointer-events: auto;
	backdrop-filter: saturate(0.8) blur(1px);
	-webkit-backdrop-filter: saturate(0.8) blur(1px);
}
@media (min-width: 641px) { .lawmed-map-component .map-overlay { display: none !important; } }

.lawmed-map-component .map-hint {
	position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
	background: rgba(0, 60, 54, 0.80); color: #fff; font-size: 12px; font-weight: 600;
	padding: 7px 16px; border-radius: 20px; pointer-events: none; z-index: 300;
	backdrop-filter: blur(6px); white-space: nowrap; transition: opacity 0.4s;
}
.lawmed-map-component .map-hint.hidden { opacity: 0; }

/* Cooperative gestures hint (Leaflet only — Mapbox has its own) */
.lawmed-map-component .lm-gesture-hint {
	position: absolute; inset: 0; z-index: 450;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
	pointer-events: none; opacity: 0;
	transition: opacity 0.2s ease;
	backdrop-filter: blur(2px);
}
.lawmed-map-component .lm-gesture-hint.visible { opacity: 1; }

/* Leaflet marker reset so our DOM icon shows flush */
.lawmed-map-component .leaflet-marker-icon.lm-leaflet-icon { background: transparent; border: none; }
