/*
 * Explore pages (Phase C): activity / model course / map area / summit /
 * map-area activities detail pages and the /maps, /activities list pages.
 * Builds on the v2 tokens and component library in /css/site.css; only
 * page-family rules live here. Breakpoints 600 / 960 / 1280 (1440 maps).
 */

/* =====================================================================
 * Shared detail-page building blocks
 * ===================================================================== */

:where(.site) .ex-page { padding-bottom: var(--sp-7); }
/* Page scripts toggle sections with the hidden attribute; component display rules must not win. */
:where(.site) .ex-page [hidden] { display: none !important; }
:where(.site) .ex-page .breadcrumb { margin-top: var(--sp-4); }
:where(.site) .ex-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-2); }
:where(.site) .ex-chips .chip { min-height: 28px; padding: 2px 10px; font-size: var(--fs-xs); font-weight: 700; }
:where(.site) .chip--moss { background: var(--c-moss-100); color: var(--c-forest-700); border-color: transparent; }
:where(.site) .chip--dark { background: var(--c-forest-900); color: #fff; border-color: transparent; }
:where(.site) .ex-h1 { margin: 0 0 var(--sp-2); font-size: var(--fs-2xl); font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
:where(.site) .ex-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-3); color: var(--c-text-2); font-size: var(--fs-sm); }
:where(.site) .ex-sub .icon { color: var(--c-forest-500); }
:where(.site) .ex-sub > span > .icon { margin-right: 4px; }

:where(.site) .ex-section { margin-top: var(--sp-7); scroll-margin-top: calc(var(--site-header-h) + 16px); }
:where(.site) .ex-section[hidden] { display: none; }
:where(.site) .ex-h2 {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-xl);
  font-weight: 800;
}
:where(.site) .ex-h2 .icon { color: var(--c-forest-500); }
:where(.site) .ex-h2 small { margin-left: auto; font-size: var(--fs-sm); font-weight: 400; color: var(--c-muted); }
:where(.site) .ex-h3 { margin: var(--sp-5) 0 var(--sp-3); font-size: var(--fs-lg); font-weight: 800; }
:where(.site) .ex-text { white-space: pre-wrap; line-height: 1.85; color: var(--c-text); overflow-wrap: anywhere; }
:where(.site) .ex-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
:where(.site) .ex-note { margin: var(--sp-3) 0 0; font-size: var(--fs-xs); color: var(--c-muted); line-height: 1.6; }
:where(.site) .ex-panel { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); background: var(--c-bg-2); }
:where(.site) .ex-panel + .ex-panel { margin-top: var(--sp-3); }
:where(.site) .ex-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
:where(.site) .ex-actions .btn { min-height: 40px; padding: 8px 16px; font-size: var(--fs-sm); }
:where(.site) .ex-actions .btn .icon { color: currentColor; }
:where(.site) .btn--following { background: var(--c-moss-100); border-color: var(--c-moss-100); color: var(--c-forest-700); }
:where(.site) .ex-state { padding: var(--sp-8) var(--sp-4); }
:where(.site) .ex-state[hidden] { display: none; }
:where(.site) .ex-loading { display: grid; gap: var(--sp-4); padding-block: var(--sp-5); }
:where(.site) .ex-loading .skeleton--hero { aspect-ratio: 21 / 9; border-radius: var(--r-lg); }
:where(.site) .ex-loading .skeleton--line { height: 1.2em; width: 60%; }

/* Author row with follow / report on the right. */
:where(.site) .ex-author { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
:where(.site) .ex-author .author-row { font-size: var(--fs-base); }
:where(.site) .ex-author .avatar { width: 44px; height: 44px; }
:where(.site) .ex-author .ex-actions { margin-left: auto; }

/* Course-constant gauge ("儀表"): value + labelled scale with a marker. */
:where(.site) .ex-gauge { display: grid; gap: var(--sp-2); }
:where(.site) .ex-gauge__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); }
:where(.site) .ex-gauge__title { font-weight: 800; }
:where(.site) .ex-gauge__note { font-size: var(--fs-xs); color: var(--c-muted); }
:where(.site) .ex-gauge__value { text-align: right; line-height: 1.1; }
:where(.site) .ex-gauge__value b { display: block; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.5rem); font-weight: 800; color: var(--c-forest-700); white-space: nowrap; }
:where(.site) .ex-gauge__value span { font-size: var(--fs-xs); font-weight: 700; color: var(--c-text-2); }
:where(.site) .ex-gauge__bar {
  position: relative;
  height: 10px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--c-moss-300) 0%, var(--c-forest-500) 35%, var(--c-trail-500) 70%, var(--c-danger) 100%);
}
:where(.site) .ex-gauge__bar i {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--c-forest-900);
  box-shadow: var(--shadow-1);
  transform: translateY(-50%);
}
:where(.site) .ex-gauge__scale { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--c-muted); }
:where(.site) .ex-gauge + .ex-gauge { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--c-rock-200); }

/* Key / value list (map info, activity info). */
:where(.site) .ex-kv { margin: 0; padding: 0; list-style: none; }
:where(.site) .ex-kv > li, :where(.site) .ex-kv > div {
  display: grid;
  grid-template-columns: minmax(96px, 30%) minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-line);
  font-size: var(--fs-sm);
}
:where(.site) .ex-kv > :last-child { border-bottom: 0; }
:where(.site) .ex-kv .k { color: var(--c-muted); font-weight: 700; }
:where(.site) .ex-kv .v { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
:where(.site) .ex-kv .v .chip { min-height: 26px; padding: 0 10px; margin: 0 6px 6px 0; font-size: var(--fs-xs); }

/* Segmented control (chart axis, lap distance). */
:where(.site) .ex-seg {
  display: inline-flex;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  margin-bottom: var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--c-bg-2);
  overflow-x: auto;
  scrollbar-width: none;
}
:where(.site) .ex-seg button {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
:where(.site) .ex-seg button.active, :where(.site) .ex-seg button.on, :where(.site) .ex-seg button[aria-pressed="true"] {
  background: #fff;
  color: var(--c-forest-700);
  box-shadow: var(--shadow-1);
}

/* Maps (Mapbox) and canvas charts. */
:where(.site) .ex-map {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--c-moss-100) url("/images/brand/contour.svg") center / 360px auto;
  box-shadow: var(--shadow-1);
}
:where(.site) .ex-map .mapboxgl-canvas { cursor: default; }
:where(.site) .ex-map .mapboxgl-ctrl-group { border-radius: var(--r-sm); box-shadow: var(--shadow-1); }
:where(.site) .ex-map .mapboxgl-ctrl-group button { width: 36px; height: 36px; }
:where(.site) .ex-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c-forest-700);
  color: #fff;
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
:where(.site) .ex-map-btn.off, :where(.site) .ex-map-btn.plain { background: #fff; color: var(--c-rock-600); }
:where(.site) .ex-map-btn svg { width: 20px; height: 20px; }
:where(.site) .ex-chart { position: relative; padding: var(--sp-3); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) .ex-chart canvas { display: block; width: 100%; }

/* Photo grid + lightbox. */
:where(.site) .ex-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 600px) { :where(.site) .ex-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } }
:where(.site) .ex-photos > :first-child { grid-column: span 2; grid-row: span 2; }
:where(.site) .ex-photos img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--c-moss-100);
  cursor: zoom-in;
  transition: filter var(--dur-1) var(--ease);
}
:where(.site) .ex-photos img:hover { filter: brightness(1.06); }
:where(.site) .ex-photos-more { margin-top: var(--sp-3); }
.ex-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 46, 34, .94);
}
.ex-lightbox.open { display: flex; }
.ex-lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: var(--r-sm); }
.ex-lightbox button {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.ex-lightbox button:hover { background: rgba(255, 255, 255, .28); }
.ex-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ex-lightbox .lb-close { top: 16px; right: 16px; }
.ex-lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.ex-lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.ex-lightbox .lb-count { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: rgba(255, 255, 255, .85); font: 700 14px/1 var(--font-num); }

/* Sticky in-page TOC (model course). */
:where(.site) .ex-toc { padding: var(--sp-4); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); font-size: var(--fs-sm); }
:where(.site) .ex-toc b { display: block; margin-bottom: var(--sp-2); color: var(--c-text); }
:where(.site) .ex-toc ol { margin: 0; padding: 0; list-style: none; }
:where(.site) .ex-toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--sp-3);
  border-left: 3px solid var(--c-rock-200);
  color: var(--c-text-2);
  font-weight: 700;
  text-decoration: none;
}
:where(.site) .ex-toc a:hover, :where(.site) .ex-toc a.is-active { border-left-color: var(--c-forest-500); color: var(--c-forest-700); background: var(--c-moss-100); }
:where(.site) .ex-toc a[hidden] { display: none; }

/* Accordion (transport / access). */
:where(.site) .ex-acc { border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); overflow: hidden; }
:where(.site) .ex-acc + .ex-acc { margin-top: var(--sp-3); }
:where(.site) .ex-acc > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-4);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
:where(.site) .ex-acc > summary::-webkit-details-marker { display: none; }
:where(.site) .ex-acc > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border: solid var(--c-rock-600); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform var(--dur-1) var(--ease); }
:where(.site) .ex-acc[open] > summary::after { transform: rotate(-135deg); }
:where(.site) .ex-acc > summary .icon { color: var(--c-forest-500); }
:where(.site) .ex-acc__body { padding: 0 var(--sp-4) var(--sp-4); }
:where(.site) .ex-acc__item { padding: var(--sp-3) 0; border-top: 1px solid var(--c-rock-100); }
:where(.site) .ex-acc__item b { font-size: var(--fs-sm); }
:where(.site) .ex-acc__item p { margin: 4px 0 0; color: var(--c-text-2); font-size: var(--fs-sm); line-height: 1.7; white-space: pre-wrap; }

/* Highlight cards (model course). */
:where(.site) .ex-hl .media { aspect-ratio: 16 / 9; }
:where(.site) .ex-hl .tcard__text { -webkit-line-clamp: 6; white-space: pre-wrap; }

/* Cards rows used on detail pages. */
:where(.site) .ex-cards { --cols: 3; }
:where(.site) .ex-cards--4 { --cols: 4; }
:where(.site) .ex-cards--2 { --cols: 2; }
:where(.site) .card-summit .media__caption small { font-size: .5em; }
/* Scroll row that stays a horizontal strip on desktop too (4 cards visible). */
@media (min-width: 960px) {
  :where(.site) .scroll-row.ex-hscroll {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 3 * var(--sp-4)) / 4);
    overflow-x: auto;
    padding: var(--sp-1) var(--sp-1) var(--sp-3);
    margin-inline: calc(-1 * var(--sp-1));
  }
}

/* =====================================================================
 * Weather (summit + map area)
 * ===================================================================== */

:where(.site) .ex-sun { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
:where(.site) .ex-sun > div { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--c-trail-100); }
:where(.site) .ex-sun > div + div { background: var(--c-moss-100); }
:where(.site) .ex-sun .icon { width: 28px; height: 28px; color: var(--c-trail-600); }
:where(.site) .ex-sun > div + div .icon { color: var(--c-forest-700); }
:where(.site) .ex-sun .lbl { font-size: var(--fs-xs); color: var(--c-text-2); }
:where(.site) .ex-sun .val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 800; line-height: 1.2; }
:where(.site) .monthChartWrap { position: relative; padding: var(--sp-3) var(--sp-2) var(--sp-2); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) #monthChart { display: block; width: 100%; height: 180px; cursor: pointer; }
:where(.site) .monthLegend { display: flex; justify-content: flex-end; gap: var(--sp-4); padding-right: 4px; margin-top: 6px; font-size: var(--fs-xs); color: var(--c-text-2); }
:where(.site) .monthLegend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: middle; }
:where(.site) .monthLegend .hi::before { background: var(--c-trail-500); }
:where(.site) .monthLegend .lo::before { background: var(--c-info); }
:where(.site) .monthNote { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--c-muted); }
:where(.site) #monthTip { position: absolute; top: 8px; left: 50%; z-index: 2; display: none; padding: 4px 10px; border-radius: var(--r-sm); background: var(--c-forest-900); color: #fff; font-size: var(--fs-xs); white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
:where(.site) .wxBlock { margin-top: var(--sp-5); }
:where(.site) .wxTitle { margin-bottom: var(--sp-3); font-size: var(--fs-lg); font-weight: 800; }
:where(.site) .wxTitle .sub { font-size: var(--fs-sm); font-weight: 400; color: var(--c-muted); }
:where(.site) .wxNote { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--c-muted); line-height: 1.6; }
:where(.site) .wxScroll { overflow-x: auto; padding-bottom: var(--sp-2); }
:where(.site) .dailyRow.weather-strip { grid-auto-columns: minmax(84px, 1fr); }
:where(.site) .dailyCard .dDate { font-size: var(--fs-xs); color: var(--c-text-2); white-space: nowrap; }
:where(.site) .dailyCard .dIcon { width: 40px; height: 40px; object-fit: contain; }
:where(.site) .dailyCard .dTemps { display: flex; gap: 6px; font-family: var(--font-num); font-weight: 800; }
:where(.site) .dailyCard .dHi { color: var(--c-trail-600); }
:where(.site) .dailyCard .dLo { color: var(--c-info); }
:where(.site) .dailyCard .dPop { color: var(--c-info); font-size: var(--fs-xs); font-weight: 700; }
:where(.site) .hourlyWrap { display: flex; align-items: stretch; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); overflow: hidden; }
:where(.site) .hourlyLabels { flex: none; width: 56px; padding-top: 14px; border-right: 1px solid var(--c-line); background: var(--c-bg-2); font-size: var(--fs-xs); color: var(--c-text-2); }
:where(.site) .hourlyLabels div { display: flex; align-items: center; height: 36px; padding-left: 8px; border-bottom: 1px solid var(--c-line); }
:where(.site) .hourlyLabels .lblTime { height: 22px; font-weight: 700; }
:where(.site) .hourlyScroll { flex: 1; overflow-x: auto; padding-bottom: 6px; }
:where(.site) .hourlyRow { display: flex; min-width: max-content; }
:where(.site) .hourCol { flex: none; width: 52px; text-align: center; font-size: var(--fs-xs); font-family: var(--font-num); font-variant-numeric: tabular-nums; }
:where(.site) .hourCol .hDay { height: 14px; font-size: 10px; line-height: 14px; color: var(--c-muted); }
:where(.site) .hourCol .hTime { height: 22px; line-height: 22px; font-weight: 800; border-bottom: 1px solid var(--c-line); }
:where(.site) .hourCol .hCell { display: flex; align-items: center; justify-content: center; height: 36px; border-bottom: 1px solid var(--c-line); }
:where(.site) .hourCol .hWind { gap: 2px; color: var(--c-info); }
:where(.site) .hourCol .windArr { display: inline-block; line-height: 1; transform-origin: center; }
/* CWA forecast module (markup injected by /js/cwa-weather.js). */
:where(.site) #cwaBlock .cwaBand { padding: var(--sp-4); border-radius: var(--r-md); background: var(--c-bg-2); }
:where(.site) #cwaBlock .cwaChip { background: var(--c-forest-700); border-radius: var(--r-pill); padding: 2px 8px; }
:where(.site) #cwaBlock .cwaSecTitle .t { font-size: var(--fs-lg); color: var(--c-text); }
:where(.site) #cwaBlock .cwa7col { border-radius: var(--r-md); }
:where(.site) #cwaBlock .cwaBasisToggle { display: inline-flex; align-items: center; min-height: 32px; color: var(--c-link); }

/* =====================================================================
 * activity.html
 * ===================================================================== */

:where(.site) .ex-act { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
:where(.site) .ex-act__main { min-width: 0; }
:where(.site) .ex-act__cover { margin: 0 calc(-1 * var(--gutter)); overflow: hidden; aspect-ratio: 16 / 9; max-height: 360px; background: var(--c-moss-100); }
:where(.site) .ex-act__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(.site) .ex-act__mapcol { order: -1; margin: 0 calc(-1 * var(--gutter)); }
:where(.site) .ex-act__mapcol .ex-map { border-radius: 0; box-shadow: none; }
:where(.site) #mapContainer { width: 100%; height: 240px; transition: height var(--dur-2) var(--ease); }
:where(.site) .ex-act__mapcol.is-expanded #mapContainer { height: min(70vh, 520px); }
:where(.site) .ex-act__mapbar { display: flex; justify-content: center; padding: var(--sp-2) var(--gutter) 0; }
:where(.site) .ex-act__mapbar button { min-height: 36px; }
:where(.site) #trackCanvas { display: block; width: 100%; border-radius: var(--r-md); background: var(--c-moss-100); }
:where(.site) .ex-act .stat-hero { margin-top: var(--sp-5); }
:where(.site) .ex-act .elev-wrap { margin-top: var(--sp-5); }
@media (min-width: 600px) {
  :where(.site) .ex-act__cover { margin: 0; border-radius: var(--r-lg); }
}
@media (min-width: 960px) {
  :where(.site) .ex-act { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-7); align-items: start; }
  :where(.site) .ex-act__mapcol { order: 0; margin: 0; position: sticky; top: calc(var(--site-header-h) + var(--sp-4)); }
  :where(.site) .ex-act__mapcol .ex-map { border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
  :where(.site) #mapContainer, :where(.site) .ex-act__mapcol.is-expanded #mapContainer { height: calc(100vh - var(--site-header-h) - 120px); min-height: 420px; max-height: 760px; }
  :where(.site) .ex-act__mapbar { display: none; }
}

:where(.site) .ex-act:not(.has-map) { grid-template-columns: minmax(0, 1fr); max-width: 880px; }
:where(.site) .ex-act:not(.has-map) .ex-act__mapcol { display: none; }
:where(.site) .ex-act.has-map .ex-act__cover { display: none; }
:where(.site) .ex-act__social { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
:where(.site) .ex-act__social .reaction-bar { flex-wrap: wrap; }
:where(.site) .ex-act__social button.ex-linkbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 6px; border: 0; background: none; color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
:where(.site) .ex-act__social button.ex-linkbtn:hover { color: var(--c-forest-700); }
:where(.site) .ex-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: var(--sp-3) 0 0; padding: 0; list-style: none; border-radius: var(--r-md); overflow: hidden; background: var(--c-line); border: 1px solid var(--c-line); }
:where(.site) .ex-stats > li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); background: #fff; font-size: var(--fs-sm); }
:where(.site) .ex-stats .k { color: var(--c-muted); }
:where(.site) .ex-stats .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
:where(.site) .ex-stats .v small { margin-left: 2px; font-weight: 700; color: var(--c-text-2); }
@media (min-width: 600px) { :where(.site) .ex-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } :where(.site) .ex-stats > li { display: grid; gap: 2px; } }
:where(.site) .ex-stats-toggle { margin-top: var(--sp-2); }

/* Activity timeline rows (course time) built on the v2 .timeline. */
:where(.site) .ex-day { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); padding-bottom: var(--sp-3); margin-bottom: var(--sp-4); border-bottom: 2px solid var(--c-forest-700); }
:where(.site) .ex-day .d { font-size: var(--fs-lg); font-weight: 900; }
:where(.site) .ex-day .kv { font-size: var(--fs-sm); color: var(--c-text-2); }
:where(.site) .ex-day .kv b { font-family: var(--font-num); font-size: var(--fs-base); color: var(--c-text); }
:where(.site) .timeline__item .timeline__dot.is-poi { display: grid; place-items: center; width: 26px; height: 26px; margin-top: -2px; border: 0; color: #fff; font-size: 13px; line-height: 1; }
:where(.site) .timeline__item .timeline__dot.is-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
:where(.site) .timeline__time small { display: block; font-weight: 400; color: var(--c-muted); }
:where(.site) .timeline__name { overflow-wrap: anywhere; }

/* Photo / rest markers on activity & route maps. */
.trk-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.trk-marker svg { width: 14px; height: 14px; fill: currentColor; }
.trk-photo { background: var(--c-forest-900); color: #fff; }
.trk-rest { background: #fff; color: var(--c-trail-600); }
.ex-pin-se { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; color: #fff; font: 800 12px/1 var(--font-num); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ex-pin-se--s { background: var(--c-forest-500); }
.ex-pin-se--g { background: var(--c-trail-500); }
.ex-scrub-dot { width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: var(--c-trail-500); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
:where(.site) .map-ctrls { position: absolute; left: 12px; top: 50%; z-index: 5; display: flex; flex-direction: column; gap: 8px; transform: translateY(-50%); }
:where(.site) .pace-toggle { position: absolute; right: 12px; bottom: 12px; z-index: 5; }

/* =====================================================================
 * model-course.html, map-area.html, summit.html heroes
 * ===================================================================== */

:where(.site) .ex-hero { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--c-forest-900); color: #fff; isolation: isolate; }
:where(.site) .ex-hero__img { display: block; width: 100%; height: clamp(240px, 42vw, 460px); object-fit: cover; }
:where(.site) .ex-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(11, 46, 34, .1) 30%, rgba(11, 46, 34, .85) 100%); pointer-events: none; }
:where(.site) .ex-hero__txt { position: absolute; left: var(--sp-5); right: var(--sp-5); bottom: var(--sp-5); z-index: 2; pointer-events: none; }
:where(.site) .ex-hero__txt h1 { margin: var(--sp-2) 0 4px; color: #fff; font-size: var(--fs-2xl); font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
:where(.site) .ex-hero__txt .ex-sub { color: rgba(255, 255, 255, .9); }
:where(.site) .ex-hero__txt .ex-sub .icon { color: var(--c-moss-300); }
:where(.site) .ex-hero__dots { position: absolute; right: var(--sp-4); bottom: var(--sp-4); z-index: 3; display: flex; gap: 6px; }
:where(.site) .ex-hero__dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .5); cursor: pointer; }
:where(.site) .ex-hero__dots i.on { background: #fff; }
:where(.site) .ex-hero__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 46, 34, .55);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
:where(.site) .ex-hero__nav[hidden] { display: none; }
:where(.site) .ex-hero__prev { left: var(--sp-3); }
:where(.site) .ex-hero__next { right: var(--sp-3); }
@media (max-width: 599px) {
  :where(.site) .ex-hero { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
  :where(.site) .ex-hero__txt { left: var(--gutter); right: var(--gutter); bottom: var(--sp-4); }
  :where(.site) .ex-hero__dots { bottom: auto; top: var(--sp-3); }
}

/* Model course: TOC (chip row on phones, sticky column ≥ 1280) + content. */
:where(.site) .ex-mc { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); margin-top: var(--sp-5); }
:where(.site) .ex-mc__main { min-width: 0; }
:where(.site) .ex-mc .ex-toc { padding: 0; background: none; box-shadow: none; }
:where(.site) .ex-mc .ex-toc b { display: none; }
:where(.site) .ex-mc .ex-toc ol { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
:where(.site) .ex-mc .ex-toc li { flex: none; }
:where(.site) .ex-mc .ex-toc a { min-height: 40px; padding: 0 14px; border: 1px solid var(--c-line); border-radius: var(--r-pill); background: #fff; white-space: nowrap; }
@media (min-width: 1280px) {
  :where(.site) .ex-mc { grid-template-columns: minmax(0, 1fr) 232px; gap: var(--sp-7); align-items: start; }
  :where(.site) .ex-mc__aside { order: 2; position: sticky; top: calc(var(--site-header-h) + var(--sp-4)); }
  :where(.site) .ex-mc .ex-toc { padding: var(--sp-4); background: #fff; box-shadow: var(--shadow-1); }
  :where(.site) .ex-mc .ex-toc b { display: block; }
  :where(.site) .ex-mc .ex-toc ol { display: block; margin: 0; padding: 0; }
  :where(.site) .ex-mc .ex-toc a { border: 0; border-left: 3px solid var(--c-rock-200); border-radius: 0; background: none; }
  :where(.site) .ex-mc .ex-toc a:hover, :where(.site) .ex-mc .ex-toc a.is-active { border-left-color: var(--c-forest-500); background: var(--c-moss-100); }
}
:where(.site) .ex-mapchart { display: grid; gap: var(--sp-4); }
:where(.site) #cmap { width: 100%; height: clamp(300px, 70vw, 440px); }
@media (min-width: 960px) {
  :where(.site) .ex-mapchart { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: stretch; }
  :where(.site) .ex-mapchart .ex-chart { display: flex; flex-direction: column; justify-content: center; }
}
:where(.site) .ex-mapchart .ex-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:where(.site) .ex-map.is-nogl #cmap { height: 200px; }
:where(.site) #phPop {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 6;
  display: none;
  width: 300px;
  max-width: 84%;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: rgba(11, 46, 34, .94);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-3);
  transform: translateX(-50%);
}
:where(.site) #phPop .idx, :where(.site) #phPop .when { font: 700 var(--fs-xs)/1.6 var(--font-num); }
:where(.site) #phPop .imgrow { display: flex; align-items: center; gap: 4px; margin: 6px 0; }
:where(.site) #phPop img { flex: 1; min-width: 0; max-height: 180px; object-fit: contain; border-radius: var(--r-sm); background: #000; }
:where(.site) #phPop button { min-width: 36px; min-height: 44px; border: 0; background: none; color: #fff; font-size: 22px; cursor: pointer; }
:where(.site) #phPop .x { position: absolute; top: 2px; right: 4px; min-height: 36px; font-size: 15px; }
:where(.site) #phPop .cap { max-height: 48px; overflow: hidden; color: var(--c-moss-300); font-size: var(--fs-xs); }

/* Summit hero: big altitude number. */
:where(.site) .ex-alt { display: block; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: clamp(2.75rem, 2rem + 4vw, 5rem); font-weight: 900; line-height: 1; letter-spacing: -.02em; text-shadow: 0 2px 16px rgba(0, 0, 0, .3); }
:where(.site) .ex-alt small { margin-left: 4px; font-size: .38em; font-weight: 800; }
:where(.site) .ex-hero__corner { position: absolute; top: var(--sp-4); right: var(--sp-4); z-index: 2; display: grid; justify-items: end; gap: 6px; }
:where(.site) .ex-hero__corner .chip { min-height: 28px; font-size: var(--fs-xs); font-family: var(--font-num); }

:where(.site) .ex-hero--summit .ex-hero__img { height: clamp(320px, 50vw, 540px); }
:where(.site) .ex-hero--summit .ex-hero__img[hidden] { display: none; }
:where(.site) .ex-hero--summit .ex-alt { margin-top: var(--sp-2); }
:where(.site) .ex-hero--summit h1 { margin-top: 4px; }

/* summit.html: content + facts column. */
:where(.site) .ex-sm { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); margin-top: var(--sp-5); }
:where(.site) .ex-sm__aside { display: grid; gap: var(--sp-3); align-content: start; }
:where(.site) .ex-sm__aside > .ex-panel { margin: 0; }
:where(.site) .ex-sm__main { min-width: 0; }
@media (min-width: 600px) and (max-width: 959px) {
  :where(.site) .ex-sm__aside { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: min-content; }
  :where(.site) .ex-sm__aside > * { align-self: start; }
  :where(.site) .ex-sm__aside > .ex-panel:has(.ex-kv) { grid-column: 2; grid-row: 1 / span 3; }
}
@media (min-width: 960px) {
  :where(.site) .ex-sm { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-7); align-items: start; }
  :where(.site) .ex-sm__main { grid-column: 1; grid-row: 1; }
  :where(.site) .ex-sm__aside { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--site-header-h) + var(--sp-4)); }
}
:where(.site) .ex-gauge__bar u { position: absolute; top: -5px; bottom: -5px; min-width: 16px; margin-left: -8px; padding-right: 16px; border: 3px solid var(--c-forest-900); border-radius: var(--r-pill); background: rgba(255, 255, 255, .35); box-shadow: var(--shadow-1); box-sizing: content-box; }
:where(.site) .ex-linkcard { display: flex; align-items: center; gap: var(--sp-3); min-height: 64px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--c-moss-100); color: var(--c-forest-900); text-decoration: none; }
:where(.site) .ex-linkcard[hidden] { display: none; }
:where(.site) .ex-linkcard:hover { background: var(--c-moss-300); }
:where(.site) .ex-linkcard > .icon { flex: none; width: 24px; height: 24px; color: var(--c-forest-700); }
:where(.site) .ex-linkcard span { flex: 1; min-width: 0; }
:where(.site) .ex-linkcard small { display: block; font-size: var(--fs-xs); color: var(--c-text-2); }
:where(.site) .ex-linkcard b { display: block; overflow-wrap: anywhere; }

/* Map-area hero: interactive map with a cover thumbnail card. */
:where(.site) .ex-areahero { position: relative; }
:where(.site) .ex-areahero .ex-map { border-radius: var(--r-lg); }
:where(.site) #areaMap { width: 100%; height: clamp(300px, 52vw, 520px); }
:where(.site) .ex-areahero__card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-2);
}
:where(.site) .ex-areahero__card img { width: 96px; height: 96px; border-radius: var(--r-sm); object-fit: cover; background: var(--c-moss-100); }
:where(.site) .ex-areahero__card h1 { margin: 4px 0; font-size: var(--fs-xl); font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
@media (min-width: 960px) {
  :where(.site) .ex-areahero__card {
    position: absolute;
    right: var(--sp-5);
    bottom: var(--sp-5);
    z-index: 3;
    grid-template-columns: 1fr;
    width: 320px;
    margin: 0;
    padding: 0 0 var(--sp-4);
    overflow: hidden;
  }
  :where(.site) .ex-areahero__card img { width: 100%; height: 160px; border-radius: 0; }
  :where(.site) .ex-areahero__card > div { padding: 0 var(--sp-4); }
}
:where(.site) .ex-areahero .stat-strip { margin-top: var(--sp-4); }
:where(.site) .ex-statbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
:where(.site) .ex-statbar > div { flex: 1 1 140px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) .ex-statbar .lbl { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--c-muted); }
:where(.site) .ex-statbar .lbl .icon { color: var(--c-forest-500); }
:where(.site) .ex-statbar b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 800; }
:where(.site) .ex-statbar b small { margin-left: 2px; font-size: .55em; color: var(--c-text-2); }
:where(.site) .tabs.ex-tabs { position: sticky; top: var(--site-header-h); z-index: 20; margin-top: var(--sp-6); background: rgba(255, 255, 255, .96); }
:where(.site) .ex-tabpanel[hidden] { display: none; }
@media (min-width: 1280px) {
  :where(.site) .ex-areaintro:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--sp-7); align-items: start; }
  :where(.site) .ex-areaintro > .ex-wx { margin-top: var(--sp-5); }
}
:where(.site) .ex-areahero.no-map .ex-areahero__card { position: static; width: auto; grid-template-columns: minmax(0, 1fr); margin-top: 0; padding: 0 0 var(--sp-4); overflow: hidden; }
:where(.site) .ex-areahero.no-map .ex-areahero__card img { width: 100%; height: clamp(180px, 36vw, 320px); border-radius: 0; }
:where(.site) .ex-areahero.no-map .ex-areahero__card > div { padding: 0 var(--sp-4); }
/* Summit pins on the area map (Mapbox HTML markers, anchored bottom). */
.ex-sumpin { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 44px; text-decoration: none; cursor: pointer; }
.ex-sumpin span { padding: 2px 8px; border-radius: var(--r-pill); background: #fff; box-shadow: var(--shadow-1); color: var(--c-forest-900); font: 700 12px/1.5 var(--font); white-space: nowrap; }
.ex-sumpin span b { font-family: var(--font-num); color: var(--c-trail-600); }
.ex-sumpin i { width: 0; height: 0; margin-top: 2px; border-right: 7px solid transparent; border-bottom: 11px solid var(--c-forest-700); border-left: 7px solid transparent; }
.ex-sumpin:hover span, .ex-sumpin:focus-visible span { background: var(--c-forest-900); color: #fff; }
.ex-sumpin:focus-visible { outline: 3px solid var(--c-trail-500); outline-offset: 2px; }

/* Weather forecast: collapsed to three days, hourly hidden, until expanded. */
:where(.site) .ex-wx__toggle { margin-top: var(--sp-3); }
:where(.site) .ex-wx.is-collapsed .cwa7col:nth-child(n+4),
:where(.site) .ex-wx.is-collapsed .dailyCard:nth-child(n+4),
:where(.site) .ex-wx.is-collapsed #cwaBlock .cwaSecTitle:has(+ .wxScroll .cwaRow),
:where(.site) .ex-wx.is-collapsed #cwaBlock .wxScroll:has(.cwaRow),
:where(.site) .ex-wx.is-collapsed #hourlyBlock { display: none !important; }
:where(.site) .ex-wx.is-collapsed .dailyRow.weather-strip { grid-auto-columns: minmax(96px, 160px); }

/* =====================================================================
 * /maps and /activities list pages (SSR, web_explore.js)
 * ===================================================================== */

:where(.site) .ex-list-head { padding-block: var(--sp-6) var(--sp-5); }
:where(.site) .ex-list-head h1 { margin: 0 0 var(--sp-2); font-size: var(--fs-2xl); font-weight: 900; line-height: 1.25; }
:where(.site) .ex-list-head p { margin: 0 0 var(--sp-4); max-width: 44em; color: rgba(255, 255, 255, .85); }
:where(.site) .ex-list-head .search-box { max-width: 640px; }
:where(.site) .ex-list-head .tabs { margin: var(--sp-5) 0 0; border-bottom-color: rgba(255, 255, 255, .2); }
:where(.site) .ex-list-head .tab { color: rgba(255, 255, 255, .78); }
:where(.site) .ex-list-head .tab:hover { color: #fff; }
:where(.site) .ex-list-head .tab[aria-current="page"] { color: #fff; border-bottom-color: var(--c-trail-500); }
:where(.site) .ex-list-head .breadcrumb { margin: 0 0 var(--sp-3); color: var(--c-moss-300); }
:where(.site) .ex-list-head .breadcrumb a { color: var(--c-moss-300); }

:where(.site) .ex-layout { display: grid; gap: var(--sp-5); padding-top: var(--sp-5); }
@media (min-width: 960px) {
  :where(.site) .ex-layout { grid-template-columns: 272px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
  :where(.site) .ex-layout--nofilter { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  :where(.site) .ex-layout--aside { grid-template-columns: 256px minmax(0, 1fr) 300px; }
}
:where(.site) .ex-results { min-width: 0; }
:where(.site) .ex-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
:where(.site) .ex-toolbar__count { margin-right: auto; color: var(--c-text-2); font-size: var(--fs-sm); }
:where(.site) .ex-toolbar__count b { font-family: var(--font-num); color: var(--c-text); }
:where(.site) .ex-toolbar select { min-height: 40px; padding: 0 32px 0 12px; border: 1px solid var(--c-line); border-radius: var(--r-pill); background: #fff; font-size: var(--fs-sm); }
:where(.site) .ex-filter-btn { display: inline-flex; }
@media (min-width: 960px) { :where(.site) .ex-filter-btn { display: none; } }
:where(.site) .ex-active { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
:where(.site) .ex-active .chip { min-height: 32px; }
:where(.site) .ex-active .chip .icon { width: .9em; height: .9em; }

/* View toggle (卡片格 / 動態流). */
:where(.site) .ex-view { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--c-bg-2); }
:where(.site) .ex-view a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
:where(.site) .ex-view a[aria-current="true"] { background: #fff; color: var(--c-forest-700); box-shadow: var(--shadow-1); }

/* Filter panel: sticky column on desktop, bottom sheet on phones. */
:where(.site) .ex-filters { padding: var(--sp-5); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) .ex-filters .filter-panel { gap: var(--sp-5); }
:where(.site) .ex-filters legend { display: flex; align-items: center; gap: 6px; }
:where(.site) .ex-filters legend .icon { color: var(--c-forest-500); }
:where(.site) .ex-filters .chip { min-height: 36px; cursor: pointer; }
:where(.site) .ex-filters label.chip { position: relative; }
:where(.site) .ex-filters label.chip input { position: absolute; opacity: 0; pointer-events: none; }
:where(.site) .ex-filters label.chip:has(input:checked) { background: var(--c-forest-700); border-color: var(--c-forest-700); color: #fff; }
:where(.site) .ex-filters label.chip:has(input:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 2px; }
:where(.site) .ex-filters input[type="date"], :where(.site) .ex-filters input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 16px;
}
:where(.site) .ex-filters .ex-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-2); }
:where(.site) .ex-filters .ex-dates label { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--c-muted); }
:where(.site) .ex-sheet__head, :where(.site) .ex-sheet__foot { display: none; }
:where(.site) .ex-sheet__actions { display: flex; gap: var(--sp-2); }
:where(.site) .ex-sheet__actions .btn { flex: 1; }
@media (min-width: 960px) {
  :where(.site) .ex-filters { position: sticky; top: calc(var(--site-header-h) + var(--sp-4)); max-height: calc(100vh - var(--site-header-h) - 32px); overflow-y: auto; }
  .js .ex-sheet__actions { display: none; }
}
@media (max-width: 959px) {
  .js .ex-filters {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1210;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-3);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
  }
  .js .ex-sheet-open .ex-filters { transform: none; visibility: visible; transition: transform var(--dur-2) var(--ease); }
  .js .ex-sheet__head { display: flex; align-items: center; justify-content: space-between; margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }
  .js .ex-sheet__head b { font-size: var(--fs-lg); }
  .js .ex-sheet__head button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--c-bg-2); font-size: 22px; cursor: pointer; }
  :where(.site) .ex-sheet__foot { position: sticky; bottom: calc(-1 * var(--sp-5)); display: block; margin: var(--sp-5) calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)); padding: var(--sp-3) var(--sp-5); background: #fff; border-top: 1px solid var(--c-line); }
  :where(.site) .ex-backdrop { position: fixed; inset: 0; z-index: 1205; background: rgba(11, 46, 34, .45); }
  :where(.site) .ex-backdrop[hidden] { display: none; }
}

/* Small Taiwan map above the /maps grid. */
:where(.site) .ex-twmap { margin-bottom: var(--sp-5); }
:where(.site) .ex-twmap > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: var(--shadow-1);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  width: max-content;
}
:where(.site) .ex-twmap > summary::-webkit-details-marker { display: none; }
:where(.site) .ex-twmap > summary .icon { color: var(--c-forest-500); }
:where(.site) .ex-twmap[open] > summary { margin-bottom: var(--sp-3); }
:where(.site) .ex-twmap__map { height: 260px; }
:where(.site) .ex-twmap__hint { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--c-muted); }
@media (min-width: 960px) {
  :where(.site) .ex-twmap > summary { display: none; }
  :where(.site) .ex-twmap__map { height: 300px; }
}
.ex-mappin { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: var(--c-trail-500); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: pointer; }
.ex-mappin.is-off { background: var(--c-forest-500); }
.ex-mappop { font: 700 13px/1.5 var(--font); }
.ex-mappop a { color: var(--c-forest-700); }
:where(.site) .tcard.is-flash { box-shadow: 0 0 0 3px var(--c-trail-500), var(--shadow-2); }

/* Card grids. */
:where(.site) .ex-grid { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { :where(.site) .ex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) {
  :where(.site) .ex-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  :where(.site) .ex-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1440px) { :where(.site) .ex-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
:where(.site) .ex-grid .card-route .tcard__foot { min-height: 44px; }
:where(.site) .ex-route-meta { display: flex; flex-wrap: wrap; gap: 6px; }
:where(.site) .ex-route-meta .chip { min-height: 26px; padding: 0 10px; font-size: var(--fs-xs); }

/* Feed view (動態流). */
:where(.site) .ex-feed { display: grid; gap: var(--sp-4); max-width: 680px; margin-inline: auto; }
:where(.site) .feed-item .tcard__title { font-size: var(--fs-lg); }
:where(.site) .feed-item__title a { color: inherit; text-decoration: none; }
:where(.site) .feed-item__title a:hover { text-decoration: underline; }
:where(.site) .feed-item__track svg { display: block; width: 100%; height: 100%; }
:where(.site) .feed-item__track--cover { padding: 0; overflow: hidden; }
:where(.site) .feed-item__track--cover img { width: 100%; height: 100%; object-fit: cover; }
:where(.site) .feed-item__body { display: grid; gap: var(--sp-2); min-width: 0; }
:where(.site) .feed-item__photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: var(--r-sm); overflow: hidden; }
:where(.site) .feed-item__photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
:where(.site) .feed-item .reaction-bar { padding-top: var(--sp-3); border-top: 1px solid var(--c-rock-100); }
:where(.site) .feed-item .chip { min-height: 26px; padding: 0 10px; font-size: var(--fs-xs); }
@media (min-width: 600px) { :where(.site) .feed-item__summary { grid-template-columns: 132px minmax(0, 1fr); } }

/* Pager / load more. */
:where(.site) .ex-more { display: grid; justify-items: center; gap: var(--sp-3); margin-top: var(--sp-6); }
:where(.site) .ex-more[hidden] { display: none; }
:where(.site) .ex-more .skeleton--card { width: 100%; }
:where(.site) .ex-sentinel { height: 1px; }
:where(.site) .ex-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin: var(--sp-6) 0 0; padding: 0; list-style: none; }
:where(.site) .ex-pager a, :where(.site) .ex-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-text);
  font-family: var(--font-num);
  font-weight: 700;
  text-decoration: none;
}
:where(.site) .ex-pager a:hover { border-color: var(--c-forest-700); color: var(--c-forest-700); }
:where(.site) .ex-pager [aria-current="page"] { background: var(--c-forest-700); border-color: var(--c-forest-700); color: #fff; }

/* Activities right sidebar (≥ 1280). */
:where(.site) .ex-aside { display: none; }
@media (min-width: 1280px) {
  :where(.site) .ex-aside { display: grid; gap: var(--sp-5); position: sticky; top: calc(var(--site-header-h) + var(--sp-4)); }
}
:where(.site) .ex-aside h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--sp-3); font-size: var(--fs-base); font-weight: 800; }
:where(.site) .ex-aside h2 .icon { color: var(--c-forest-500); }
:where(.site) .ex-hikers { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
:where(.site) .ex-hiker { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) .ex-hiker .avatar { width: 44px; height: 44px; }
:where(.site) .ex-hiker a.ex-hiker__name { display: block; overflow: hidden; color: var(--c-text); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
:where(.site) .ex-hiker a.ex-hiker__name:hover { text-decoration: underline; }
:where(.site) .ex-hiker small { color: var(--c-muted); font-size: var(--fs-xs); }
:where(.site) .ex-hiker .btn { min-height: 36px; padding: 4px 12px; font-size: var(--fs-xs); }
:where(.site) .ex-aside .card-community .media { aspect-ratio: 2 / 1; }
:where(.site) .ex-aside .card-community .tcard__title { font-size: var(--fs-base); }
:where(.site) .ex-aside .app-cta { grid-template-columns: 1fr; padding: var(--sp-5); }
:where(.site) .ex-aside .app-cta h2 { font-size: var(--fs-lg); color: #fff; }
:where(.site) .ex-aside .app-cta__art { display: none; }

/* Login prompt card for the 追蹤中 tab. */
:where(.site) .ex-login { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-5); border-radius: var(--r-lg); background: var(--c-moss-100) url("/images/brand/contour.svg") center / 480px auto; text-align: center; }
:where(.site) .ex-login .icon { width: 44px; height: 44px; color: var(--c-forest-700); }
:where(.site) .ex-login h2 { margin: 0; font-size: var(--fs-xl); }
:where(.site) .ex-login p { margin: 0; max-width: 30em; color: var(--c-text-2); }
:where(.site) .ex-login[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .js .ex-filters { transition: none; }
}

/* =====================================================================
 * Trail map (trek-trailmap.js): red aggregated trails + walking times.
 * Pins live inside the Mapbox canvas container, so they are not scoped.
 * ===================================================================== */
.ttm {
  position: relative;
  width: 100%;
  height: clamp(320px, 56vw, 520px);
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--c-moss-100) url("/images/brand/contour.svg") center / 360px auto;
  box-shadow: var(--shadow-1);
}
.ttm .mapboxgl-ctrl-group { border-radius: var(--r-sm); box-shadow: var(--shadow-1); }
.ttm .mapboxgl-ctrl-group button { width: 36px; height: 36px; }
.ttm-legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 72px);
  padding: 5px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-1);
  color: var(--c-rock-900);
  font: 700 var(--fs-xs)/1.45 var(--font);
  pointer-events: none;
}
.ttm-legend i { flex: none; width: 20px; height: 4px; border-radius: 2px; background: #E80013; box-shadow: 0 0 0 1px #B5000F; }
.ttm-msg {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  max-width: calc(100% - 32px);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-2);
  color: var(--c-text-2);
  font: 700 var(--fs-sm)/1.5 var(--font);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ttm--off { display: grid; place-items: center; }
.ttm-off { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-5); color: var(--c-text-2); text-align: center; }
.ttm-off > .icon { width: 40px; height: 40px; color: var(--c-forest-500); }
.ttm-off p { margin: 0; font-weight: 700; }
.ttm-off .btn { min-height: 44px; background: #fff; }

/* Focus pin (the summit / landmark of the page), anchored bottom. */
.ttm-focus { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ttm-focus span { margin-bottom: 4px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--c-forest-700); box-shadow: var(--shadow-2); color: #fff; font: 800 13px/1.4 var(--font); white-space: nowrap; }
.ttm-focus i {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--c-forest-700);
  box-shadow: var(--shadow-2);
  color: #fff;
}
.ttm-focus i::after { content: ""; position: absolute; left: 50%; bottom: -11px; margin-left: -6px; border: 6px solid transparent; border-top: 7px solid #fff; border-bottom: 0; }
.ttm-focus .icon { width: 18px; height: 18px; }

/* Extra pins: one-glyph badges (facilities, access) and summit flags. */
.ttm-pin { position: relative; display: flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; color: var(--c-forest-900); text-decoration: none; }
a.ttm-pin { min-width: 44px; min-height: 44px; cursor: pointer; }
.ttm-pin i { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--c-forest-500); border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); }
.ttm-pin b { font: 800 12px/1 var(--font); color: var(--c-forest-700); }
.ttm-pin--access i { border-color: #fff; background: var(--c-trail-600); }
.ttm-pin--access b { color: #fff; }
.ttm-pin > span { position: absolute; left: calc(50% + 16px); top: 50%; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-1); font: 700 12px/1.5 var(--font); white-space: nowrap; transform: translateY(-50%); }
.ttm-pin--summit { flex-direction: column-reverse; justify-content: flex-start; min-height: 44px; }
.ttm-pin--summit i { width: 22px; height: 22px; border: 0; background: none; box-shadow: none; color: var(--c-forest-700); }
.ttm-pin--summit .icon { width: 18px; height: 18px; }
.ttm-pin--summit > span { position: static; transform: none; }
.ttm-pin--summit > span em { font-style: normal; font-family: var(--font-num); color: var(--c-trail-600); }
.ttm-pin:hover i, .ttm-pin:focus-visible i { transform: scale(1.12); }
.ttm-pin:hover > span, .ttm-pin:focus-visible > span { background: var(--c-forest-900); color: #fff; }
.ttm-pin:focus-visible { outline: 3px solid var(--c-trail-500); outline-offset: 2px; border-radius: var(--r-sm); }
.ttm-pop { display: grid; gap: 2px; font: 400 13px/1.5 var(--font); color: var(--c-rock-900); }
.ttm-pop b { font-weight: 800; }
.ttm-pop span { color: #C62828; font-weight: 800; font-family: var(--font-num); }
.ttm-pop small { color: var(--c-text-2); }

/* =====================================================================
 * Summit page extras (summit.html): map, access, facilities, views,
 * activities, climbers by month.
 * ===================================================================== */
:where(.site) .sm-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--c-forest-500);
  border-radius: 50%;
  background: #fff;
  color: var(--c-forest-700);
  font: 800 14px/1 var(--font);
}
:where(.site) .sm-badge--access { border-color: var(--c-trail-600); background: var(--c-trail-600); color: #fff; }

:where(.site) .sm-places { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { :where(.site) .sm-places { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
:where(.site) .sm-place { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) .sm-place__body { flex: 1; min-width: 0; display: grid; gap: 4px; }
:where(.site) .sm-place__name { margin: 0; font-size: var(--fs-base); font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
:where(.site) .sm-place__name a { color: var(--c-text); text-decoration: none; }
:where(.site) .sm-place__name a:hover { color: var(--c-forest-700); text-decoration: underline; }
:where(.site) .sm-place__meta { color: var(--c-muted); font-size: var(--fs-xs); }
:where(.site) .sm-place__info { margin: 0; color: var(--c-text-2); font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
:where(.site) .sm-place__routes { margin-top: 4px; font-size: var(--fs-sm); }
:where(.site) .sm-place__routes b { display: block; color: var(--c-forest-700); font-size: var(--fs-xs); }
:where(.site) .sm-place__routes ul { margin: 2px 0 0; padding-left: 1.1em; }
:where(.site) .sm-place__routes li { margin: 2px 0; overflow-wrap: anywhere; }
:where(.site) .sm-place__nav { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--c-forest-700); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
:where(.site) .sm-place__nav:hover { text-decoration: underline; }
:where(.site) #routeAccess .ex-acc > summary { overflow-wrap: anywhere; }

:where(.site) .sm-fac { display: grid; gap: 0 var(--sp-5); grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { :where(.site) .sm-fac { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
:where(.site) .sm-fac__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-rock-100); }
:where(.site) .sm-fac__body { flex: 1; min-width: 0; display: grid; }
:where(.site) .sm-fac__name { color: var(--c-text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
:where(.site) .sm-fac__name:hover { color: var(--c-forest-700); text-decoration: underline; }
:where(.site) .sm-fac__meta { color: var(--c-muted); font-size: var(--fs-xs); }
:where(.site) .sm-fac__info { overflow: hidden; color: var(--c-text-2); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
:where(.site) .sm-fac__nav { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--c-forest-700); }
:where(.site) .sm-fac__nav:hover { background: var(--c-moss-100); }

:where(.site) .sm-view { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--r-sm); background: none; cursor: zoom-in; }
:where(.site) .sm-view:focus-visible { outline: 3px solid var(--c-trail-500); outline-offset: 2px; }
.ex-lightbox button[hidden] { display: none; }
.sm-lb { display: grid; justify-items: center; gap: var(--sp-2); max-width: 94vw; margin: 0; }
.sm-lb img { max-height: 78vh; }
.sm-lb figcaption { max-width: 640px; color: #fff; font-size: var(--fs-sm); text-align: center; }
.sm-lb figcaption p { margin: 0 0 4px; }
.sm-lb figcaption small { color: var(--c-moss-300); }
.sm-lb figcaption a { color: #fff; }

:where(.site) .sm-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; padding: var(--sp-4) var(--sp-3) var(--sp-3); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-1); }
:where(.site) .sm-bar { display: grid; justify-items: center; gap: 4px; min-width: 0; }
:where(.site) .sm-bar__v { min-height: 1.4em; color: var(--c-text-2); font: 700 11px/1.4 var(--font-num); white-space: nowrap; }
:where(.site) .sm-bar__track { position: relative; display: block; width: 100%; max-width: 32px; height: 140px; border-radius: 6px 6px 0 0; background: var(--c-rock-100); }
:where(.site) .sm-bar__track i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 6px 6px 0 0; background: var(--c-moss-300); }
:where(.site) .sm-bar.is-peak .sm-bar__track i { background: var(--c-forest-500); }
:where(.site) .sm-bar.is-peak .sm-bar__v { color: var(--c-forest-700); }
:where(.site) .sm-bar__m { color: var(--c-muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 599px) { :where(.site) .sm-bar__v { font-size: 9px; } :where(.site) .sm-bar__track { height: 110px; } }
