/* Homepage: editorial spread on desktop, single column on a phone. */

.home { display: block; }

/* ── Hero ──────────────────────────────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: minmax(400px, 40%) 1fr;
  align-items: center;
  min-height: min(calc(100svh - var(--header-h)), 860px);
}
.home-hero-copy { padding: 40px clamp(28px, 3vw, 56px) 40px clamp(24px, 4vw, 72px); max-width: 640px; }
.home-hero-copy .eyebrow { margin-bottom: 18px; }
.home-hero-copy h1 { font-size: clamp(42px, 4.5vw, 66px); letter-spacing: -.028em; text-wrap: balance; }
.home-hero-copy .lede { margin: 22px 0 28px; max-width: 42ch; font-size: 16.5px; }
.home-hero-cta { height: 52px; padding: 0 28px; font-size: 15px; }

.quick-links { display: flex; flex-wrap: wrap; gap: 10px 34px; margin-top: 42px; }
.quick-links a { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; padding: 6px 2px; }
.quick-links .ico { width: 26px; height: 26px; stroke-width: 1.45; }
.quick-links b { display: block; font-size: var(--text-xs); font-weight: 700; }
.quick-links small { display: block; font-size: var(--text-xs); color: var(--ink-muted); }
@media (hover: hover) { .quick-links a:hover b { color: var(--orange-text); } }

.home-hero-media { position: relative; align-self: stretch; min-height: 420px; }
.home-hero-photo { position: absolute; inset: 0; }
.home-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 54% center; }
.home-hero-note { position: absolute; top: clamp(24px, 5vw, 64px); right: clamp(20px, 3vw, 48px); max-width: 290px; }
.home-hero-place { position: absolute; right: clamp(20px, 3vw, 48px); bottom: 28px; }
.home-hero-media .photo-credit { left: auto; right: 20px; bottom: 74px; }

/* ── Featured routes ───────────────────────────────────────────── */
.home-featured { padding: clamp(56px, 6vw, 92px) 0 clamp(50px, 5vw, 80px); }
.home-featured > * { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 42%); gap: 20px 40px;
  align-items: end; margin-bottom: 34px;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head-aside { display: flex; align-items: center; justify-content: flex-end; gap: 26px; }
.section-head-aside p { max-width: 46ch; font-size: var(--text-base); line-height: 1.6; color: var(--ink); text-align: right; }
.section-head-aside .button { flex: none; }

.route-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }

.route-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper-bright); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s;
}
@media (hover: hover) { .route-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); } }
.route-card-media { display: grid; grid-template-columns: 1fr 0.78fr; gap: 1px; background: var(--line); }
.route-card-photo { display: block; height: 100%; min-height: 150px; }
.route-card-photo img { height: 100%; }
.route-card-map { display: block; position: relative; background: #eef2e6; }
.route-card-map .route-preview { width: 100%; height: 100%; }
.route-card-media { position: relative; }
.route-card-level { position: absolute; left: 6px; top: 6px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: var(--paper-bright); border: 1px solid var(--line); font-size: var(--text-xs); font-weight: 700; color: var(--ink-soft); }
.route-card-map.is-empty { display: grid; place-items: center; padding: 10px; text-align: center; }
.route-card-map.is-empty span { font-size: var(--text-xs); line-height: 1.4; color: var(--ink-muted); }
.route-card-body { display: flex; flex-direction: column; gap: 9px; padding: 16px 17px 18px; }
.route-card-title { font-family: var(--serif); font-size: 19.5px; font-weight: 700; line-height: 1.15; }
.route-card-place { font-size: var(--text-xs); color: var(--ink-muted); margin-top: -4px; }
.route-card-metrics { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 2px; }
.route-card-metrics span { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); font-weight: 600; color: var(--ink-soft); }
.route-card-metrics .ico { width: 15px; height: 15px; color: var(--orange-text); }
.route-card-metrics .is-unmeasured { font-weight: 500; color: var(--ink-muted); }
.route-card-metrics .is-unmeasured .ico { color: var(--ink-muted); }
.route-card-terrain { display: flex; align-items: center; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.route-card-terrain small { font-size: var(--text-xs); line-height: 1.3; color: var(--ink-muted); }
.route-card .text-link { margin-top: 2px; font-size: var(--text-xs); }
.route-card .text-link .ico { width: 15px; height: 15px; }

/* Route preview SVG (shared with other pages) */
.route-preview { display: block; }
.rp-line-case { fill: none; stroke: rgb(var(--white-rgb) / 95%); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.rp-line { fill: none; stroke: #2f6cb5; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rp-ground { fill: var(--preview-ground); }
.rp-tiles { pointer-events: none; }
.rp-tile { opacity: 0.82; filter: saturate(0.75); }
.rp-credit { opacity: 0; fill: var(--ink); font: 600 9px/1 var(--sans); paint-order: stroke; stroke: rgb(var(--white-rgb) / 80%); stroke-width: 2px; }
.has-tiles .rp-credit { opacity: 1; }
.rp-grid { stroke: rgb(var(--ink-rgb) / 7%); }
.rp-pin { fill: var(--orange); stroke: var(--white); stroke-width: 1.8; }
.rp-num { fill: var(--white); font: 700 9.5px/1 var(--sans); text-anchor: middle; }

/* Elevation SVG (shared) */
.elevation-svg { display: block; width: 100%; }
.ep-area { fill: rgba(111, 129, 86, .22); }
.ep-line { fill: none; stroke: var(--sage); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ep-stem { stroke: rgba(18, 41, 74, .22); stroke-width: 1; stroke-dasharray: 2 2; }
.ep-pin { fill: var(--orange); stroke: var(--white); stroke-width: 1.6; }
.ep-num { fill: var(--white); font: 700 9px/1 var(--sans); text-anchor: middle; }
.ep-axis { fill: var(--ink-muted); font: 500 9.5px/1 var(--sans); }
.elevation-svg.is-spark { height: 34px; width: 110px; flex: none; }
.elevation-svg.is-spark .ep-line { stroke-width: 1.8; }
.elevation-svg.is-spark .ep-area { fill: rgba(111, 129, 86, .3); }

/* ── Voices and languages ──────────────────────────────────────── */
.home-voices {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) minmax(0, .95fr);
  background: var(--ink-deep); color: rgba(247, 242, 232, .9);
}
.voices-copy { padding: clamp(44px, 4vw, 70px) clamp(24px, 3vw, 50px) clamp(44px, 4vw, 70px) clamp(24px, 4vw, 64px); }
.voices-copy h2 { color: var(--paper); margin: 14px 0 18px; }
.voices-copy p { font-size: var(--text-base); line-height: 1.65; color: rgba(247, 242, 232, .82); max-width: 40ch; margin-bottom: 26px; }
.home-voices .eyebrow, .home-voices .text-link { color: var(--orange-on-dark); }
.voices-languages .eyebrow { color: var(--orange-text); }
.voices-panel { display: flex; flex-direction: column; gap: 18px; padding: clamp(44px, 4vw, 70px) clamp(24px, 3vw, 44px); border-left: 1px solid rgba(247, 242, 232, .12); border-right: 1px solid rgba(247, 242, 232, .12); }
.voices-open { padding: 22px 24px; border: 1px solid rgba(247, 242, 232, .16); border-radius: var(--radius); background: rgba(247, 242, 232, .05); }
.voices-open h3 { margin: 10px 0 10px; font-size: 22px; color: var(--paper); }
.voices-note { font-size: var(--text-sm); line-height: 1.6; color: rgba(247, 242, 232, .8); margin-bottom: 14px; }
.voices-roles { display: grid; gap: 14px; }
.voices-roles li { display: flex; align-items: center; gap: 13px; }
.voices-roles .ico { width: 22px; height: 22px; color: var(--orange-on-dark); }
.voices-roles b { display: block; font-size: 15.5px; color: var(--paper); }
.voices-roles small { font-size: var(--text-xs); color: rgba(247, 242, 232, .78); }

.voices-languages {
  padding: clamp(44px, 4vw, 70px) clamp(24px, 4vw, 60px);
  background: var(--paper-deep); color: var(--ink);
}
.voices-languages h2 { margin: 14px 0 16px; font-size: clamp(27px, 2.4vw, 38px); }
.voices-languages > p { font-size: 16.5px; line-height: 1.62; color: var(--ink); max-width: 38ch; }
.language-list { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0 26px; }
.language-list li {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--paper-bright); font-size: var(--text-sm); font-weight: 600;
}
.language-list .is-more { border-style: dashed; color: var(--ink-muted); font-weight: 500; }
.voices-languages .note-plain { font-size: 26px; color: var(--ink-soft); }

/* ── Magazine strip ────────────────────────────────────────────── */
.home-experience {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr) minmax(0, .8fr);
  gap: clamp(26px, 3vw, 54px); align-items: center;
  padding: clamp(50px, 5vw, 86px) clamp(24px, 4vw, 64px);
  background: var(--paper-deep);
}
.experience-copy h2 { margin: 14px 0 16px; font-size: clamp(28px, 2.7vw, 40px); text-wrap: balance; }
.experience-copy p { font-size: 16.5px; line-height: 1.65; color: var(--ink); max-width: 40ch; margin-bottom: 24px; }
.experience-strip { position: relative; display: flex; justify-content: center; gap: 14px; padding: 10px 0; }
.magazine-page {
  position: relative; width: min(31%, 230px); border-radius: 4px; overflow: hidden;
  background: var(--paper-bright); box-shadow: var(--shadow-md);
  transform: rotate(calc((var(--index) - 1.5) * .9deg)) translateY(calc(var(--index) * -4px));
  transition: transform .25s;
}
@media (hover: hover) { .magazine-page:hover { transform: rotate(0deg) translateY(-10px); z-index: 2; } }
.magazine-page .photo img { aspect-ratio: 3 / 4; }
.magazine-page-copy { padding: 12px 13px 15px; }
.magazine-index { font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; color: var(--orange-text); }
.magazine-page h3 { margin: 7px 0 5px; font-size: var(--text-base); line-height: 1.2; }
.magazine-page p { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

.experience-points { display: grid; gap: 20px; }
.experience-points li { display: flex; align-items: flex-start; gap: 13px; }
.experience-points .ico { width: 23px; height: 23px; margin-top: 2px; }
.experience-points b { display: block; font-size: 15.5px; }
.experience-points small { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

/* ── Tablet ────────────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .route-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-voices { grid-template-columns: 1fr 1fr; }
  .voices-languages { grid-column: 1 / -1; }
  .home-experience { grid-template-columns: 1fr 1fr; }
  .experience-strip { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 1023px) {
  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .home-hero-copy { order: 2; padding: 34px 24px 40px; }
  .home-hero-media { order: 1; min-height: 58vh; }
  .home-hero-photo { position: relative; }
  .home-hero-photo.torn-left { -webkit-mask-image: none; mask-image: none; }
  .home-hero-note { max-width: 240px; top: 20px; right: 16px; padding: 13px 17px 15px; }
  .home-hero-note .script { font-size: var(--text-md); }
  .section-head { grid-template-columns: 1fr; }
  .section-head-aside { justify-content: space-between; }
  .section-head-aside p { text-align: left; }
}

/* ── Phone: the pocket guide composition ───────────────────────── */
@media (max-width: 639px) {
  /* The photo no longer pushes the headline and the main button below the first screen. */
  .home-hero-media { height: 36svh; min-height: 240px; overflow: hidden; }
  .home-hero-photo { height: 100%; }
  .home-hero-copy { padding: 28px 20px 34px; }
  .home-hero-copy h1 { font-size: clamp(40px, 12vw, 58px); }
  .home-hero-copy .lede { font-size: var(--text-base); margin: 16px 0 22px; }
  .home-hero-cta { width: 100%; }
  .quick-links { margin-top: 30px; justify-content: space-between; gap: 14px; }
  .quick-links a { flex: 1; min-width: 70px; }
  .home-hero-note { display: none; }

  .home-featured { padding: 46px 0 40px; }
  .home-featured > * { width: calc(100% - 32px); }
  .section-head-aside { flex-direction: column; align-items: flex-start; gap: 14px; }
  .route-card-grid { grid-template-columns: 1fr; gap: 16px; }
  .route-card-media { grid-template-columns: 1.35fr 1fr; }
  .route-card-photo img { aspect-ratio: 3 / 2; }

  .home-voices { grid-template-columns: 1fr; }
  .voices-panel { border: 0; border-top: 1px solid rgba(247, 242, 232, .12); padding: 32px 20px; }
  .voices-copy { padding: 40px 20px 26px; }
  .voices-languages { padding: 36px 20px 44px; }

  .home-experience { grid-template-columns: 1fr; padding: 44px 20px 54px; }
  .experience-strip { order: 2; gap: 8px; }
  .magazine-page { width: 46%; }
  .magazine-page:nth-child(n+3) { display: none; }
  .experience-points { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .route-card, .magazine-page { transition: none; }
  .route-card:hover, .magazine-page:hover { transform: none; }
}

/* ── Intro video and route-tracker picture (content/visuals.json) ─── */
.home-video, .home-how { width: min(1100px, calc(100% - 32px)); margin: 56px auto; }
.home-video video { display: block; width: 100%; height: auto; margin-top: 18px; border-radius: var(--radius); background: var(--ink-deep); }
.home-how img { display: block; width: 100%; height: auto; margin-top: 18px; border-radius: var(--radius); }

/* The hero mosaic: the Hampi photograph keeps its place; the featured routes' photographs sit beside it, each a link. */
.home-hero-main { position: relative; min-height: inherit; }
@media (min-width: 640px) { .home-hero-media.has-mosaic { display: grid; grid-template-columns: minmax(0, 1fr) clamp(96px, 14%, 168px); gap: 6px; } }
.home-mosaic { display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }
.home-mosaic-tile { position: relative; display: block; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-deep); }
.home-mosaic-tile .photo, .home-mosaic-tile picture, .home-mosaic-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-mosaic-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; font-weight: 700; line-height: 1.15; color: var(--white); background: linear-gradient(to top, rgba(12, 28, 51, .8), rgba(12, 28, 51, 0)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .home-mosaic-tile:hover { border-color: var(--orange); } }
.home-mosaic-tile:focus-visible { outline: 2px solid var(--orange-text); outline-offset: 2px; }
/* A phone: the photograph keeps its fixed height and the four tiles run in a row beneath it. */
@media (max-width: 639px) {
  .home-hero-media.has-mosaic { height: auto; overflow: visible; }
  .home-hero-main { height: 28svh; min-height: 168px; overflow: hidden; }
  .home-mosaic { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-auto-rows: auto; height: 52px; margin-top: 4px; }
  .home-mosaic-name { display: none; }
}
