/* =========================================
   HOME PAGE
   ========================================= */

.lh-home{
  display: grid;
  gap: 28px;
}

/* Optional: keep section spacing consistent */
.lh-home-section{
  width: 100%;
}

/* =========================================
   HERO
   ========================================= */

body.home .lh-home-hero{
  position: relative;
  width: 100%;
  min-height: 680px;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

body.home .lh-home-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.18),
    rgba(0,0,0,.10),
    rgba(0,0,0,.34)
  );
  z-index: 1;
  pointer-events: none;
}

body.home .lh-home-hero__inner{
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  padding: 26px;
  border-radius: 20px;
  background: rgba(255,255,255,.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}

body.home .lh-home-hero__title{
  margin: 0 0 14px;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.04;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0,0,0,.28);
}

/* =========================================
   SEARCH
   ========================================= */

body.home .lh-home-search{
  display: grid;
  gap: 10px;
}

body.home .lh-home-search__row{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

body.home .lh-home-search__input{
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

body.home .lh-home-search__btn{
  height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

body.home .lh-home-search__btn:hover{
  background: var(--accent-600);
}

/* =========================================
   QUICK PICKS
   ========================================= */

body.home .lh-hero-picks{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

body.home .lh-hero-chip{
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,.05);
  white-space: nowrap;
}

body.home .lh-hero-chip:hover{
  background: #fff;
  text-decoration: none;
}

/* =========================================
   CTA
   ========================================= */

body.home .lh-home-hero__cta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* =========================================
   SECTION TITLES
   ========================================= */

body.home .lh-home-h2{
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.05;
  font-weight: 900;
  color: var(--text);
}

body.home .lh-home-muted{
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

body.home .lh-link-strong{
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

body.home .lh-link-strong:hover{
  text-decoration: underline;
}

/* =========================================
   POPULAR HIKES
   ========================================= */

body.home .nearby-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.home .nearby-card{
  border-radius: 18px;
  overflow: hidden;
}

body.home .nearby-card .nearby-thumb{
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

body.home .overlay-info{
  padding: 12px 12px 10px;
}

body.home .overlay-title{
  font-size: 1rem;
}

body.home .nearby-info{
  padding: 12px;
}

body.home .nearby-info .nstats,
body.home .nstats{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.home .nstat--full{
  padding: 8px;
  border-radius: 12px;
}

body.home .nstat--full .ico{
  width: 34px;
  height: 34px;
}

body.home .nstat--full .ntext .label{
  font-size: .8rem;
}

body.home .nstat--full .ntext .value{
  font-size: .95rem;
}

/* =========================================
   MAP PREVIEW
   ========================================= */

body.home .lh-home-map-preview-wrap{
  position: relative;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 420px;
}

body.home .lh-home-preview-map{
  width: 100%;
  height: 420px;
}

body.home .lh-home-map-preview-link{
  position: absolute;
  inset: 0;
  z-index: 3;
}

body.home .lh-home-map-cover__overlay{
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  max-width: 520px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(17,24,39,.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
}

body.home .lh-home-map-cover__title{
  margin: 0 0 6px;
  font-size: 1.8rem;
  line-height: 1.05;
  font-weight: 900;
}

body.home .lh-home-map-cover__sub{
  margin: 0 0 10px;
  color: rgba(255,255,255,.9);
}

body.home .lh-home-map-cover__cta{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}

body.home .lh-home-map-cover__cta:hover{
  text-decoration: underline;
}

/* =========================================
   LOCATIONS
   ========================================= */

body.home .lh-home-locations{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.home .lh-loc-card{
  display: block;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

body.home .lh-loc-card:hover{
  text-decoration: none;
}

body.home .lh-loc-card__media{
  position: relative;
  overflow: hidden;
}

body.home .lh-loc-card__img,
body.home .lh-loc-card__ph{
  width: 100%;
  height: 210px;
  display: block;
}

body.home .lh-loc-card__img{
  object-fit: cover;
}

body.home .lh-loc-card__ph{
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(37,99,235,.08));
}

body.home .lh-loc-card__body{
  padding: 14px 16px 16px;
}

body.home .lh-loc-card__name{
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

body.home .lh-loc-card__meta{
  margin-top: 4px;
  color: var(--muted);
  font-size: .95rem;
}

/* =========================================
   LATEST NEWS
   ========================================= */

body.home .lh-news-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

body.home .lh-news-card{
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

body.home .lh-news-card__media{
  display: block;
  text-decoration: none;
}

body.home .lh-news-card__img,
body.home .lh-news-card__ph{
  width: 100%;
  height: 230px;
  display: block;
}

body.home .lh-news-card__img{
  object-fit: cover;
}

body.home .lh-news-card__ph{
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(37,99,235,.08));
}

body.home .lh-news-card__body{
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 16px 16px;
}

body.home .lh-news-card__title{
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 800;
}

body.home .lh-news-card__title a{
  color: var(--text);
  text-decoration: none;
}

body.home .lh-news-card__title a:hover{
  text-decoration: underline;
}

body.home .lh-news-card__text{
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

body.home .lh-news-card__actions{
  margin-top: auto;
  padding-top: 14px;
}



/* =========================================
   LARGE DESKTOP
   ========================================= */

@media (min-width: 1200px){
  body.home .container{
    max-width: 1280px;
  }
}

/* =========================================
   TABLET
   ========================================= */

@media (max-width: 1100px){
  body.home .nearby-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home .lh-home-locations{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home .lh-news-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px){
  body.home .lh-home{
    gap: 24px;
  }

  body.home .lh-home-hero{
    min-height: 620px;
    padding: 18px;
  }

  body.home .lh-home-hero__inner{
    width: 100%;
    max-width: 100%;
    padding: 20px;
  }

  body.home .lh-home-hero__title{
    font-size: clamp(32px, 6vw, 46px);
  }

  body.home .lh-home-preview-map{
    height: 360px;
  }

  body.home .lh-home-map-preview-wrap{
    min-height: 360px;
  }
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 640px){
  body.home .lh-home{
    gap: 22px;
  }

  body.home .lh-home-hero{
    min-height: 75vh;
    padding: 14px;
    border-radius: 18px;
    align-items: flex-end;
  }

  body.home .lh-home-hero__inner{
    width: 100%;
    max-width: 100%;
    padding: 16px;
    border-radius: 16px;
  }

  body.home .lh-home-hero__title{
    font-size: 30px;
  }

  body.home .lh-home-search__row{
    grid-template-columns: 1fr;
  }

  body.home .lh-home-search__btn{
    width: 100%;
  }

  body.home .lh-home-hero__cta{
    flex-direction: column;
  }

  body.home .lh-home-hero__cta .lh-btn{
    width: 100%;
  }

  body.home .lh-hero-picks{
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  body.home .lh-hero-chip{
    flex: 0 0 auto;
  }

  body.home .nearby-grid{
    grid-template-columns: 1fr;
  }

  body.home .lh-home-locations{
    grid-template-columns: 1fr;
  }

  body.home .lh-home-preview-map{
    height: 300px;
  }

  body.home .lh-home-map-preview-wrap{
    min-height: 300px;
  }

  body.home .lh-home-map-cover__overlay{
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    padding: 14px 16px;
    border-radius: 14px;
  }

  body.home .lh-home-map-cover__title{
    font-size: 1.35rem;
  }
}
body.home .lh-home-section--hero{
  padding-top: 0;
  padding-bottom: 0;
}

body.home .lh-home-section--hero .lh-home-hero{
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin: 0 !important;
}

body.home .lh-home-section--hero .lh-home-hero__inner{
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  padding: 24px;
}

/* =========================================
   HOME MOBILE WIDTH FIXES
   ========================================= */

@media (max-width: 640px){

  /* stop horizontal overflow on homepage */
  body.home,
  body.home .lh-home,
  body.home .lh-home-section,
  body.home .container{
    overflow-x: clip;
  }

  /* allow children to actually shrink */
  body.home .lh-home *,
  body.home .nearby-grid > *,
  body.home .lh-home-locations > *,
  body.home .lh-news-grid > *{
    min-width: 0;
  }

  /* make hero fully fit inside viewport */
  body.home .lh-home-hero{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 68vh;
    padding: 12px;
  }

  body.home .lh-home-hero__inner{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px;
    overflow: hidden;
  }

  body.home .lh-home-hero__title{
    font-size: clamp(26px, 7vw, 32px);
    line-height: 1.08;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* search row must never push width */
  body.home .lh-home-search,
  body.home .lh-home-search__row{
    width: 100%;
    min-width: 0;
  }

  body.home .lh-home-search__input,
  body.home .lh-home-search__btn{
    width: 100%;
    min-width: 0;
  }

  /* chips can scroll horizontally without stretching page */
  body.home .lh-hero-picks{
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  body.home .lh-hero-chip{
    flex: 0 0 auto;
    max-width: 80vw;
  }

  /* CTA buttons stack cleanly */
  body.home .lh-home-hero__cta{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }

  body.home .lh-home-hero__cta .lh-btn{
    width: 100%;
    min-width: 0;
  }

  /* map preview overlay must stay inside */
  body.home .lh-home-map-preview-wrap,
  body.home .lh-home-preview-map{
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.home .lh-home-map-cover__overlay{
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 12px 14px;
  }

  body.home .lh-home-map-cover__title{
    font-size: 1.2rem;
    line-height: 1.15;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  body.home .lh-home-map-cover__sub{
    overflow-wrap: anywhere;
  }

  /* cards/images must not force overflow */
  body.home .nearby-card,
  body.home .lh-loc-card,
  body.home .lh-news-card{
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.home .nearby-card .nearby-thumb,
  body.home .lh-loc-card__img,
  body.home .lh-news-card__img{
    width: 100%;
    max-width: 100%;
  }

  /* section headings/text can wrap safely */
  body.home .lh-home-h2,
  body.home .lh-home-muted{
    overflow-wrap: anywhere;
  }
}

/* Keep homepage hero below fixed header */
body.home .lh-home-section--hero,
body.home .lh-home-hero{
  margin-top: 24px;
}

@media (max-width: 640px){
  body.home .lh-home-section--hero,
  body.home .lh-home-hero{
    margin-top: 12px;
  }
}