/* =============================================================================
   Springs Map — Base layout
   The wrap is position:relative and carries the height (set via shortcode).
   The map canvas fills it absolutely; all overlays sit on top.
   ============================================================================= */

.springs-map-wrap {
	position: relative;
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	/* height comes from the shortcode inline style */
}

.springs-map-container {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* =============================================================================
   Layer switcher — top-left overlay
   ============================================================================= */

.springs-layer-switcher {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	display: flex;
	gap: 0;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.springs-layer-btn {
	padding: 7px 13px;
	font-size: 0.78rem;
	font-weight: 500;
	font-family: inherit;
	border: none;
	border-right: 1px solid rgba(0, 0, 0, 0.12);
	background: rgba(255, 255, 255, 0.94);
	color: #2d3b2a;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	backdrop-filter: blur(6px);
	line-height: 1;
}

.springs-layer-btn:last-child {
	border-right: none;
}

.springs-layer-btn:hover {
	background: rgba(240, 248, 240, 0.98);
}

.springs-layer-btn.is-active {
	background: #1a8a5a;
	color: #ffffff;
}

.springs-cluster-btn {
	padding: 7px 13px;
	font-size: 0.78rem;
	font-weight: 500;
	font-family: inherit;
	border: none;
	border-left: 2px solid rgba(0, 0, 0, 0.15);
	background: rgba(255, 255, 255, 0.94);
	color: #2d3b2a;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	backdrop-filter: blur(6px);
	line-height: 1;
}

.springs-cluster-btn:hover {
	background: rgba(240, 248, 240, 0.98);
}

.springs-cluster-btn.is-active {
	background: #1a8a5a;
	color: #ffffff;
}

/* =============================================================================
   Filter panel — bottom-left overlay
   ============================================================================= */

.springs-filter-overlay {
	position: absolute;
	bottom: 28px;   /* sits above Mapbox attribution/scale */
	left: 10px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	max-width: 280px;
	width: calc(100% - 20px);
}

/* Toggle button */
.springs-filter-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: none;
	border-radius: 6px 6px 0 0;
	background: #1a8a5a;
	color: #ffffff;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.14);
	line-height: 1;
}

.springs-filter-toggle:hover {
	background: #15704a;
}

.springs-filter-toggle__icon {
	flex-shrink: 0;
	opacity: 0.9;
}

.springs-filter-count {
	margin-left: 4px;
	padding: 1px 7px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.25);
	font-size: 0.74rem;
	font-weight: 500;
	min-width: 28px;
	text-align: center;
	letter-spacing: 0.02em;
}

/* Filter panel body */
.springs-filter-panel {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
	border-radius: 0 6px 6px 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
	/* Animate open/close */
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
	max-height: 600px;
	opacity: 1;
}

.springs-filter-panel.is-hidden {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
	pointer-events: none;
}

/* Shared control base */
.springs-control {
	font-family: inherit;
	font-size: 0.82rem;
	line-height: 1.4;
	padding: 7px 10px;
	border: 1px solid #c0ccc0;
	border-radius: 4px;
	background: #ffffff;
	color: #2d3b2a;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
	width: 100%;
}

.springs-control:focus {
	outline: none;
	border-color: #1a8a5a;
	box-shadow: 0 0 0 3px rgba(26, 138, 90, 0.2);
}

.springs-select {
	cursor: pointer;
}

.springs-water-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	border: 1px solid #c0ccc0;
	border-radius: 4px;
	background: #ffffff;
	padding: 7px 10px;
	font-size: 0.82rem;
	color: #2d3b2a;
	user-select: none;
	width: 100%;
	box-sizing: border-box;
}

.springs-water-toggle input[type="checkbox"] {
	width: 15px;
	height: 15px;
	cursor: pointer;
	accent-color: #1a8a5a;
	flex-shrink: 0;
	margin: 0;
}

.springs-reset {
	background: #f0f4f0;
	border: 1px solid #c0ccc0;
	border-radius: 4px;
	color: #2d3b2a;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.82rem;
	padding: 7px 10px;
	transition: background 0.15s;
	text-align: center;
}

.springs-reset:hover {
	background: #dce8dc;
}

/* =============================================================================
   Popup
   ============================================================================= */

.springs-mapbox-popup .mapboxgl-popup-content {
	padding: 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.springs-mapbox-popup .mapboxgl-popup-close-button {
	font-size: 18px;
	padding: 4px 8px;
	color: rgba(255, 255, 255, 0.85);
	background: rgba(0, 0, 0, 0.2);
	border-radius: 0 0 0 6px;
	right: 0;
	top: 0;
	line-height: 1;
}

.springs-mapbox-popup .mapboxgl-popup-close-button:hover {
	color: #ffffff;
	background: rgba(0, 0, 0, 0.4);
}

/* Photo — fixed size, never grows the popup */
.springs-popup__photo-wrap {
	width: 100%;
	height: 160px;
	overflow: hidden;
	flex-shrink: 0;
	line-height: 0;
}

.springs-popup__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Body */
.springs-popup__body {
	padding: 10px 14px 14px;
}

.springs-popup__title {
	font-size: 0.98rem;
	font-weight: 700;
	color: #1a3d28;
	margin: 0 0 4px;
	line-height: 1.3;
}

.springs-popup__location {
	font-size: 0.76rem;
	color: #5a7055;
	margin: 0 0 6px;
}

/* Type badges */
.springs-popup__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 7px;
}

.springs-badge {
	display: inline-block;
	font-size: 0.66rem;
	padding: 2px 8px;
	border-radius: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.springs-badge--built       { background: #c8e6c9; color: #1b5e20; }
.springs-badge--cistern     { background: #bbdefb; color: #0d47a1; }
.springs-badge--basin       { background: #b2dfdb; color: #004d40; }
.springs-badge--inscription { background: #e1bee7; color: #4a148c; }

/* Meta rows */
.springs-popup__meta {
	font-size: 0.78rem;
	color: #3a5235;
	margin: 0 0 3px;
	line-height: 1.4;
}

.springs-popup__water {
	color: #1a8a5a;
	font-weight: 600;
}

/* CTA */
.springs-popup__link {
	display: inline-block;
	margin-top: 10px;
	padding: 7px 16px;
	background: #1a8a5a;
	color: #ffffff !important;
	border-radius: 4px;
	text-decoration: none !important;
	font-size: 0.82rem;
	font-weight: 600;
	transition: background 0.15s;
}

.springs-popup__link:hover {
	background: #15704a;
}

/* =============================================================================
   Responsive
   ============================================================================= */

/* =============================================================================
   [pigi_form] — Login gate
   ============================================================================= */

.pf-gate {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 16px;
	padding: 48px 32px;
	background: #f5fbf5;
	border: 1px solid #c8e0c8;
	border-radius: 12px;
	max-width: 420px;
	margin: 32px auto;
}

.pf-gate__icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #1a3d28;
	color: rgba(255, 255, 255, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.pf-gate__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #1a3d28;
}

.pf-gate__text {
	margin: 0;
	font-size: 0.92rem;
	color: #4a6a45;
	line-height: 1.55;
}

.pf-gate__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 11px 28px;
	background: #1a8a5a;
	color: #ffffff !important;
	text-decoration: none !important;
	border-radius: 6px;
	font-size: 0.92rem;
	font-weight: 600;
	transition: background 0.15s;
	line-height: 1;
}

.pf-gate__btn:hover { background: #15704a; }

/* =============================================================================
   Form 1 — Location Picker Map  (#piges_form_map)
   ============================================================================= */

#piges_form_map {
	height: 450px;
	border-radius: 8px;
	/* position:relative is set by Mapbox GL automatically */
}

/** Coordinate badge — bottom-right inside the map canvas */
.form-map-coords {
	position: absolute;
	bottom: 30px;
	right: 10px;
	z-index: 3;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(6px);
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 0.78rem;
	font-weight: 500;
	color: #1a3d28;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	pointer-events: none;
	line-height: 1.3;
	max-width: 260px;
}

/** Refresh / geolocate button — sits below the map in the GF HTML field */
#refresh_coordinates {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 10px;
	padding: 9px 20px;
	background: #1a8a5a;
	color: #ffffff !important;
	border: none;
	border-radius: 5px;
	font-family: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
	line-height: 1;
}

#refresh_coordinates:hover { background: #15704a; }

/* =============================================================================
   Measurements Section  [pigi_metrisis]
   ============================================================================= */

.pm-section {
	margin-top: 32px;
	font-family: inherit;
}

/* ── No-data message ── */
.pm-no-data {
	padding: 24px;
	text-align: center;
	color: #7a9a75;
	font-style: italic;
	border: 1px dashed #c0d0c0;
	border-radius: 8px;
	margin-top: 16px;
}

/* ── Latest Measurement highlight ── */
.pm-latest {
	background: #1a3d28;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 20px;
}

.pm-latest__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px;
	padding: 13px 20px 11px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pm-latest__label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.5);
}

.pm-latest__meta {
	font-size: 0.84rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.8);
}

.pm-latest__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 20px 0;
}

.pm-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 0.8rem;
	color: #fff;
}

.pm-badge--flow-status { background: rgba(26, 138, 90, 0.75); }
.pm-badge--metrisi     { background: rgba(52, 152, 219, 0.75); }

.pm-latest__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.pm-card {
	padding: 16px 12px 14px;
	text-align: center;
	border-right: 1px solid rgba(255, 255, 255, 0.07);
	transition: background 0.15s;
}

.pm-card:last-child { border-right: none; }

.pm-card--flow    { border-top: 3px solid #1a8a5a; }
.pm-card--temp    { border-top: 3px solid #e67e22; }
.pm-card--ph      { border-top: 3px solid #3498db; }
.pm-card--ec      { border-top: 3px solid #9b59b6; }
.pm-card--tds     { border-top: 3px solid #e74c3c; }

.pm-card__value {
	font-size: 1.55rem;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.1;
	margin-bottom: 5px;
}

.pm-card__unit {
	font-size: 0.65rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.45);
	margin-left: 2px;
	vertical-align: super;
}

.pm-card__label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: rgba(255, 255, 255, 0.4);
}

/* ── Charts section ── */
.pm-charts {
	border: 1px solid #dde8dd;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 20px;
}

.pm-charts__tabs {
	display: flex;
	background: #f0f5f0;
	border-bottom: 1px solid #dde8dd;
	overflow-x: auto;
	scrollbar-width: none;
}

.pm-charts__tabs::-webkit-scrollbar { display: none; }

.pm-tab {
	flex: 1;
	min-width: max-content;
	padding: 11px 16px;
	font-size: 0.82rem;
	font-weight: 500;
	font-family: inherit;
	border: none;
	border-right: 1px solid #dde8dd;
	background: transparent;
	color: #5a7055;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	white-space: nowrap;
	line-height: 1;
}

.pm-tab:last-child { border-right: none; }

.pm-tab:hover {
	background: #e0ece0;
	color: #1a3d28;
}

.pm-tab.is-active {
	background: #ffffff;
	color: #1a3d28;
	font-weight: 700;
	box-shadow: inset 0 -2px 0 #1a8a5a;
}

.pm-charts__body { background: #ffffff; }

.pm-chart-wrap {
	display: none;
	padding: 16px 20px 20px;
	height: 270px;
	box-sizing: content-box;
}

.pm-chart-wrap.is-active { display: block; }

/* ── Data table ── */
.pm-table-wrap {
	border: 1px solid #dde8dd;
	border-radius: 10px;
	overflow: hidden;
}

.pm-table__title {
	margin: 0;
	padding: 11px 20px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #5a7055;
	background: #f0f5f0;
	border-bottom: 1px solid #dde8dd;
}

.pm-table-scroll { overflow-x: auto; }

.pm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.84rem;
	color: #2d3b2a;
}

.pm-table thead th {
	padding: 9px 14px;
	text-align: left;
	background: #f8fbf8;
	font-weight: 600;
	font-size: 0.78rem;
	color: #3a5235;
	border-bottom: 2px solid #dde8dd;
	white-space: nowrap;
}

.pm-table thead th small {
	display: block;
	font-weight: 400;
	color: #7a9a75;
	font-size: 0.68rem;
}

.pm-table tbody tr {
	border-bottom: 1px solid #eef3ee;
	transition: background 0.12s;
}

.pm-table tbody tr:last-child { border-bottom: none; }
.pm-table tbody tr:hover       { background: #f5fbf5; }

.pm-table td {
	padding: 9px 14px;
	vertical-align: middle;
}

/* =============================================================================
   Responsive (existing breakpoint — keep together)
   ============================================================================= */

@media (max-width: 520px) {
	.springs-filter-overlay {
		bottom: 24px;
		max-width: calc(100% - 20px);
	}

	/* On very small screens collapse the panel by default */
	.springs-filter-panel:not(.is-hidden) {
		max-height: 400px;
		overflow-y: auto;
	}

	.springs-layer-btn {
		padding: 6px 9px;
		font-size: 0.72rem;
	}

	/* Measurements section */
	.pm-latest__header    { flex-direction: column; gap: 4px; }
	.pm-card__value       { font-size: 1.2rem; }
	.pm-chart-wrap        { height: 210px; }
}

/* =============================================================================
   Access-directions button [pigi_directions]
   ============================================================================= */

.pigi-directions-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	font-size: 0.92rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	color: #ffffff;
	background: #1565c0;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
}

.pigi-directions-btn:hover {
	background: #0d47a1;
}

.pigi-directions-btn:disabled,
.pigi-directions-btn.is-loading {
	opacity: 0.7;
	cursor: progress;
}

.pigi-directions-btn__icon {
	font-size: 1.05em;
	line-height: 1;
}
