/* DIRTGRID homepage Explore layout (front page only).
   Desktop (>=992px): map on the left half, listing results for the selected tab on the right half.
   "Expand map" grows the map in place to the full content width (70vh) and drops the results below it.
   Mobile (<992px): full-width stacked map (260px) that expands to 60vh.
   State lives on <html class="dgt-map-big"> because Vue rewrites the class attribute of the Explore elements. */

/* ---- Base: grid container (all widths) ---- */
#c27-explore-listings {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden;
}
#c27-explore-listings > * { grid-column: 1 / -1; }
#c27-explore-listings > .explore-head { grid-row: 1; }
#c27-explore-listings > .mobile-explore-head-top { grid-row: 2; }
#c27-explore-listings > .fc-one-column {
  grid-row: 4;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  position: relative !important;
  top: auto !important;
}
#c27-explore-listings > #finderMap.finder-map {
  grid-row: 3;
  position: relative !important;
  top: auto !important; bottom: auto !important; left: auto !important; right: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: 260px !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
  scroll-margin-top: 110px;
}
#c27-explore-listings #finderMap .c27-map,
#c27-explore-listings #finderMap .leaflet-container {
  height: 100% !important;
  min-height: 0 !important;
  width: 100% !important;
}
html.dgt-map-big #c27-explore-listings > #finderMap.finder-map { height: 60vh !important; min-height: 260px !important; }

/* Results panel (un-hides #finderListings from the old Additional CSS rule on desktop only). */
@media (min-width: 992px) {
  #c27-explore-listings > .mobile-explore-head-top,
  #c27-explore-listings > .explore-mobile-nav { display: none !important; }

  #c27-explore-listings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 0; }
  #c27-explore-listings > #finderMap.finder-map { grid-column: 1; grid-row: 3; height: 420px !important; min-height: 0 !important; }
  #c27-explore-listings > .fc-one-column { grid-column: 2; grid-row: 3; background: #fafafa; border-left: 1px solid rgba(0,0,0,.06); }
  #c27-explore-listings .fc-one-column #finderListings {
    display: block !important;
    position: relative !important;
    left: 0 !important;
    width: 100% !important;
    height: 420px !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 12px 16px 16px !important;
    background: #fafafa !important;
    box-shadow: none !important;
    z-index: 1;
  }
  /* Expanded: map spans the full content width, results move underneath at full width. */
  html.dgt-map-big #c27-explore-listings > #finderMap.finder-map { grid-column: 1 / -1; height: 70vh !important; min-height: 420px !important; }
  html.dgt-map-big #c27-explore-listings > .fc-one-column { grid-column: 1 / -1; grid-row: 4; border-left: 0; border-top: 1px solid rgba(0,0,0,.06); }
  /* Full-width results: cards in a 3-up grid (Isotope re-lays out on the resize event the toggle fires). */
  html.dgt-map-big #c27-explore-listings #finderListings .results-view .grid-item { width: 33.3333% !important; }
  html.dgt-map-big #c27-explore-listings .fc-one-column #finderListings { height: auto !important; max-height: 640px; }
}

/* ---- Expand / collapse button, over the map (bottom-left, clear of zoom controls and attribution) ---- */
.dgt-map-btn {
  position: absolute;
  left: 12px;
  bottom: 28px;
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: #F26B1D;
  color: #1F2328;
  font-size: 14px; font-weight: 600; line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.dgt-map-btn:hover { background: #D95A12; }
.dgt-map-btn:focus-visible { outline: 3px solid #1F2328; outline-offset: 2px; }
.dgt-map-btn svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Mobile / tablet: working List view (the old Additional CSS hides #finderListings everywhere) + brand-colored List/Map toggle ---- */
@media (max-width: 991px) {
  #c27-explore-listings.mobile-tab-results #finderListings {
    display: block !important;
    position: static !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 60vh !important;
    overflow: visible !important;
    padding: 12px 12px 90px !important;
    background: #F4F1EA !important;
    box-shadow: none !important;
  }
  #c27-explore-listings.mobile-tab-results #finderListings .results-view .grid-item,
  #c27-explore-listings.mobile-tab-results #finderListings .results-view .lf-item-container { width: 100% !important; max-width: 100% !important; }
  #c27-explore-listings.mobile-tab-results .fc-one-column { height: auto !important; }
  .explore-mobile-nav { z-index: 1000 !important; }
  .explore-mobile-nav .nav-tabs li a { background: #1F2328 !important; color: #F4F1EA !important; border: 2px solid #F26B1D !important; border-radius: 999px !important; box-shadow: 0 4px 18px rgba(0,0,0,.35) !important; padding: 10px 18px !important; height: 44px !important; font-size: 14px !important; }
  .explore-mobile-nav .nav-tabs li a i { color: #F26B1D !important; }
  .explore-mobile-nav .nav-tabs li a:hover, .explore-mobile-nav .nav-tabs li a:focus { background: #F26B1D !important; color: #1F2328 !important; }
  .explore-mobile-nav .nav-tabs li a:hover i { color: #1F2328 !important; }
}

/* "Search as I move the map" is removed: the map and the list always show every listing in the current tab and filters, however you pan or zoom. */
.mapdrag-switch, .mapdrag-switch * { display: none !important; }
