
/* =========================================================
   BPS LTFP Map — Filter Menu and Legend Styling
   File: css/bps-filter-overrides.css
   ========================================================= */

:root {
  --bps-navy: #003b5c;
  --bps-teal: #008f95;
  --bps-teal-dark: #006f73;
  --bps-text: #263746;
  --bps-muted: #647583;
  --bps-border: #d5dee5;
  --bps-panel: #ffffff;
  --bps-page: #f3f6f8;
}

/* Filter menu panel */
#menu {
  box-sizing: border-box;
  box-sizing: border-box;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  padding: 16px;
  background: var(--bps-panel);
  color: var(--bps-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

/* Filter groups */
#menu .filterselect,
#menu .slider-filter {
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 0 0 13px;
  border-bottom: 1px solid var(--bps-border);
}

/* Filter title and Clear button share one row */
#menu .filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
}

#menu .filter-title {
  flex: 1 1 auto;
  margin: 0;
  color: var(--bps-navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

/* Clear buttons */
#menu .clear-filter-button {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--bps-teal);
  border-radius: 4px;
  background: #ffffff;
  color: var(--bps-teal-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

#menu .clear-filter-button:hover {
  background: var(--bps-teal);
  color: #ffffff;
}

#menu .clear-filter-button:focus-visible,
#menu select:focus-visible {
  outline: 3px solid rgba(0, 143, 149, 0.3);
  outline-offset: 2px;
}

/* Category multi-selects */
#menu select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--bps-border);
  border-radius: 4px;
  background: #ffffff;
  color: var(--bps-text);
  font-family: inherit;
  font-size: 13px;
  padding: 7px;
}

#menu select[multiple] {
  min-height: 70px;
}

#menu select option {
  padding: 4px 5px;
}

#menu select option:checked {
  background: var(--bps-navy);
  color: #ffffff;
}

/* Range sliders */
#menu .slider-filter .slider {
  margin: 12px 4px 18px;
}

#menu .noUi-target {
  border-color: var(--bps-border);
  box-shadow: none;
}

#menu .noUi-connect {
  background: var(--bps-teal);
}

#menu .noUi-handle {
  border: 1px solid var(--bps-teal-dark);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

#menu .noUi-handle:focus-visible {
  outline: 3px solid rgba(0, 143, 149, 0.3);
  outline-offset: 2px;
}

/* Map popups */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border-radius: 5px;
}

.leaflet-popup-content {
  color: var(--bps-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.leaflet-popup-content table {
  border-collapse: collapse;
}

.leaflet-popup-content tr + tr {
  border-top: 1px solid #e7edf1;
}

.leaflet-popup-content td,
.leaflet-popup-content th {
  padding: 5px 7px;
  text-align: left;
}

.leaflet-popup-content th {
  color: var(--bps-navy);
}

/* Layer selector and legend */
.leaflet-control-layers,
.leaflet-control-layers-expanded {
  border: 1px solid var(--bps-border);
  border-radius: 5px;
  background: #ffffff;
  color: var(--bps-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.leaflet-control-layers-separator {
  border-top: 1px solid var(--bps-border);
}

/* Subtle border around the PNG swatches for the enrollment legend only */
.leaflet-control-layers img[src*="Heatmap_Data_"] {
  box-sizing: content-box;
  border: 1px solid #b8c7d1;
  border-radius: 2px;
  background: #ffffff;
  vertical-align: middle;
}

/* Keep legend imagery aligned */
.leaflet-control-layers td {
  padding: 2px 4px;
  vertical-align: middle;
}

/* Responsive spacing */
@media (max-width: 700px) {
  #menu {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
    padding: 10px;
  }

  #menu .filterselect,
  #menu .slider-filter {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  #menu .filter-heading {
    gap: 6px;
  }
}


/* Authoritative layout: reserve a real column for the sidebar. */
html, body { width:100% !important; height:100% !important; margin:0 !important; padding:0 !important; overflow:hidden !important; }
#all { display:flex !important; flex-direction:row !important; align-items:stretch !important; gap:0 !important; width:100% !important; height:100% !important; margin:0 !important; padding:0 !important; overflow:hidden !important; }
#mapWindow { display:block !important; float:none !important; flex:1 1 0% !important; width:0 !important; min-width:0 !important; height:100% !important; margin:0 !important; padding:0 !important; }
#map { position:relative !important; display:block !important; width:100% !important; height:100% !important; margin:0 !important; padding:0 !important; }
#menu { display:block !important; float:none !important; position:relative !important; flex:0 0 300px !important; width:300px !important; min-width:300px !important; max-width:300px !important; height:100% !important; margin:0 !important; overflow-x:hidden !important; overflow-y:auto !important; align-self:stretch !important; box-sizing:border-box !important; padding:16px !important; background:#fff !important; text-align:center !important; }
#menu .filterselect, #menu .slider-filter { width:100% !important; max-width:100% !important; margin-left:auto !important; margin-right:auto !important; box-sizing:border-box !important; }
#menu .filter-heading { justify-content:center !important; }
#menu .filter-title, #dataSourceFooter { text-align:center !important; }
#menu .slider, #menu select { margin-left:auto !important; margin-right:auto !important; }
@media (max-width:700px) { #menu { flex-basis:250px !important; width:250px !important; min-width:250px !important; max-width:250px !important; padding:12px !important; } }
