/* =====================================================================================================
   Phones and small tablets. Loaded LAST, so nothing written for wide screens can override it.
   Every multi-column layout collapses here; keep new desktop grids inside @media (min-width: 981px).
   Rules: one column, body text 16 px or more, labels 11 px or more, touch targets about 44 px, no sideways page scroll,
   maps never trap the page scroll (two fingers move them).
   ===================================================================================================== */
.menu-btn { display: none; }
.btn.btn-text { padding-left: 0; padding-right: 0; border-radius: 0; }
.card .ar { line-height: 1.5; margin-bottom: 8px; }

/* the full-page map: its buttons were dark on dark */
.fm-layers .chip { background: rgba(12, 12, 12, .78); color: #fff; border-color: rgba(255, 255, 255, .35); }
.fm-layers .chip .muted { color: inherit; opacity: .7; }
.fm-layers .chip[aria-pressed="true"] { background: #fff; color: #0e0e0e; border-color: #fff; }
.fm-search input { background: rgba(255, 255, 255, .96); color: #0e0e0e; border: 0; }
.fm-search input::placeholder { color: #6a6a66; }

/* jump links on the history page */
.area-nav { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; }
.area-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--hair-2); border-radius: 999px; font: 500 15px/1.2 var(--f-body); }
.area-h { scroll-margin-top: 90px; }

/* the card a phone shows over the map when a trail is picked */
.pick { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; color: inherit; margin-right: 34px; }
.pick img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; }
.pick b { display: block; font: 600 21px/1.05 var(--f-display); text-transform: uppercase; border-bottom: 3px solid var(--c); padding-bottom: 6px; }
.pick .ar { display: block; font-size: 15px; line-height: 1.6; margin-top: 4px; color: #2c2c2a; }
.pick em { display: block; font: 500 13px/1.4 var(--f-body); font-style: normal; color: #55554f; margin-top: 2px; }
.map-note .pick-go { width: 100%; justify-content: center; margin-top: 12px; height: 46px; }

@media (max-width: 980px) {
  /* ---------- menu */
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--linen); cursor: pointer; }
  .menu-btn svg { width: 28px; height: 28px; overflow: visible; }
  .menu-btn path { stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; transition: transform .25s var(--ease), opacity .2s; transform-origin: 14px 14px; }
  .nav.open .menu-btn path:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .menu-btn path:nth-child(2) { opacity: 0; }
  .nav.open .menu-btn path:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav nav { position: absolute; top: 100%; left: 0; right: 0; background: #0e0e0e; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .25s var(--ease), visibility 0s .25s; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
  .nav.open nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nav.open:not(.solid) { background: #0e0e0e; }
  .nav nav ul { display: block; padding: 6px var(--pad) 16px; }
  .nav ul li, .nav ul li:not(.keep) { display: block; }
  .nav nav li a { display: flex; align-items: center; min-height: 56px; padding: 0; border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, .16); color: #fff; font: 600 24px/1 var(--f-display); text-transform: uppercase; }
  .nav nav li:last-child a { border-bottom: 0; }
  .nav nav li a[aria-current] { box-shadow: none; color: var(--blaze); }

  /* ---------- one column everywhere */
  .intro, .route, .her-body, .doc, .her-entry, .top-grid, .terrain-facts, .foot-cols, .her-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-body, .area-notes, .route-tx, .her-tx { columns: auto; }
  .gtk { position: static; }
  .doc-nav { position: static; display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; border: 0; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 4px; }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav li { flex: none; }
  .doc-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--hair-2); border-radius: 999px; font: 500 14px/1 var(--f-body); letter-spacing: 0; text-transform: none; white-space: nowrap; }

  /* ---------- swipe rows instead of long stacks */
  .accordion, .her-rail { display: flex; flex-direction: row; gap: 10px; height: auto; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--pad); scrollbar-width: none; overscroll-behavior-x: contain; }
  .accordion::-webkit-scrollbar, .her-rail::-webkit-scrollbar { display: none; }
  .her-rail { margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
  .acc, .accordion .acc:hover, .accordion:not(:hover) .acc:first-child, .accordion:hover .acc { flex: 0 0 min(72vw, 320px); height: 320px; scroll-snap-align: start; }
  .acc h3, .accordion .acc:hover h3, .accordion:not(:hover) .acc:first-child h3 { font-size: 32px; line-height: 1; }
  .acc .acc-cap p, .accordion .acc:hover p, .accordion:not(:hover) .acc:first-child p { display: block !important; font-size: 15px; line-height: 1.4; margin: 8px 0 0; color: #fff; }
  .her-card { flex: 0 0 min(78vw, 360px); scroll-snap-align: start; }
  .foot-links a { display: flex; align-items: center; min-height: 44px; }
  .chip, .filters .chip, .fm-layers .chip { min-height: 40px; }
  .maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
}

@media (max-width: 900px) {
  /* ---------- front page: the map first, its trail cards under it, then the photo */
  .front { display: flex; flex-direction: column; height: auto; min-height: 0; scroll-margin-top: 60px; }
  .mapside { order: 1; height: 62svh; min-height: 400px; }
  .stripbar { order: 2; border-bottom: 1px solid var(--hair); }
  .film { order: 3; height: 70svh; min-height: 480px; }
  .map-tools { top: 10px; left: 10px; right: 10px; gap: 8px; }
  .at-search input { height: 46px; font-size: 16px; }
  .at-layers { width: 100%; scrollbar-width: none; } .at-layers::-webkit-scrollbar { display: none; }
  .at-layers .chip { height: 40px; padding: 0 15px; font-size: 14px; }
  .map-hint { left: 10px; bottom: 10px; font-size: 11px; letter-spacing: .04em; }
  .map-note { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 14px; max-height: calc(100% - 120px); }
  .map-note .fm-x { width: 40px; height: 40px; }
  .filters-row { gap: 8px; padding-top: 12px; padding-bottom: 10px; }
  .filters-row .chip { height: 40px; padding: 0 16px; font-size: 14px; }
  .strip-arrows { display: none; }
  .strip { padding-top: 6px; padding-bottom: 18px; }
  .tcard { width: 168px; height: 112px; } .tcard-in b { font-size: 14px; } .tcard-in em { font-size: 11px; letter-spacing: 0; } .tcard-in svg { display: none; }
  .film-title { display: none; }
  .film-facts span { font-size: 11px; letter-spacing: .04em; }
}

@media (max-width: 700px) {
  :root { --pad: 18px; }
  .sec { padding: 52px 0; }
  .label { letter-spacing: .05em; font-size: 11.5px; line-height: 1.45; }
  .lede { font-size: 17px; line-height: 1.55; }
  .mega, .mega.sm, .h2, .display { line-height: 1; letter-spacing: -.005em; }
  .mega, .display { font-size: clamp(40px, 12vw, 56px); }
  .mega.sm, .h2 { font-size: clamp(32px, 9.2vw, 44px); }
  .sec-head { gap: 14px; margin-bottom: 24px; }
  .btn { height: 48px; }
  .chip { min-height: 40px; }
  input[type="search"] { font-size: 16px !important; }          /* below 16 px an iPhone zooms the page in */
  .page-head { padding: 96px 0 28px; }
  main > section[style*="padding:140px"] { padding: 96px 0 20px !important; }

  /* front page */
  .marquee.top { padding: 8px 0 7px; } .marquee.top span { font-size: 20px; }
  .top-grid { gap: 16px; } .top-grid .mega { font-size: clamp(40px, 12.4vw, 56px); max-width: none; margin-top: 10px; }
  .top-grid .lede { font-size: 16.5px; }
  .top-grid .bignums { display: grid; grid-template-columns: auto auto auto; justify-content: space-between; gap: 10px; padding-top: 14px; }
  .top-grid .bignums > div { display: block; } .top-grid .bignums b { font-size: 30px; }
  .top-grid .bignums .label { margin-top: 5px; font-size: 11px; }
  .accordion-sec .mega.sm { font-size: 32px; }
  .tiles { gap: 10px; } .tile .label { font-size: 11px; } .tile .cap h3 { font-size: 27px; line-height: 1; }
  .wall-sec { height: 620px; } .wall-over { left: var(--pad); right: var(--pad); } .wall-over .lede { margin: 16px 0 22px; }
  .wall span { display: none; }
  .rail { grid-auto-columns: min(74vw, 300px); }

  /* trail cards, two to a row */
  .grid .card .label { font-size: 11px; letter-spacing: 0; text-transform: none; }
  .grid .card .cap h3 { font-size: 20px; line-height: 1.05; overflow-wrap: anywhere; }
  .grid .card .facts { font-size: 11.5px; letter-spacing: 0; }
  .grid .card .ar { font-size: 14px; margin: 0 0 4px; }

  /* trail page */
  .hk-hero { min-height: 86svh; padding-top: 90px; }
  .hk-hero::after { background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .05) 22%, rgba(0, 0, 0, .42) 48%, rgba(0, 0, 0, .8) 100%); }
  .hk-title { font-size: clamp(38px, 11.6vw, 56px); line-height: .98; max-width: none; }
  .hk-ar { font-size: 27px; } .hk-local { font-size: 16px; margin-top: 6px; }
  .tagline { font-size: 18px; margin-top: 12px; }
  .facts-bar { margin-top: 20px; column-gap: 12px; grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .facts-bar .v { font-size: 22px; } .facts-bar .label { font-size: 11px; letter-spacing: 0; }
  .hk-ridge-cap { display: none; }
  .hk-tabs a { display: flex; align-items: center; min-height: 46px; padding: 0 12px; font-size: 12px; letter-spacing: .04em; }
  .verdict { font-size: 21px; } .cta { display: grid; gap: 10px; } .cta .btn { width: 100%; justify-content: center; }
  .meters > div { grid-template-columns: 92px minmax(0, 1fr); }
  .route-tx { margin-top: 18px; } .route-tx p, .her-tx p, .doc-sec p, .doc-sec li, .her-entry p, .area-notes p { font-size: 16.5px; line-height: 1.62; }
  .terrain { height: 60svh; min-height: 380px; } .tbar .btn { height: 44px; }
  .climbs { width: 100%; font-size: 13px; }
  .plan-cell { padding: 20px 18px; } .plan-cell p { font-size: 16px; }
  .hl-tx h3 { font-size: 28px; line-height: 1.02; } .hl-n { font-size: 48px; }
  .hl-marker { width: 36px; height: 36px; line-height: 32px; }
  .gallery { columns: 2 120px; column-gap: 8px; } .gallery button { margin-bottom: 8px; }
  .lb img { max-width: 100vw; max-height: calc(100svh - 190px); } .lb .cap { left: 16px; right: 16px; bottom: 16px; }

  /* history, safety, terms, by date */
  .area-h { font-size: 40px; line-height: 1; margin-top: 52px; }
  .her-entry { gap: 18px; } .her-entry h3 { font-size: 30px; }
  .doc { gap: 28px; } .doc-sec h2 { font-size: 31px; line-height: 1.04; }
  .doc-sec, #walk, #highlights, #terrain, #route, #story, #gallery, #plan, #history { scroll-margin-top: 112px; }
  .numbers { grid-template-columns: 1fr 1fr; } .numbers > div { min-width: 0; padding: 14px; } .numbers b { font-size: 44px; } .numbers .label { overflow-wrap: anywhere; }
  .src { font-size: 12px; overflow-wrap: anywhere; } .src a { display: inline-block; padding: 5px 0; }
  .year { padding: 34px 0; gap: 10px; } .year .yr { font-size: 72px; }
  .row .ar { display: block; margin: 2px 0 0; }

  /* footer */
  .foot { padding: 48px 0 56px; }
  .foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .foot .big { font-size: 14.5vw; min-width: 0; }
  .foot-links { grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .foot-links a { display: flex; align-items: center; min-height: 48px; padding: 0; font-size: 15px; }
  .foot .note { font-size: 14px; }
}

/* a finger has no hover: nothing should stay enlarged or lifted after a tap */
@media (hover: none) {
  .tcard:hover { transform: none; } .tcard.on { transform: translateY(-4px); }
  .tcard:hover img, .acc:hover img, .her-card:hover img, .hl-ph:hover img, .gallery button:hover img { transform: none; }
}

/* the card over the map is white but sits inside the dark map scope: give its button its own colours */
.map-note .btn-primary { background: #0e0e0e; color: #fff; }
.map-note .btn-primary:hover { background: var(--blaze); color: #fff; }

/* a phone on its side: too short for full-screen pictures, so they grow with their text */
@media (max-height: 560px) and (max-width: 980px) {
  .hk-hero { height: auto; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 92px; }
  .hk-hero .in { position: relative; inset: auto; padding-bottom: 96px; }
  .hk-title { font-size: 52px; line-height: 1; } .hk-ar { font-size: 26px; } .hk-ridge { height: 70px; } .hk-ridge-cap, .reel-cap { display: none; }
  .mapside { height: 86svh; min-height: 300px; } .film { height: auto; min-height: 420px; }
  .terrain { height: 84svh; min-height: 280px; }
}
