text{
    font-family:"Libre Franklin"
}


  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* touch-action: none; */
  }
  
  #map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
      overflow: visible !important;

    /* touch-action: pan-x pan-y; */
  }
  
  
  /* Overlay floats *above* the map */
  #map-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    background: rgba(255, 255, 255);
    padding: 15px 18px;
    border-radius: 8px;
    min-width: 270px;
    width:30vw;
    height:auto;
    font-family: 'Libre Franklin', sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
  
  #map-overlay h1 {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    line-height: 130%;
    font-weight: 600;
  }
  
  #map-overlay p {
    font-size: 1rem;
    line-height: 1.3em;
    color: #555;
    margin-top: 10px;
  }
  
  #legend {
    position: absolute;
    bottom: 10px;
    left: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);    
    padding: 10px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(161, 161, 161, 0.15);
    z-index: 1;
    /* min-width: 230px; */
    width:auto;
    height:auto;
    font-family: 'Libre Franklin', sans-serif;
  }
  
  .legend h4 {
    margin: 0 0 2px;
    font-weight: 500;
    font-size: 0.9em;
  }
  
  .legend-table {
    border-collapse: separate;
    border-spacing: 0px 2px;
    table-layout: fixed;
    width: auto;
  }
  
  .legend-table th {
    /* min-width: 24px; */
    text-align: left;
    font-weight: 400;
    font-size: 0.7em;
    color: #333;
    padding: 2px 2px; 
    padding-left: -10px
  }
  
  .legend-table td:first-child {
    width: auto;
    text-align: left;
    font-size: 0.8em;
    font-weight: 300;
    color: #222;
    padding-right: 8px;
    white-space: nowrap;
   
  }
  
  .legend-table tbody tr td:first-child {
    vertical-align: middle;
  }
  
  .legend-table td:not(:first-child) {
    min-width: 20px;
    width: 10px;
    height: 5px;
    border-style: solid;
  border-color: white;
  border-width: 2px 0 2px 0;
    transition: all 0.2s ease;
    position: relative;
  }
  
  

/* Ensure popup can extend beyond map bounds */
.mapboxgl-map {
  overflow: visible !important;
}

#geocoder {
  margin-bottom: 15px;
}

.mapboxgl-popup {
  z-index: 100 !important;
}

.mapboxgl-ctrl-geocoder {
  min-width: 100%;
  box-shadow: none;
  border: 1px solid #ddd;
  /* height: 50px; */
}

.mapboxgl-ctrl-geocoder input {
  font-family: 'Libre Franklin', Arial, sans-serif;
  font-size: 1em;

}

  /* Remove the popup "pointer" triangle */
  .mapboxgl-popup-tip {
    display: none !important;
  }
  
  /* Tiny visual lift of the inner box only (optional) */
  .mapboxgl-popup .mapboxgl-popup-content {
    transform: translateY(-30px);
  }
  
  .mapboxgl-popup-content {
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border:#ddd 1px solid;
    padding: 12px 16px;
    z-index: 2;  
    padding: 10px 14px;
    font-family: 'Libre Franklin', sans-serif;
    min-width: 260px;
        /* max-width: calc(100vw - 40px); */
  }
  

  .mapboxgl-popup-content h2 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
  }


  .candidate-list {
    font-size: 13px;
    margin-top: 6px;
  }
  
  /* Header row */
  .candidate-header {
    display: grid;
    grid-template-columns: 1fr 20px 50px;
    column-gap: 8px;
    letter-spacing: 1px;
    font-weight: 400;
    font-size: 11px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1px;
    margin-bottom: 4px;
    color: #333;
  }
  .candidate-header .candidate-pct {
    font-weight: 400; 
    color: #333;
  }

  .candidate-header .candidate-name {
    font-weight: 400; 
    color: #333;
  }
  
  
  /* Candidate rows */
  .candidate-row {
    display: grid;
    grid-template-columns: 1fr 20px 50px;
    column-gap: 8px;
    align-items: center;
    padding-bottom: 2px;
    margin-bottom: 4px;
    border-bottom: 1px solid #eee;
  }
  
  .candidate-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #222;
    white-space: normal;
  }
  
  .candidate-color {
    width: 3px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
  }
  
  .candidate-votes {
    justify-self: start;
    text-align: left;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    color: #444;
  }
  
  .candidate-pct {
    justify-self: end;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    color: #111;
  }
  
  

  h2 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    line-height: 120%;
    font-weight: 00;
    font-family: 'Libre Franklin', sans-serif;
  }

 
.mapboxgl-ctrl-bottom-left {
  left: auto;
  right: 0;         /* move to the right edge */
}

.mapboxgl-ctrl.mapboxgl-ctrl-attrib {
  margin-right: 10px;
  margin-bottom: 30px;
}

  
     /* Mobile styles */
     @media (max-width: 768px) {
      #map-overlay {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        min-width: auto;
        padding: 10px;
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(8px);
      }
      
      #map-overlay h1,
      #map-overlay p {
        display: none;
      }
      
      #geocoder {
        margin-bottom: 0;
      }
      
      .mapboxgl-ctrl-geocoder {
        width: 100%;
        max-width: 100%;
        font-size: 14px;
      }
      
      .mapboxgl-popup {
        z-index: 100 !important;
      }
      
    

      .mapboxgl-popup-content {
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(8px);
        min-width: 230px;
        max-width: calc(100vw - 50px);
      }

      .legend {
        background: rgba(255, 255, 255, 0.4); /* translucent white */
        backdrop-filter: blur(5px);           /* ✅ adds the blur */
        -webkit-backdrop-filter: blur(10px);   /* ✅ for iOS Safari */
        border: 1px solid rgba(255, 255, 255, 0.3);
      }
    
      .legend-content {
        color: #000;
      }
    }



