/* =========================================
   TAXONOMY PAGES
   Covers:
   - lh_location
   - lh_difficulty
   - lh_type
   ========================================= */

.lh-page-head{
  margin-bottom: 14px;
}

.lh-page-head h1{
  margin: 0;
}

/* Results grid for taxonomy pages */
body.taxonomy-lh_location .nearby-grid,
body.tax-lh_location .nearby-grid,
body.taxonomy-lh_difficulty .nearby-grid,
body.tax-lh_difficulty .nearby-grid,
body.taxonomy-lh_type .nearby-grid,
body.tax-lh_type .nearby-grid{
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}

@media (max-width: 1100px){
  body.taxonomy-lh_location .nearby-grid,
  body.tax-lh_location .nearby-grid,
  body.taxonomy-lh_difficulty .nearby-grid,
  body.tax-lh_difficulty .nearby-grid,
  body.taxonomy-lh_type .nearby-grid,
  body.tax-lh_type .nearby-grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 640px){
  body.taxonomy-lh_location .nearby-grid,
  body.tax-lh_location .nearby-grid,
  body.taxonomy-lh_difficulty .nearby-grid,
  body.tax-lh_difficulty .nearby-grid,
  body.taxonomy-lh_type .nearby-grid,
  body.tax-lh_type .nearby-grid{
    grid-template-columns: 1fr;
  }
}

/* Taxonomy cards stats layout */
body.taxonomy-lh_location .nearby-info .nstats,
body.tax-lh_location .nearby-info .nstats,
body.taxonomy-lh_difficulty .nearby-info .nstats,
body.tax-lh_difficulty .nearby-info .nstats,
body.taxonomy-lh_type .nearby-info .nstats,
body.tax-lh_type .nearby-info .nstats{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.taxonomy-lh_location .nearby-info .nstat,
body.tax-lh_location .nearby-info .nstat,
body.taxonomy-lh_difficulty .nearby-info .nstat,
body.tax-lh_difficulty .nearby-info .nstat,
body.taxonomy-lh_type .nearby-info .nstat,
body.tax-lh_type .nearby-info .nstat{
  min-width: 0;
}

/* Accessibility helper */
.lh-sr-only{
  position:absolute !important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Filters wrapper */
body.taxonomy-lh_location .lh-filters,
body.tax-lh_location .lh-filters,
body.taxonomy-lh_difficulty .lh-filters,
body.tax-lh_difficulty .lh-filters,
body.taxonomy-lh_type .lh-filters,
body.tax-lh_type .lh-filters{
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 12px 0 18px;
  padding: 0;
}

/* Sticky filter bar wrapper on mobile */
body.taxonomy-lh_location .lh-filterbar-wrap,
body.tax-lh_location .lh-filterbar-wrap,
body.taxonomy-lh_difficulty .lh-filterbar-wrap,
body.tax-lh_difficulty .lh-filterbar-wrap,
body.taxonomy-lh_type .lh-filterbar-wrap,
body.tax-lh_type .lh-filterbar-wrap{
  margin-bottom: 12px;
}

@media (max-width: 640px){
  body.taxonomy-lh_location .lh-filterbar-wrap,
  body.tax-lh_location .lh-filterbar-wrap,
  body.taxonomy-lh_difficulty .lh-filterbar-wrap,
  body.tax-lh_difficulty .lh-filterbar-wrap,
  body.taxonomy-lh_type .lh-filterbar-wrap,
  body.tax-lh_type .lh-filterbar-wrap{
    position: sticky;
    top: calc(var(--header-offset) + 8px);
    z-index: 50;
  }
}

/* Filter bar */
body.taxonomy-lh_location .lh-filterbar,
body.tax-lh_location .lh-filterbar,
body.taxonomy-lh_difficulty .lh-filterbar,
body.tax-lh_difficulty .lh-filterbar,
body.taxonomy-lh_type .lh-filterbar,
body.tax-lh_type .lh-filterbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Toggle button */
body.taxonomy-lh_location .lh-filterbar-btn,
body.tax-lh_location .lh-filterbar-btn,
body.taxonomy-lh_difficulty .lh-filterbar-btn,
body.tax-lh_difficulty .lh-filterbar-btn,
body.taxonomy-lh_type .lh-filterbar-btn,
body.tax-lh_type .lh-filterbar-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 12px;
}

body.taxonomy-lh_location .lh-filterbar-btn:hover,
body.tax-lh_location .lh-filterbar-btn:hover,
body.taxonomy-lh_difficulty .lh-filterbar-btn:hover,
body.tax-lh_difficulty .lh-filterbar-btn:hover,
body.taxonomy-lh_type .lh-filterbar-btn:hover,
body.tax-lh_type .lh-filterbar-btn:hover{
  background: rgba(0,0,0,.05);
}

/* Icon circle */
body.taxonomy-lh_location .lh-filterbar-icon,
body.tax-lh_location .lh-filterbar-icon,
body.taxonomy-lh_difficulty .lh-filterbar-icon,
body.tax-lh_difficulty .lh-filterbar-icon,
body.taxonomy-lh_type .lh-filterbar-icon,
body.tax-lh_type .lh-filterbar-icon{
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-size: 18px;
  line-height: 1;
}

/* Right side controls */
body.taxonomy-lh_location .lh-filterbar-right,
body.tax-lh_location .lh-filterbar-right,
body.taxonomy-lh_difficulty .lh-filterbar-right,
body.tax-lh_difficulty .lh-filterbar-right,
body.taxonomy-lh_type .lh-filterbar-right,
body.tax-lh_type .lh-filterbar-right{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.taxonomy-lh_location .lh-filterbar-right select,
body.tax-lh_location .lh-filterbar-right select,
body.taxonomy-lh_difficulty .lh-filterbar-right select,
body.tax-lh_difficulty .lh-filterbar-right select,
body.taxonomy-lh_type .lh-filterbar-right select,
body.tax-lh_type .lh-filterbar-right select{
  padding: 10px 10px;
  border-radius: 12px;
}

/* Reset button */
body.taxonomy-lh_location .lh-reset-btn,
body.tax-lh_location .lh-reset-btn,
body.taxonomy-lh_difficulty .lh-reset-btn,
body.tax-lh_difficulty .lh-reset-btn,
body.taxonomy-lh_type .lh-reset-btn,
body.tax-lh_type .lh-reset-btn{
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

body.taxonomy-lh_location .lh-reset-btn:hover,
body.tax-lh_location .lh-reset-btn:hover,
body.taxonomy-lh_difficulty .lh-reset-btn:hover,
body.tax-lh_difficulty .lh-reset-btn:hover,
body.taxonomy-lh_type .lh-reset-btn:hover,
body.tax-lh_type .lh-reset-btn:hover{
  background: rgba(0,0,0,.04);
}

/* Filters collapse */
body.taxonomy-lh_location form.lh-filters[data-mobile-collapsed="1"] .lh-filters-body,
body.tax-lh_location form.lh-filters[data-mobile-collapsed="1"] .lh-filters-body,
body.taxonomy-lh_difficulty form.lh-filters[data-mobile-collapsed="1"] .lh-filters-body,
body.tax-lh_difficulty form.lh-filters[data-mobile-collapsed="1"] .lh-filters-body,
body.taxonomy-lh_type form.lh-filters[data-mobile-collapsed="1"] .lh-filters-body,
body.tax-lh_type form.lh-filters[data-mobile-collapsed="1"] .lh-filters-body{
  display: none !important;
}

/* Filter cards */
body.taxonomy-lh_location .lh-card,
body.tax-lh_location .lh-card,
body.taxonomy-lh_difficulty .lh-card,
body.tax-lh_difficulty .lh-card,
body.taxonomy-lh_type .lh-card,
body.tax-lh_type .lh-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
}

body.taxonomy-lh_location .lh-filters-row,
body.tax-lh_location .lh-filters-row,
body.taxonomy-lh_difficulty .lh-filters-row,
body.tax-lh_difficulty .lh-filters-row,
body.taxonomy-lh_type .lh-filters-row,
body.tax-lh_type .lh-filters-row{
  display: grid;
  gap: 14px;
}

body.taxonomy-lh_location .lh-filters-row--main,
body.tax-lh_location .lh-filters-row--main,
body.taxonomy-lh_difficulty .lh-filters-row--main,
body.tax-lh_difficulty .lh-filters-row--main,
body.taxonomy-lh_type .lh-filters-row--main,
body.tax-lh_type .lh-filters-row--main{
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px){
  body.taxonomy-lh_location .lh-filters-row--main,
  body.tax-lh_location .lh-filters-row--main,
  body.taxonomy-lh_difficulty .lh-filters-row--main,
  body.tax-lh_difficulty .lh-filters-row--main,
  body.taxonomy-lh_type .lh-filters-row--main,
  body.tax-lh_type .lh-filters-row--main{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  body.taxonomy-lh_location .lh-filters-row--main,
  body.tax-lh_location .lh-filters-row--main,
  body.taxonomy-lh_difficulty .lh-filters-row--main,
  body.tax-lh_difficulty .lh-filters-row--main,
  body.taxonomy-lh_type .lh-filters-row--main,
  body.tax-lh_type .lh-filters-row--main{
    grid-template-columns: 1fr;
  }
}

/* noUiSlider card content */
body.taxonomy-lh_location .lh-f-item,
body.tax-lh_location .lh-f-item,
body.taxonomy-lh_difficulty .lh-f-item,
body.tax-lh_difficulty .lh-f-item,
body.taxonomy-lh_type .lh-f-item,
body.tax-lh_type .lh-f-item{
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

body.taxonomy-lh_location .lh-f-label,
body.tax-lh_location .lh-f-label,
body.taxonomy-lh_difficulty .lh-f-label,
body.tax-lh_difficulty .lh-f-label,
body.taxonomy-lh_type .lh-f-label,
body.tax-lh_type .lh-f-label{
  font-size: .95rem;
  color: var(--text);
}

body.taxonomy-lh_location .lh-range-values,
body.tax-lh_location .lh-range-values,
body.taxonomy-lh_difficulty .lh-range-values,
body.tax-lh_difficulty .lh-range-values,
body.taxonomy-lh_type .lh-range-values,
body.tax-lh_type .lh-range-values{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}

/* Results section */
#lh-results{
  min-width: 0;
}

.lh-results-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.lh-results-count{
  color: var(--muted);
}

.lh-results-count strong{
  color: var(--text);
}

/* Search input on all-hikes/taxonomies */
#lhAllSearch{
  min-width: 240px;
}

@media (max-width: 640px){
  #lhAllSearch{
    min-width: 0;
    width: 100%;
  }

  body.taxonomy-lh_location .lh-filterbar,
  body.tax-lh_location .lh-filterbar,
  body.taxonomy-lh_difficulty .lh-filterbar,
  body.tax-lh_difficulty .lh-filterbar,
  body.taxonomy-lh_type .lh-filterbar,
  body.tax-lh_type .lh-filterbar{
    flex-direction: column;
    align-items: stretch;
  }

  body.taxonomy-lh_location .lh-filterbar-right,
  body.tax-lh_location .lh-filterbar-right,
  body.taxonomy-lh_difficulty .lh-filterbar-right,
  body.tax-lh_difficulty .lh-filterbar-right,
  body.taxonomy-lh_type .lh-filterbar-right,
  body.tax-lh_type .lh-filterbar-right{
    flex-direction: column;
    align-items: stretch;
  }
}
@media (min-width: 1200px){
  body.lh-all-hikes-page .container{
    max-width: 1280px;
  }
}

/* All hikes – same card width as homepage */
body.lh-all-hikes-page .nearby-grid{
  display: grid !important;
  gap: 16px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 1100px){
  body.lh-all-hikes-page .nearby-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px){
  body.lh-all-hikes-page .nearby-grid{
    grid-template-columns: 1fr !important;
  }
}
body.lh-all-hikes-page .lh-all-hikes-shell{
  padding-top: 16px;
  padding-bottom: 16px;
}
/* Favorites – same grid as taxonomy/all hikes */
body.lh-favorites-page .nearby-grid{
  display: grid !important;
  gap: 16px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 1100px){
  body.lh-favorites-page .nearby-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px){
  body.lh-favorites-page .nearby-grid{
    grid-template-columns: 1fr !important;
  }
}