/* =========================
   Base reset
   ========================= */
html, body {
  margin: 0;
  padding: 0;
}

/* ----------------------------
   Accessibility helpers
   ---------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Screen-reader-only helper for map image elements.
   Uses !important throughout to override Squarespace's injected styles. */
.sr-only-map-image {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#mapView { position: relative; }

/* =========================
   Map containers
   ========================= */
#map {
  position: relative;
  top: 0;
  bottom: 0;
  width: 100%;
  min-height: 200px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  cursor: default;
  touch-action: pan-y;
}

/* =========================
   Map loading overlay
   Injected by trailmap-init.js, removed on map idle event.
   Uses the same sk-stretchdelay animation as the site spinner,
   scaled down to fit the map container.
   ========================= */
.map-loading-overlay {
  position: absolute;
  inset: 0;
  background-color: #e8e4de; /* approx. Mapbox streets-light tile color */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 2;
  pointer-events: none;
}

.map-loading-overlay .map-spinner {
  width: 55px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.map-loading-overlay .map-spinner > div {
  background-color: #4AAFD7;
  height: 100%;
  width: 5px;
  border-radius: 2px;
  animation: sk-stretchdelay 1.2s infinite ease-in-out;
}

.map-loading-overlay .map-spinner .rect2 {
  animation-delay: -1.1s;
  background-color: #80AF41;
}

.map-loading-overlay .map-spinner .rect3 {
  animation-delay: -1.0s;
  background-color: #F9F055;
}

.map-loading-overlay .map-spinner .rect4 {
  animation-delay: -0.9s;
  background-color: #80AF41;
}

.map-loading-overlay .map-spinner .rect5 {
  animation-delay: -0.8s;
  background-color: #4AAFD7;
}

@keyframes sk-stretchdelay {
  0%, 40%, 100% { transform: scaleY(0.4); }
  20%            { transform: scaleY(1.0); }
}

.map-loading-overlay .map-loading-label {
  color: #555;
  font-family: proxima-nova, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
}

#map123 {
  overflow: auto;
}

.mapsize {
  overflow: hidden;
  position: relative;
  top: 0;
  bottom: 0;
  height: 350px;
  width: 100%;
}

.mapsize:-webkit-full-screen,
.mapsize:fullscreen {
  overflow: auto;
  height: 100%;
  width: 100%;
}

/* =========================
   Mapbox popup (global)
   ========================= */
.mapboxgl-popup {
  max-width: 315px;
  min-width: 126px;
  font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
}

.mapboxgl-popup-content {
  padding: 8px 10px; /* tightened */
}

.mapboxgl-popup-close-button {
  padding: 2px 6px;
  line-height: 1;
}

/* Mobile popup tweaks */
@media (max-width: 480px) {
  .mapboxgl-popup-content {
    max-width: 250px;
  }
}

/* =========================
   Popup icons / actions row
   ========================= */
.btmRight {
  position: static;
  display: flex;
  justify-content: flex-end;
  gap: 1px;
  padding-top: 3px;
  width: 100%;
}

/* Suppress focus ring for mouse/programmatic focus (e.g. popup auto-focus) */
.btmRight a:focus,
.popupIconLink:focus,
.popupIcon:focus {
  outline: none;
}

/* Restore visible focus ring for keyboard navigation only */
.btmRight a:focus-visible,
.popupIconLink:focus-visible,
.popupIcon:focus-visible {
  outline: 2px solid #108452;
  outline-offset: 2px;
}

/* Prefer single source of truth: 22px icons (better tap targets on mobile) */
.popupIconLink {
  cursor: pointer;
  border-radius: 8px;
  line-height: 0;     /* kills inline svg whitespace */
  padding: 2px;       /* small tap padding */
}

.popupIconLink:hover {
  background-color: lightgrey;
}

.popupIcon {
  color: #108452;
  width: 22px;
  height: 22px;
  display: block;     /* removes svg baseline gap */
  border-radius: 5px;
  padding: 1px;
}

/* =========================
   Satellite Contro
   ========================= */
.satellite-custom-control {
 width: 30px;
 height: 30px;
 pointer-events: auto;
 padding: 2px;
 border-radius: 4px;
 margin: 2px;
 cursor: pointer;
}

.satellite:hover {
 background-color: #f8f8f8;
 color: #404040;
 width: 40px;
 height: 40px;
}

.satellite .active {
 background-color: #3887be;
 color: #ffffff;
 width: 50px;
 height: 50px;
}

/* =========================
  Search Control
  ========================== */
.search-custom-control {
  cursor: pointer;
  padding: 7px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  margin: 2px;
  pointer-events: auto;
}

/* =========================
   Generic popup (flex layout)
   ========================= */
.map-popup {
  min-width: 130px;
  line-height: 1.25;
  padding-bottom: 0;
}

.map-popup-header {
  display: block;
  font-family: proxima-nova, "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgb(16, 132, 82);
  margin: 0 0 7.5px 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: subpixel-antialiased;
}

.map-popup-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.map-popup-image img {
  display: block;
  border-radius: 8px;
  min-width: 60px;
}

.map-popup-body {
  min-width: 0;
  line-height: 1.4;
}

.map-popup-title {
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.15;
}

.map-popup-text {
  margin: 0;
}

.map-popup-text p {
  margin: 0 0 6px 0;
}

.map-popup-text p:last-child {
  margin-bottom: 0;
}

.map-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.map-popup-link {
  color: green;
  text-decoration: underline;
  font-weight: bold;
}

.map-popup-link:focus {
  outline: none;
}

.map-popup-link:focus-visible {
  outline: 2px solid #108452;
  outline-offset: 2px;
}

/* =========================
   Legend
   ========================= */
.legendElement { cursor: default; }

.legendElement.clickable { cursor: pointer; }

.legendElement.clickable:hover {
  font-weight: bold;
  color: white;
  background-color: #108452;
}

.legendElement.clickable.active {
  font-weight: bold;
  color: #108452;
}

.legendElement.clickable.active:hover {
  font-weight: bold;
  color: white;
}

.mapboxgl-ctrl .legend {
  background-color: #fff;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
  padding: 4px;
  position: relative;
  pointer-events: auto;
  right: 0;
  bottom: -7px;
  width: 75px;
}

.legend:hover { background-color: whitesmoke; }

.legend.visible {
  background-color: #fff;
  cursor: auto;
  width: fit-content;
}

#legendHeader { cursor: pointer; }

.legend h4 {
  margin: 0 0 1px;
  position: relative;
}

.legend h4:after {
  position: absolute;
  content: "";
  border-left: 2px solid black;
  border-top: 2px solid black;
  padding: 5px;
  right: 10px;
  top: 3px;
  transform: rotate(-135deg);
}

.legend.visible h4:after {
  transform: rotate(-225deg);
}

.legend-icon {
  display: inline-block;
  height: 21px;
  margin-right: 5px;
  margin-top: 2px;
  width: 24px;
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* Do not repeat the image */
  background-size: cover; /* Resize the background image to cover the entire container */
  background-position-y : -4px;
}

.legend_existing_trail{
  background-image: url("https://northaventrail.org/s/Existing_Trail_Icon.png");
  background-position-y : 3px;
}
.legend_future_expansions{
  background-image: url("https://northaventrail.org/s/Expansion_Plan_Icon.png");
  background-position-y : 3px;
}
.legend_monarch_way{
  background-image: url("https://northaventrail.org/s/Monarch_Way_Icon.png");
  background-position-y : 3px;
}
/*.legend_parking_lot{
  background-image: url("https://northaventrail.org/s/parking.svg");
}
.legend_911_signs{
  background-image: url("https://northaventrail.org/s/mobile-phone.svg");
}
.legend_drinking_fountain{
  background-image: url("https://northaventrail.org/s/water.svg");
}
.legend_waste_stations{
  background-image: url("https://northaventrail.org/s/waste-basket.svg");
}
.legend_picnic_table{
  background-image: url("https://northaventrail.org/s/picnic-site.svg");
}
.legend_murals{
  background-image: url("https://northaventrail.org/s/mural.svg");
}
.legend_gardens{
  background-image: url("https://northaventrail.org/s/garden.svg");
}
.legend_respite{
  background-image: url("https://northaventrail.org/s/highway-rest-area.svg");
}
.legend_information{
  background-image: url("https://northaventrail.org/s/information.svg");
}

.legend_bridge{
  background-image: url("https://northaventrail.org/s/bridge.svg");
}
.legend_school{
  background-image: url("https://northaventrail.org/s/school.svg");
}
.legend_monument{
  background-image: url("https://northaventrail.org/s/monument.svg");
}
.legend_gyms{
  background-image: url("https://northaventrail.org/s/fitness-centre.svg");
}
.legend_religious-christian{
  background-image: url("https://northaventrail.org/s/religious-christian.svg");
}
.legend_bench{
  background-image: url("https://northaventrail.org/s/bench.svg");
}
.legend_bicycles{
  background-image: url("https://northaventrail.org/s/bicycle.svg");
}
.legend_religious-jewish{
  background-image: url("https://northaventrail.org/s/religious-jewish.svg");
}
.legend_natural{
  background-image: url("https://northaventrail.org/s/natural.svg");
}
.legend_park{
  background-image: url("https://northaventrail.org/s/park.svg");
}
.legend_swimming{
  background-image: url("https://northaventrail.org/s/swimming.svg");
}
.legend_road{
  background-image: url("https://northaventrail.org/s/road.svg");
}
*/

.shareButton{
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;

  font: inherit;
  color: inherit;
  text-align: inherit;

  cursor: pointer;
}

/* Slide behavior */
.mapboxgl-ctrl .legend.notFullScreen {
  transform: translateX(0);
  transition: transform 0.45s ease, max-width 0.45s ease;
}

.mapboxgl-ctrl .legend.notFullScreen.visible {
  transform: translateX(-40px);
}

/* Legend content collapse/expand */
.legend #hideLegend {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
}

.legend.visible #hideLegend {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  overflow: auto;
}

.legend #hideLegend div { display: flex; }

@media (max-width: 700px) {
  .mapboxgl-ctrl .legend {
    right: 30px;
    bottom: -45px;
  }
  .mapboxgl-ctrl .legend.notFullScreen,
  .mapboxgl-ctrl .legend.notFullScreen.visible {
    transform: none !important;
    transition: none !important;
  }
}

/* Legend icon base */
.legendIcon {
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Keep your existing per-icon background-image classes as-is... */
/* .legend_existing_trail { ... } etc */

/* =========================
   Search / dropdown UI
   ========================= */
.locationListDiv {
  /*padding: 6px;*/
  position: absolute;
  top: 12px;
  left: 41px;
  height: 28px;
  width: 65%;
  max-width: 65%;
  overflow: hidden;
  z-index: 80;
  display: none;
  animation: searchClose 0.5s forwards;
}

.locationListDiv.visible {
  display: block;
  overflow: visible;
  animation: searchOpen 0.5s forwards;
}

.locationListDiv.visible > .clearSearch { display: block; }

.inputDropdown {
  padding-left: 5px;
  position: relative;
  /*font-size: 17px;
  height: 22px;*/
  font-size: 100%;
  width: 100%;
  border: 1px solid #008f0c;
  border-radius: 5px;
  color: #108452;
  display: inline-block;
  z-index: 80;
  left: 0px;
  right: 0px;
  box-sizing: border-box !important;
  padding-right: 22px;
}

.inputDropdown:focus {
  outline: 2px solid #108452;
  outline-offset: 1px;
}

.clearSearch {
  position: absolute;
  right: 2px;
  top: 45%;
  transform: translateY(-50%);
  z-index: 81;
  cursor: pointer;
  display: none;
}

.closeIcon{
  width: 20px;
  height: 20px;
  border-radius: 28px;
  background: white;
  stroke: #008f0c;
  fill: none;
  stroke-width: 2;
  vertical-align: middle;
}

.clearSearch:hover .closeIcon { stroke: #006f09; }

.searchDropdown{
  position: relative;
  /*top: 26px;*/
  background: #fff;
  border: 1px solid #008f0c;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 14rem;
  overflow-y: auto;
  z-index: 70;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  margin-left: 3px;
  margin-right: 3px;
}

.searchOption{
  padding: 6px 8px;
  cursor: pointer;
  color: #108452;
  font-size: 16px;
  line-height: 1.2;
}

.searchOption:hover,
.searchOption[aria-selected="true"],
.activeOption{
  background-color: #008f0c;
  color: #fff;
}

.searchOption .label{
  font-weight: 600;
  display: block;
}

.searchOption .desc{
  font-weight: 400;
  opacity: 0.9;
  font-size: 13px;
  margin-top: 2px;
}

@keyframes searchOpen {
  0% { width: 0%; z-index: 80; }
  100% { width: 99%; }
}

@keyframes searchClose {
  0% { width: 99%; }
  100% { width: 0%; z-index: 0; }
}

/* =========================
   Lightbox
   ========================= */
.lightboxable {
  cursor: pointer;
}

.lightboxable:focus {
  outline: none;
}

.lightboxable:focus-visible {
  outline: 2px solid #108452;
  outline-offset: 2px;
}

.lightbox-map {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 10px;
  left: 0;
  top: 0;
  height: 100vh;
  width: 100vw;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  display: flex;
  padding: 0;
  width: 90vw;
  height: 90vh;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  position: relative;
  display: flex;
  width: auto;
  height: auto;
  max-height: 90vh;
  max-width: 90vw;
}

span.lightBoxClosing {
  position: absolute;
  top: 4px;
  right: 4px;
  cursor: pointer;
  background-image: url('https://northaventrail.org/s/clear-1x.png');
  background-size: 96px 24px;
  height: 24px;
  width: 24px;
}

span.lightBoxClosing:hover { background-position: -72px 0; }

/* =========================
   (Optional) Legacy / unused
   ========================= */
/* .container, #remover, .dropdown-check-list, buttonGreen/Red, etc.
   Consider moving these to a separate CSS file if they’re for a different page/module. */

/* Accessibility: Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #108452;
  color: #fff;
  padding: 10px 20px;
  z-index: 10000;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 5px 5px;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}
