/* Sandhills Location Map widget styles. Map dimensions and marker icon filters are emitted per instance by views/widget.php. */

.location-map-shell {
	position: relative;
}

/* Sits above the leaflet panes but clear of the attribution strip. */
.location-map-radius-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 20px;
	z-index: 1000;
	pointer-events: none;
}

.location-map-radius-bar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
}

.location-map-radius-handle {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	background: #fff;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px 4px 0 0;
	box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.3);
	font-size: 13px;
	line-height: 1;
	color: #333;
	cursor: pointer;
}

.location-map-radius-handle:hover {
	background: #f4f4f4;
}

.location-map-radius-handle svg {
	fill: currentColor;
	display: block;
	transition: transform 0.3s ease;
}

.location-map-radius-overlay.is-open .location-map-radius-handle svg {
	transform: rotate(180deg);
}

.location-map-radius-controls {
	pointer-events: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 12px;
	max-height: 0;
	padding: 0 12px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.25);
	transition: max-height 0.3s ease, padding 0.3s ease;
}

.location-map-radius-overlay.is-open .location-map-radius-controls {
	max-height: 200px;
	padding: 10px 12px;
}

.location-map-radius-label {
	margin: 0;
	white-space: nowrap;
}

.location-map-radius-controls input[type="text"] {
	flex: 1 1 200px;
	min-width: 160px;
	max-width: 320px;
}

.location-map-radius-controls input[type="range"] {
	flex: 1 1 150px;
	max-width: 260px;
}

.location-map-radius-value {
	white-space: nowrap;
}

.location-map-radius-status {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 4px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
	padding: 5px 10px;
	font-size: 0.9em;
	line-height: 1;
}

.location-map-radius-status:empty {
	display: none;
}

.location-map-filters-control {
	text-align: right;
}

.location-map-filter-toggle {
	width: 34px;
	height: 34px;
	padding: 0;
	background: #fff;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.location-map-filter-toggle:hover {
	background: #f4f4f4;
}

.location-map-filter-toggle svg {
	width: 16px;
	height: 16px;
	fill: #333;
	display: block;
}

.location-map-filter-panel {
	display: none;
	margin-top: 6px;
	padding: 10px 12px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
	min-width: 170px;
	max-width: 240px;
	max-height: 260px;
	overflow-y: auto;
	text-align: left;
}

.location-map-filter-panel.is-open {
	display: block;
}

.location-map-filter-panel .location-map-filter-heading {
	font-weight: 600;
	margin-bottom: 6px;
}

.location-map-filter-panel label {
	display: block;
	margin: 0 0 6px;
	font-weight: normal;
	cursor: pointer;
}

.location-map-filter-panel label:last-child {
	margin-bottom: 0;
}

.location-map-filter-panel input[type="checkbox"] {
	margin-right: 6px;
}

/* Admin form: popup field ordering list. */
.location-map-popup-row-selected {
	border-left: 3px solid #3a6f8f;
}

.location-map-row-dragging {
	opacity: .6;
}

.location-map-drop-target {
	background: rgba(58, 111, 143, 0.12);
}

/* Keep popup media inside the popup bounds instead of stretching it. */
.leaflet-popup-content img {
	max-width: 100%;
	height: auto;
}

.leaflet-popup-content .location-map-popup-image {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 160px;
	object-fit: contain;
	margin: 4px 0;
}

.leaflet-popup-content .location-map-popup-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 4px 0;
}

.leaflet-popup-content .location-map-popup-gallery .location-map-popup-image {
	max-width: calc(50% - 4px);
	margin: 0;
}

