/* =========================================================
   HIMAL TRAILS NEPAL — pages.css
   Page-specific layouts. Home page first; other pages are
   appended in later steps (always as a complete file).
   ========================================================= */

/* ---------- Shared helpers for page layouts ---------- */
.section-head--split {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: var(--sp-4) var(--sp-6);
  max-width: none;
}
.section-head--split > div { max-width: 720px; }

/* Swipeable row on phones, grid on desktop */
.snap-row {
  display: flex; gap: var(--sp-4);
  margin-inline: calc(var(--gutter) * -1);
  padding: 0 var(--gutter) var(--sp-4);
  overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.snap-row::-webkit-scrollbar { display: none; }
.snap-row > * { flex: 0 0 min(78%, 340px); scroll-snap-align: start; }
.snap-row--wide > * { flex-basis: min(86%, 420px); }

@media (min-width: 900px) {
  .snap-row {
    display: grid; gap: var(--sp-5); overflow: visible;
    margin-inline: 0; padding: 0;
  }
  .snap-row > * { flex: none; }
}

/* ---------- Trek card additions ---------- */
.trek-card__summary { max-width: 48ch; font-size: 0.9375rem; color: var(--text-muted); }
.trek-card--lead .trek-card__title { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem); }

/* =========================================================
   HOME — Hero
   ========================================================= */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 100vh; min-height: 100svh;
  padding-top: calc(var(--header-h) + 3rem);
  background: var(--ink); color: var(--text-light);
}
.hero__bg {
  position: absolute; inset: -15% 0; z-index: -2;
  will-change: transform;
  transform: translate3d(0, var(--py, 0px), 0);
}
.hero__bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 55% 45%;
  animation: hero-zoom 18s var(--ease-out) both;
}
html.has-preloader .hero__bg img { animation: none; transform: scale(1.12); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom,
    rgba(14, 26, 34, 0.55) 0%, rgba(14, 26, 34, 0.12) 38%, rgba(14, 26, 34, 0.86) 100%);
}
@keyframes hero-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }

.hero__content { padding-bottom: clamp(2.5rem, 7vh, 5rem); }
.hero h1 {
  max-width: 15ch; margin-top: var(--sp-4);
  font-size: var(--fs-h1); font-weight: 400; line-height: 1.02; letter-spacing: -0.02em;
}
.hero h1 em { font-style: italic; color: var(--ochre-light); }
.hero__lead {
  max-width: 46ch; margin-top: var(--sp-5);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: var(--text-light-muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
@media (max-width: 519px) { .hero__actions .btn { width: 100%; } }

.hero__foot {
  border-top: 1px solid var(--line-light); padding-block: var(--sp-4);
  font-size: 0.8125rem; color: var(--text-light-muted);
}
.hero__foot .container { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.hero__caption { max-width: calc(100% - 8rem); }
.hero__scroll { display: none; align-items: center; gap: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; font-size: 0.6875rem; }
.hero__scroll::after {
  content: ""; width: 1px; height: 36px; background: currentColor;
  transform-origin: top; animation: cue 2.4s var(--ease-io) infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@media (min-width: 720px) {
  .hero__caption { max-width: none; }
  .hero__scroll { display: inline-flex; }
}

/* =========================================================
   HOME — Stats strip
   ========================================================= */
.stats { padding-block: var(--sp-7); border-bottom: 1px solid var(--line); }
.stats__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6) var(--sp-5); }
.stat { padding-left: var(--sp-4); border-left: 1px solid var(--line); }
.stat__value {
  display: block; font-family: var(--font-head); line-height: 1;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
}
.stat__label { display: block; margin-top: 0.5rem; font-size: var(--fs-small); color: var(--text-muted); }
@media (min-width: 800px) {
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
  .stat { padding-left: var(--sp-5); }
}

/* =========================================================
   HOME — Featured treks (asymmetric)
   ========================================================= */
.featured__grid { display: grid; gap: var(--sp-7) var(--sp-6); }
.featured__grid .trek-card__media { aspect-ratio: 4 / 3; }
.featured__grid .trek-card--lead .trek-card__media { aspect-ratio: 4 / 5; }

@media (min-width: 900px) {
  .featured__grid {
    grid-template-columns: 1.25fr 1fr;
    grid-template-areas: "lead a" "lead b";
    align-items: start; gap: var(--sp-7) 4rem;
  }
  .featured__grid > :nth-child(1) { grid-area: lead; }
  .featured__grid > :nth-child(2) { grid-area: a; }
  .featured__grid > :nth-child(3) { grid-area: b; }
  .featured__grid .trek-card__media { aspect-ratio: 3 / 2; }
}

/* =========================================================
   HOME — Destinations band
   ========================================================= */
.dest-band .dest-card { aspect-ratio: 3 / 4.2; }
@media (min-width: 900px) {
  .dest-band { grid-template-columns: repeat(5, 1fr); align-items: start; padding-bottom: 3.5rem; }
  .dest-band .dest-card:nth-child(even) { margin-top: 3.5rem; }
}

/* =========================================================
   HOME — Why us
   ========================================================= */
.why__grid { display: grid; gap: var(--sp-7); }
.why__media { position: relative; }
.why__media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius);
}
.why__badge {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem;
  padding: var(--sp-4) var(--sp-5); border-radius: var(--radius);
  background: var(--snow); color: var(--ink);
  box-shadow: 0 18px 40px rgba(14, 26, 34, 0.18);
}
.why__badge strong { display: block; font-family: var(--font-head); font-size: 1.25rem; font-weight: 500; }
.why__badge span { display: block; margin-top: 0.25rem; font-size: var(--fs-small); color: var(--text-muted); }

.why-item {
  display: grid; grid-template-columns: 3rem 1fr; gap: var(--sp-3);
  padding-block: var(--sp-5); border-top: 1px solid var(--line);
}
.why-item:last-child { border-bottom: 1px solid var(--line); }
.why-item__num { font-family: var(--font-head); font-size: 1.125rem; color: var(--ochre-dark); }
.why-item h3 { font-size: 1.5rem; }
.why-item p { margin-top: var(--sp-2); color: var(--text-muted); max-width: 52ch; }

@media (min-width: 900px) {
  .why__grid { grid-template-columns: 5fr 6fr; gap: 6rem; align-items: start; }
  .why__media { position: sticky; top: calc(var(--header-h) + 2rem); }
  .why__badge { left: -2rem; right: auto; bottom: 2.5rem; max-width: 270px; }
}

/* =========================================================
   HOME — Process
   ========================================================= */
.process { display: grid; }
.step { position: relative; padding: 0 0 var(--sp-7) 3.5rem; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 1.1rem; top: 2.5rem; bottom: 0.25rem;
  width: 1px; background: var(--line-light);
}
.step:last-child::before { display: none; }
.step__num {
  position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border: 1px solid var(--ochre-light); border-radius: 50%;
  font-family: var(--font-head); font-size: 0.9rem; color: var(--ochre-light);
}
.step h3 { font-size: 1.375rem; padding-top: 0.2rem; }
.step p { margin-top: var(--sp-2); color: var(--text-light-muted); font-size: 0.9375rem; }

@media (min-width: 900px) {
  .process { grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
  .step { padding: 3.75rem 0 0; }
  .step::before {
    left: 2.75rem; right: calc(var(--sp-6) * -1); top: 1.1rem; bottom: auto;
    width: auto; height: 1px;
  }
  .step h3 { padding-top: 0; }
}

/* =========================================================
   HOME — Testimonials
   ========================================================= */
@media (min-width: 900px) {
  .testimonials { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .testimonials > :nth-child(2) { margin-top: 2.5rem; }
}
.testimonial__link { color: var(--ochre-dark); font-weight: 700; }
.testimonial__link:hover { text-decoration: underline; }

/* =========================================================
   HOME — Photo mosaic
   ========================================================= */
.mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.mosaic__item {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 1; border-radius: var(--radius); background: var(--ink-soft);
}
.mosaic__item:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.mosaic__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.mosaic__item:hover img { transform: scale(1.06); }
.mosaic__cap { display: none; }

@media (min-width: 900px) {
  .mosaic { grid-template-columns: repeat(12, 1fr); grid-auto-rows: clamp(70px, 9vw, 120px); gap: 0.75rem; }
  .mosaic__item, .mosaic__item:first-child { aspect-ratio: auto; grid-column: auto; }
  .mosaic__item:nth-child(1) { grid-column: 1 / span 5; grid-row: span 4; }
  .mosaic__item:nth-child(2) { grid-column: 6 / span 3; grid-row: span 2; }
  .mosaic__item:nth-child(3) { grid-column: 9 / span 4; grid-row: span 3; }
  .mosaic__item:nth-child(4) { grid-column: 6 / span 3; grid-row: span 2; }
  .mosaic__item:nth-child(5) { grid-column: 9 / span 4; grid-row: span 1; }
  .mosaic__cap {
    position: absolute; inset: auto 0 0 0; z-index: 1; display: block;
    padding: 2rem 1rem 0.9rem; font-size: 0.8125rem; color: var(--text-light);
    background: linear-gradient(to top, rgba(14, 26, 34, 0.8), transparent);
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  }
  .mosaic__item:hover .mosaic__cap,
  .mosaic__item:focus-visible .mosaic__cap { opacity: 1; transform: none; }
}