/* --- Responsive Leaflet map sizing --- */
:root{
  --map-min-h: 320px;
  --map-ideal-h: 60vh;
  --map-max-h: 760px;
}

/* Ensure map wrapper can shrink/grow */
#map,
#mapExplorer,
.map-wrap,
.leaflet-container{
  width: 100%;
}

/* If your map element is #map (common) */
#map{
  height: clamp(var(--map-min-h), var(--map-ideal-h), var(--map-max-h));
  border-radius: 18px;
  overflow: hidden;
}

/* On small screens, use more vertical space */
@media (max-width: 768px){
  :root{ --map-ideal-h: 68vh; }
  #map{ border-radius: 16px; }
}

/* On very small phones, still keep it usable */
@media (max-width: 420px){
  :root{ --map-ideal-h: 72vh; --map-min-h: 300px; }
}

/* --- Make Leaflet controls finger-friendly --- */
@media (max-width: 768px){
  .leaflet-control-zoom a,
  .leaflet-control-layers-toggle{
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
  }

  .leaflet-control-zoom{
    margin: 12px !important;
  }

  .leaflet-control-layers{
    margin: 12px !important;
  }
}

/* If you have a sidebar/overlay that covers the map on mobile */
@media (max-width: 768px){
  .map-sidebar{
    position: static;     /* stack instead of overlaying */
    width: 100%;
    margin-bottom: 12px;
  }
}

.leaflet-popup-content{
  max-width: min(78vw, 360px);
}
.leaflet-popup-content-wrapper{
  border-radius: 14px;
}

