@font-face {
  font-family: "Libre Franklin";
  src: url("/fonts/Libre_Franklin/LibreFranklin-VariableFont_wght.ttf") format("truetype");
  /* For variable fonts, you can optionally specify the weight range */
  font-weight: 100 900;
  font-display: swap; /* Ensures text remains visible during load */
}
:root {
  --heading-font: "Libre Franklin", sans-serif;
  --body-font: "Helvetica", sans-serif; /* or any other font you prefer */
}
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* optional, if you don't want scrolling */
}

/* 2) The map is now “behind” everything, covering the full window */
#map {
  position: fixed; /* or absolute */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* put the map behind other elements */
}
.mapControls {
  z-index: 500;
  padding-top: 100;
}

#masterGrid {
  width: 100%;
  margin-bottom: 1em;
  z-index: 1; /* higher than the map */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  padding-bottom: 20px;
  grid-template-areas:
    "aboutButton"
    "Heading"
    "SettingsButton";
}
#aboutButton {
  font-family: var(--heading-font);
  grid-area: 1 / 1 / 2 / 2;
  margin-left: 20;
  margin-right: auto;
  color: #000000;
}

#aboutButton:visited {
  color: #000000; /* Ensure the text remains black after being clicked */
}
#mainHeading {
  font-family: var(--heading-font);
  grid-area: 1 / 2 / 2 / 3;
  position: relative;
  display: inline-block;
  overflow: hidden;
  width: auto;
  height: auto;
  z-index: 1;
}
#settingsButton {
  grid-area: 1 / 3 / 2 / 4;
  margin-left: auto;
  margin-right: 20;
}

h1 {
  font-family: var(--heading-font);
  position: relative;
  text-align: center;
  padding: 10px;
  width: 100%;
  z-index: 2;
  margin-top: 0px;
  margin-bottom: 0px;
}

.secondary_popup_button {
  position: relative;
  width: min-content;
  border: 0ch;
  z-index: 3;
  background-color: transparent;
}

.secondary_popup_button_image {
  object-fit: cover;
  display: block;
}
.non_map_elements {
  width: 100%;
  position: relative; /* if you plan to position children relative to this container */
  margin-bottom: 0;
  padding-bottom: 0;
}
#aboutDiv {
  border-radius: 1em;
  display: block;
  float: left; /* This pushes the element to the right */
  margin: 5px 0 0 30px; /* top:30px; right:30px; bottom:0; left:0 */
  padding: 15px;
  background: rgba(255, 255, 255, 0.747);
  z-index: 4;
  width: 600px;
  min-width: 20%;
  max-width: 90%;
  min-height: 300px;
  max-height: 90%;
  box-sizing: border-box;
  padding-top: 0.2em;
  padding-bottom: 0.6em;
  clear: both; /* ensures that preceding content doesn't interfere */
}
#aboutText {
  padding: 15px;
  font-family: var(--heading-font);
  font-size: 20px;
  color: #000000;
}
.close_popup_button {
  border-radius: 0.1em;
  background-color: rgb(0, 0, 0);
  border: none;
  color: white;
  padding: 0.5em 0.5em;
  font-size: 16px;
  cursor: pointer;
  float: right;
  width: 2em; /* Make the width the same as the height */
  height: 2em; /* Ensure the button is square */
}

.close_popup_button:hover {
  background-color: rgb(34, 45, 80);
}
.map_filters {
  font-family: var(--heading-font);
  --toggle-scale: 0.6;
  --slider-scale: 1;
  font-size: 16px;
  border-radius: 1em;
  display: block;
  float: right; /* This pushes the element to the right */
  margin: 10px 30px 0 0; /* top:30px; right:30px; bottom:0; left:0 */
  padding: 5px;
  background: rgb(255, 255, 255);
  z-index: 4;
  min-width: 50%;
  max-width: 80%;
  min-height: 600px;
  max-height: 90%;
  box-sizing: border-box;
  padding-top: calc(2.125em * var(--toggle-scale));
  padding-right: calc(2.125em * var(--toggle-scale));
  padding-bottom: calc(1.125em * var(--toggle-scale));
  clear: both; /* ensures that preceding content doesn't interfere */
}

.filter_toggle_label_element{
  display: inline-block;
  vertical-align: middle;
  align-self: right;
  padding-left: 5px;
  padding-right: 5px;
  margin-right: auto; /* Align to the right of its containing item */
}
.filter_toggle_element {
  display: inline-block;
  vertical-align: middle;
  align-self: right;
  padding-left: 5px;
  padding-right: 5px;
  margin-left: auto; /* Align to the right of its containing item */
}
.filter_toggle_button {
  position: relative;
  display: inline-block;
  width: calc(3.75em * var(--toggle-scale)); /* 3.75em ~ 60px if base is 16px */
  height: calc(2.125em * var(--toggle-scale)); /* 2.125em ~ 34px if base is 16px */
  vertical-align: middle;
}
/* Hide default HTML checkbox */
.filter_toggle_button input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: calc(2.125em * var(--toggle-scale)); /* or use em-based radius if you want */
}

.slider:before {
  position: absolute;
  content: "";
  /* previously 26px, now we tie it to the container’s font size + scale */
  width: calc(1.625em * var(--toggle-scale));
  height: calc(1.625em * var(--toggle-scale));
  left: calc(0.25em * var(--toggle-scale));
  bottom: calc(0.25em * var(--toggle-scale));
  background-color: white;
  transition: 0.4s;
  border-radius: calc(2.125em * var(--toggle-scale));
}

input:checked + .slider {
  background-color: #000000;
  /* transform: translateX(calc(1.625em * var(--toggle-scale))); */
}

input:focus + .slider {
  box-shadow: 0 0 1px #000000;
}

input:checked + .slider:before {
  -webkit-transform: translateX(calc(1.625em * var(--toggle-scale)));
  -ms-transform: translateX(calc(1.625em * var(--toggle-scale)));
  transform: translateX(calc(1.625em * var(--toggle-scale)));
}

/* Rounded sliders */
.slider.round {
  border-radius: calc(2.125em * var(--toggle-scale));
}

.slider.round:before {
  border-radius: calc(2.125em * var(--toggle-scale));
}

.filter_toggle_title {
  font-family: var(--heading-font);
  vertical-align: middle;
  text-align: center;
  align-content: center;
  font-size: 16px;
  padding: 0px;
  margin: 0px;
}

.filter_toggle_container {
  background-color: rgba(255, 255, 255); /* A light grey with some transparency */
  padding: calc(0.5em * var(--toggle-scale));
  border-radius: calc(1.25em * var(--toggle-scale));
  border-style: ridge;
  border-color: black;
  display: flex; /* or block, if you prefer simpler. */
  align-items: center; /* horizontally align label & toggle in each container */
  margin-bottom: 1em; /* spacing between containers */
  margin-left: 2em;
  width: 20em;
}

.slider_container_top,
.slider_container,
.slider_container_bottom {

  font-family: var(--heading-font);
  width: 100%;
  max-width: 90%;
  /* keep your z-index as is */

  /* Instead of margin-top: 40px, margin-bottom: 15px, use em + the custom scale: */
  margin-top: calc(2.5em * var(--slider-scale)); /* ~40px => 2.5 * 16px */
  margin-bottom: calc(0.9375em * var(--slider-scale)); /* ~15px => 0.9375 * 16px */

  /* If you want left padding to scale as well, do this: */
  padding-left: calc(5% * var(--slider-scale)); /* or stick to % if that's your preference */

  align-content: center;
  align-self: center;
}
.slider_label {
  font-size: calc(1.125em * var(--slider-scale));

  /* 8px => 0.5em if base is 16px: */
  padding: calc(0.5em * var(--slider-scale));

  /* font-weight: bold; */
  display: inline-block; /* ensure it respects your width/height/padding if needed */
  vertical-align: middle;
}

.noUi-connect{
  background: #474747 !important;
}

.noUi-target {
  height: 10px !important;
}

.noUi-handle {
  height: 15px !important;
}

.noUi-tooltip {
  font-size: 10px !important;
}

@media only screen and (max-width: 600px) {

  #masterGrid {
    top: 0px !important;
    margin-bottom: 2px !important;
    padding-bottom: 2px !important;
  }
  #aboutDiv {
    border-radius: 1em;
    display: block;
    float: left; /* This pushes the element to the right */
    margin: 5px 4px 0 20px; /* top:30px; right:30px; bottom:0; left:0 */
    width: auto;
   
  }
  #aboutText {
    padding: 8px;
    font-family: var(--heading-font);
    font-size: 16px;
    color: #000000;
  }
  .map_filters {
    min-width: 85% !important;
    max-width: 100% !important;
    align-self: center;
    text-align: left;
    font-family: var(--heading-font);
    --toggle-scale: 0.6;
    --slider-scale: 1;
    font-size: 13px;
    border-radius: 1em;
    display: block;
    float: none; /* Remove float for mobile layout */
    width: 100%; /* Use 97% of the viewport/container width */
    margin: 2px auto 0 auto;
    padding-top: 0.8em; /* Top margin of 10px; auto left/right centers the div */
    padding-left: 5px;
    padding-right: 5px;
    background: rgba(255, 255, 255, 0.747);
    z-index: 4;
    /* Instead of min/max-width, we now use a fixed width relative to the viewport */
    min-height: 600px;
    max-height: 90%;
    box-sizing: border-box;
    padding-top: calc(1.125em * var(--toggle-scale));
    padding-bottom: calc(1.125em * var(--toggle-scale));
    clear: both;
  }
  .noUi-target {
    height: 8px !important;
    padding-bottom: 0px !important;
  }

  .noUi-handle {
    height: 12px !important;
  }

  .noUi-tooltip {
    font-size: 8px !important;
  }

  .slider_container_top,
  .slider_container,
  .slider_container_bottom {
    font-family: var(--heading-font);
    width: 100%;
    max-width: 90%;
    /* Reduce the vertical margins */
    margin-top: calc(3.4em * var(--slider-scale)); /* was calc(2.5em * var(--slider-scale)) */
    /* Reduce the left padding */
    padding-left: calc(7% * var(--slider-scale)); /* was calc(5% * var(--slider-scale)) */
    padding-right: calc(7% * var(--slider-scale)); /* was calc(5% * var(--slider-scale)) */

    align-content: center;
    align-self: center;
  }
  .slider_container_bottom {
    margin-bottom: calc(0.4em * var(--slider-scale)) !important; /* was calc(0.9375em * var(--slider-scale)) */
  }

  .slider_label {
    /* Use a smaller font size */
    font-size: calc(0.875em * var(--slider-scale)); /* was calc(1.125em * var(--slider-scale)) */
    /* And reduce the padding */
    padding: calc(0.3em * var(--slider-scale)); /* was calc(0.5em * var(--slider-scale)) */
    display: inline-block;
    vertical-align: middle;
  }
  #noUiSliderTimeOfYearRange {
    margin-bottom: calc(0.4em * var(--slider-scale)) !important; /* was calc(0.9375em * var(--slider-scale)) */
    padding-bottom: calc(0.05em * var(--slider-scale)); /* was calc(0.5em * var(--slider-scale)) */
  }
  h1 {
    font-size: 15px;
  }

  img#buttonImage {
    width: 25px;
  }
.filter_toggle_container{
  width: 24em;
  margin-left: 0.5em;

}
  .filter_toggle_label_element{
    display: inline-block;
    vertical-align: middle;
    align-self: right;
    padding-left: 5px;
    padding-right: 5px;
    margin-right: auto; /* Align to the right of its containing item */
  }

  .noUi-horizontal {
    height: 12px !important;
  }

  .noUi-horizontal .noUi-handle {
    top: -20px !important;
  }
}

@media only screen and (max-width: 350px) {
  h1 {
    font-size: 13px;
  }

  .map_filters {
    height: 400px;
    overflow-y: scroll;
    overflow-x: hidden;
  }
}
