* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}
/* Header (optional) */

#header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 8px 10px 16px;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: self-end;
    justify-content: space-between;
    gap: 16px;
}
html[data-theme="dark"] #header {
    background-color: rgba(0, 0, 0, 0.8);
    color: #bbb;
    box-shadow: 0 1px 5px rgba(200,200,200,0.45);
}
#header h1 button {
    border: none;
    background: transparent;
    vertical-align: middle;
}
html[data-theme="dark"] div#header h1 button {
    color: #bbb;
}

#header h1 {
    font: 24px/30px serif;
}
#header p {
    font: 14px/20px serif;
}
@media (max-width: 600px) {
    #header h1 {
        font: 20px/30px serif;
    }
    #header p {
        font: 11px/16px serif;
    }
}

ul.legend {
    list-style: none;
    display: flex;
    gap: 16px;
    font: 14px/20px serif;
}
@media (max-width: 600px) {
    ul.legend {
        flex-direction: column;
        gap: 5px;
         font: 12px/18px serif;
        
    }
}
ul.legend li {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}
ul.legend li .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 16px;
}
@media (max-width: 600px) {
    ul.legend li .legend-color {
        width: 12px;
        height: 12px;
        border-radius: 12px;
    }
}

/* Map container */

#map {
    width: 100%;
    height: 650px;
    font: 16px/20px serif;
}

html[data-theme="dark"] div#map {
  filter: invert(1) hue-rotate(185deg);
}
#map .leaflet-top {
  top: 16%;
}
@media (max-width: 898px) {
    #map .leaflet-top {
        top: 16%;
    }
}
@media (max-width: 595px) {
    #map .leaflet-top {
        top: 22%;
    }
}


#map .leaflet-popup {
    max-width: 600px;
}
@media (max-width: 768px  ) {
    #overlay {
      position: fixed !important;
      z-index: 9999;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      transform: none !important;
      background-color: rgba(0,0,0,0.5);
      padding: 20px;
      animation: fadeInOverlay 0.3s ease-out;

    }
    .animate-overlay {
        animation: fadeInOverlay 0.3s ease-out;
    }
    @keyframes fadeInOverlay {
        from {
            opacity: 0;     
        }
        to {
            opacity: 1;         
        }
    }   

    .leaflet-popup-content-wrapper {
      position: relative;
      width: 100% !important;
      height: 100% !important;
      border-radius: 0 !important;
      display: flex;
      flex-direction: column;
      overflow: scroll;
    }
    html[data-theme="dark"] .leaflet-popup-content-wrapper {
        background-color: rgba(30, 30, 30, 0.8);
        color: #bbb;
        box-shadow: 0 1px 10px rgba(200,200,200,0.65);
    }
    .leaflet-popup-content {
      flex: 1;
      overflow-y: auto;
      margin: 0 !important;
      padding: 1rem !important;
      width: 100% !important;
    }

    .leaflet-popup-tip-container {
      display: none !important;
    }
    .leaflet-popup-close-button {
        position: absolute !important;
        top: 0.75rem !important;
        right: 0.75rem !important;
        font-size: 2rem !important;
        z-index: 10;
        line-height: 1;
        text-decoration: none;
        color: #333;
        background-color: transparent;
        border: none;
        cursor: pointer;
    }
    html[data-theme="dark"]  .leaflet-popup-close-button {
        cursor: pointer;
        color: #aaa;
        background-color: transparent;
    }
 }    

.leaflet-popup-content div.popup-content-inner {
    padding: 8px;
}

.leaflet-popup-content div.popup-content-inner h3 {
    color: #333;
    line-height: 1.1;
    padding: 4px 8px;
    margin-top: 0;
}
 html[data-theme="dark"]  .leaflet-popup-content div.popup-content-inner h3 {
    color: #fff;
}

.leaflet-popup-content div.popup-content-inner h4 {
    font-weight: normal;

    padding: 4px 8px;
    margin-top: 0;
    margin-bottom: 8px;
}

.leaflet-popup-content div.popup-content-inner p {
    margin-top: 0;
    margin-bottom: 8px;
}

.leaflet-popup-content div.popup-content-inner div {
    margin-top: 0;
    margin-bottom: 8px;
    font: 16px/20px serif;
    line-height: 1.4;
    
}

.leaflet-popup-content div.popup-content-inner div.address {
    font: 12px/20px monospace;
    color: #0078A8;
    margin-top: 4px 8px;
    padding: 8px;
    border-radius: 4px;
}

.leaflet-popup-content div.popup-content-inner div.address p {
    margin: 0;
}

.leaflet-popup-content div.popup-content-inner div.text {
    padding: 4px 8px;
    margin-top: 0;
    margin-bottom: 8px;
}

.leaflet-popup-content div.popup-content-inner div.teaser {
    padding: 4px 8px;
    margin-top: 0;
    margin-bottom: 8px;
}

.leaflet-popup-content div.popup-content-inner .images img {
  max-width: 100%;
}
.leaflet-popup-close-button {
    box-shadow: none;
    right: 10px;
    top: 0;
    font-size: 30px;
}

#map .leaflet-popup-content-wrapper {
  border-radius: 4px;
}
#map .leaflet-popup-close-button {
  font-size: 24px;
  color: #555;
}


#map .leaflet-tooltip:before {
 
}
#map .leaflet-tooltip {
  background-color: transparent;
  border: 0;
  color: #222;
  box-shadow: 0 1px 3px rgba(0,0,0,0);
}
#map .leaflet-tooltip h4 {

  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
  font-weight: 600;
  /*
  background-color: white;
  padding: 3px 10px;
  border-radius: 3px;
  */
}
html[data-theme="dark"]  #map .leaflet-tooltip h4 {
  color: #111;
  text-shadow: 0 1px 3px rgba(25,25,25,0.9);
}
#map .leaflet-tooltip-top::before {
  bottom: 0;
  margin-bottom: -12px;
  border-top-color: transparent;
}

#map .leaflet-control-attribution, #map .leaflet-control-scale-line {
  padding: 0 5px;
  color: #333;
  line-height: 1.4;
  font-size: 10px;
}