body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  font-family: 'Utopia Std', serif;
  
}

/* Header content should appear above the map */
.header {
  background-color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 20px;
  z-index: 2;
  padding: 10px 0;
  font-family: 'Utopia Std Bold', serif;
}

.header h1 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.5em;
  font-family: 'Utopia Std Bold', serif;
}



.header p {
  margin: 0 0 10px 0;
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.45;
  max-width: 70ch;
  font-family: 'Utopia Std', serif;
}

/* ---------------------------
   Tabs
--------------------------- */
.tabs {
  display: inline-flex;
  gap: 8px;
  margin-top: 6px;
}

.tab {
  appearance: none;
  border: 1px solid #bbb;
  background: white;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-family: 'Utopia Std', serif;
  cursor: pointer;
  line-height: 1;
}

.tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.tab:focus {
  outline: 2px solid #333;
  outline-offset: 2px;
}

/* Map takes up remaining vertical space */
#map {
  flex: 1;
  width: 100%;
  height: 600px;
  position: relative;
  z-index: 0;
  padding-top: 0;
  padding: 10px;
}

/* Legend remains positioned over the map */
#legend {
  position: absolute;
  top: 270px;
  left: 60px;
  border-radius: 5px;
  padding: 10px 15px;
  font-family: sans-serif;
  font-size: 11px;
  z-index: 2;
  width: 250px;
}

.legend-scale {
  position: relative;
  display: flex;
  flex-direction: column;
}

.color-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: linear-gradient(to right, #662506, #fff7bc);
  border: 1px solid #aaa;
  margin: 5px 0;
}

.legend-scale span:first-child {
  position: absolute;
  top: -10px;
  left: 0;
  font-weight: bold;
}

.legend-scale span:last-child {
  position: absolute;
  top: -10px;
  right: 0;
  font-weight: bold;
}

/* Popup text formatting */
.mapboxgl-popup-content h4 {
  font-weight: 300;
  font-size: 0.9em;
  border-bottom: 0.5px solid rgb(80, 80, 80);
  margin: 0.5em 0;
}

.mapboxgl-popup-content h2 {
  font-weight: 500;
  margin: 0.5em 0 0.3em;
}

.mapboxgl-popup-content p {
  font-weight: 300;
  margin: 0.3em 0 0;
}

/* Footer */
footer {
  position: relative;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 10px 10px;
  font-size: 14px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  padding-right: 160px;
}

.footer-right {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.footer-logo {
  max-height: 50px;
  height: auto;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #map {
    height: 400px;
  }

  .header {
    padding: 10px;
    margin: 0 10px;
  }

  #legend {
    left: 15px;
    top: 230px;
    width: 220px;
  }
}