/* ============================================
   ElsewhereCo · trip-page.css
   Trip detail only: hero ridge, the day-by-day route, the photo wall and
   its viewer. Behaviour lives in assets/js/trip-page.js. Follows design.md
   (v3): 3px/4px radii and no pills, no glows, ease-out under 240ms for UI,
   hover gated to fine pointers, labels uppercase only in Latin.
   ============================================ */

:root {
  /* Figures in Archivo in both languages (design.md: Archivo carries
     numerals); Arabic words in the same slots fall through to Plex. */
  --tp-num: 'Archivo', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --tp-ease: var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.tp-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Hero: the trip as a poster ─────────────────────────
   Photo at full strength, darkened only where copy sits; the trip's own
   ridge cut into the bottom edge with a flag on the summit; the facts in
   a glass bar above it. Always dark, whatever the theme. */
#trip-detail .trip-hero--poster {
  --ridge-h: clamp(54px, 8vw, 116px);
  display: flex;
  min-height: min(94vh, 980px);
  min-height: min(94svh, 980px);
  padding: 7rem 0 3.5rem;
  border-bottom: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center 40%;
}
#trip-detail .trip-hero--poster.has-ridge { padding-bottom: calc(var(--ridge-h) + 5rem); }
.trip-hero--poster::after {
  background: linear-gradient(180deg,
    rgba(5, 18, 14, 0.58) 0%,
    rgba(5, 18, 14, 0.1) 30%,
    rgba(5, 18, 14, 0.2) 55%,
    rgba(5, 18, 14, 0.9) 100%);
}
.trip-hero--poster .trip-hero-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.trip-hero--poster .trip-back {
  align-self: flex-start;
  margin-bottom: 0;
  background: rgba(6, 22, 17, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.trip-hero-copy { position: relative; isolation: isolate; margin-top: auto; padding-top: 5rem; }
/* The shade follows the full copy block, including wrapped titles. */
.trip-hero-copy::before {
  content: "";
  position: absolute;
  inset: 1rem -4rem -1.5rem;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 18, 14, 0.86), rgba(5, 18, 14, 0.94));
  mask-image: linear-gradient(180deg, transparent, #000 8rem, #000 100%);
}
#trip-detail .trip-hero-where {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: none;
  margin: 0 0 1.1rem;
  padding: 0.35rem 0.9rem 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(6, 22, 17, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--on-dark-text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}
.trip-hero-where .icon { width: 15px; height: 15px; color: #e07b3a; }
#trip-detail .trip-hero--poster h1 {
  max-width: 15ch;
  margin-bottom: 1.1rem;
  font-size: clamp(2.6rem, 4.8vw, 4.25rem);
  text-wrap: balance;
  line-height: 1.02;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}
body[dir="rtl"] #trip-detail .trip-hero--poster h1 { line-height: 1.18; }
@media (min-width: 601px) {
  .trip-hero-copy .trip-title-with-stamp .ec-stamp { transform: translateY(1.5rem); }
}
#trip-detail .trip-hero-desc {
  max-width: 54ch;
  margin-bottom: 2.25rem;
  color: var(--on-dark-text);
  font-size: 1.14rem;
  opacity: 1;
}

/* Ridge + summit flag */
.trip-hero-ridge {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  z-index: 1;
  display: block;
  width: 100%;
  height: var(--ridge-h);
  pointer-events: none;
}
.trip-hero-ridge .ridge-fill { fill: var(--bg); }
.trip-hero-ridge .ridge-edge {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.95;
}
#trip-detail .trip-hero-pin {
  position: absolute;
  z-index: 2;
  left: var(--px);
  bottom: calc(var(--ridge-h) * (1 - var(--py)) - 1px);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: none;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.2;
  transform: translateX(-50%);
  pointer-events: none;
}
#trip-detail .trip-hero-pin.is-left { align-items: flex-start; transform: translateX(-1px); }
#trip-detail .trip-hero-pin.is-right { align-items: flex-end; transform: translateX(calc(-100% + 1px)); }
.trip-hero-pin-text {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(6, 22, 17, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--on-dark-text);
  white-space: nowrap;
}
.trip-hero-pin-text b { font-family: var(--tp-num); font-weight: 600; color: var(--brand-light); }
.trip-hero-pin-flag {
  position: relative;
  width: 1.5px;
  height: 34px;
  background: var(--on-dark-text);
}
.trip-hero-pin-flag::after {
  content: "";
  position: absolute;
  top: 0;
  left: 1.5px;
  width: 15px;
  height: 10px;
  background: var(--brand);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
body[dir="rtl"] .trip-hero-pin-flag::after {
  left: auto;
  right: 1.5px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* Fact bar */
.trip-plate {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(236, 229, 211, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(6, 22, 17, 0.94);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-e3);
  color: var(--on-dark-text);
}
.trip-plate-facts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0;
}
.plate-cell { min-width: 0; padding: 1.1rem 1.35rem 1.2rem; }
.plate-cell + .plate-cell { border-inline-start: 1px solid rgba(236, 229, 211, 0.1); }
.plate-cell dt {
  margin-bottom: 0.4rem;
  color: #d8d4c7;
  font-size: 0.8rem;
}
.plate-cell dd { margin: 0; }
.plate-value {
  display: block;
  color: var(--on-dark-text);
  font-family: var(--tp-num);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
}
.plate-sub {
  display: block;
  margin-top: 0.3rem;
  color: #d8d4c7;
  font-size: 0.82rem;
  line-height: 1.3;
}
/* Days and nights as suns and moons. */
.plate-ticks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin-top: 0.6rem; }
.plate-ticks i { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.plate-ticks .is-day { background: var(--brand); }
.plate-ticks .is-night { box-shadow: inset -2.5px 1px 0 0 var(--on-dark-text-soft); }
body[dir="rtl"] .plate-ticks .is-night { box-shadow: inset 2.5px 1px 0 0 var(--on-dark-text-soft); }
/* Difficulty as four peaks. */
.plate-meter { display: flex; gap: 3px; margin-top: 0.6rem; }
.plate-meter i {
  width: 12px;
  height: 10px;
  background: rgba(236, 229, 211, 0.22);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.plate-meter[data-level="1"] i:nth-child(-n + 1),
.plate-meter[data-level="2"] i:nth-child(-n + 2),
.plate-meter[data-level="3"] i:nth-child(-n + 3),
.plate-meter[data-level="4"] i { background: var(--brand); }

.trip-plate-action {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.35rem;
  border-inline-start: 1px solid rgba(236, 229, 211, 0.12);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.trip-plate-cost { display: flex; flex-direction: column; }
.plate-price {
  color: var(--on-dark-text);
  font-family: var(--tp-num);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.plate-price--vip { color: var(--brand-light); }
.plate-price-orig { margin-top: 0.3rem; color: var(--on-dark-text-muted); font-size: 0.85rem; }
.trip-plate .btn { white-space: nowrap; }
.trip-plate .btn-outline,
.trip-final .btn-outline {
  background: rgba(245, 236, 214, 0.06);
  border-color: rgba(245, 236, 214, 0.32);
  color: var(--on-dark-text-soft);
}
.trip-plate .btn-notify,
.trip-final .btn-notify {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--on-dark-text);
}

@media (max-width: 1020px) {
  .trip-plate { grid-template-columns: minmax(0, 1fr); }
  .trip-plate-facts { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plate-cell { border-top: 1px solid rgba(236, 229, 211, 0.1); }
  .plate-cell:nth-child(-n + 2) { border-top: 0; }
  .plate-cell:nth-child(odd) { border-inline-start: 0; }
  .trip-plate-action {
    justify-content: space-between;
    border-inline-start: 0;
    border-top: 1px solid rgba(236, 229, 211, 0.12);
  }
}
@media (max-width: 600px) {
  /* The whole copy width needs protection on a phone. */
  .trip-hero-copy::before,
  body[dir="ltr"] .trip-hero-copy::before {
    inset: 1.5rem -1.25rem -1.5rem;
    background: linear-gradient(180deg,
      rgba(5, 18, 14, 0.8), rgba(5, 18, 14, 0.94));
    mask-image: linear-gradient(180deg, transparent, #000 8%, #000);
  }
  #trip-detail .trip-hero-desc { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }
  #trip-detail .trip-hero--poster { min-height: 0; padding-top: 6rem; }
  #trip-detail .trip-hero--poster h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
  #trip-detail .trip-hero--poster.has-ridge { padding-bottom: calc(var(--ridge-h) + 4.5rem); }
  .trip-hero-copy { padding-top: 3.5rem; }
  #trip-detail .trip-hero-desc { font-size: 1rem; margin-bottom: 1.5rem; }
  .plate-cell { padding: 0.9rem 1rem; }
  .plate-value { font-size: 1rem; }
  .trip-plate-action { flex-wrap: wrap; padding: 1rem; }
  .trip-plate-action .btn { flex: 1 1 100%; justify-content: center; }
}

/* ── About: lead beside two trip photos, notes below ── */
.trip-about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.trip-about-grid.is-text-only { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
.trip-about-copy h2 {
  margin-bottom: 1.5rem;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
body[dir="rtl"] .trip-about-copy h2 { font-family: var(--display-ar); font-weight: 700; letter-spacing: 0; }
.trip-lead {
  max-width: 58ch;
  color: var(--text);
  font-size: clamp(1.12rem, 1.5vw, 1.32rem);
  line-height: 1.75;
}
body[dir="rtl"] .trip-lead { line-height: 1.95; }
.trip-lead p + p { margin-top: 1rem; }
.trip-lead strong,
.trip-note-body strong { color: var(--text); font-weight: 600; }
.trip-lead a,
.trip-note-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

.trip-about-photos { position: relative; aspect-ratio: 1 / 1.05; }
.trip-about-photos.is-single { aspect-ratio: 4 / 3.4; }
.trip-about-photo {
  position: absolute;
  inset-block: 0 14%;
  inset-inline: 16% 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-e2);
  cursor: zoom-in;
}
.trip-about-photos.is-single .trip-about-photo { inset: 0; }
.trip-about-photo.is-inset {
  inset-block: auto 0;
  inset-inline: 0 auto;
  width: 46%;
  aspect-ratio: 1;
  border: 6px solid var(--bg);
}
.trip-about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--tp-ease);
}
.trip-about-photo:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.trip-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}
.trip-note { position: relative; padding-top: 1.35rem; border-top: 1px solid var(--line-strong); }
.trip-note::before {
  content: "";
  position: absolute;
  top: -1px;
  inset-inline-start: 0;
  width: 36px;
  height: 3px;
  background: var(--brand);
}
.trip-note h3 {
  margin-bottom: 0.6rem;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 500;
}
body[dir="rtl"] .trip-note h3 { font-family: var(--display-ar); font-weight: 600; }
.trip-note-body { color: var(--text-soft); font-size: 0.98rem; line-height: 1.75; }
.trip-note-body p + p { margin-top: 0.75rem; }

@media (max-width: 880px) {
  .trip-about-grid { grid-template-columns: minmax(0, 1fr); }
  .trip-about-photos { max-width: 520px; width: 100%; justify-self: center; }
}

/* ── Shared section heads ───────────────────────────── */
.tp-route-head,
.tp-photos-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 2.5rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.tp-route-head h2,
.tp-photos-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 4.2vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}
body[dir="rtl"] .tp-route-head h2,
body[dir="rtl"] .tp-photos-head h2 {
  font-family: var(--display-ar);
  font-weight: 700;
  letter-spacing: 0;
}
.tp-route-head p {
  max-width: 40ch;
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.6;
}
.tp-photos-head p {
  max-width: 52ch;
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================
   Route
   ============================================ */
/* The route section sits on a survey map. */
.tp-route { position: relative; isolation: isolate; }
.tp-route::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--green-light);
  opacity: 0.16;
  -webkit-mask: url("../images/contours.svg") center / cover no-repeat;
  mask: url("../images/contours.svg") center / cover no-repeat;
  pointer-events: none;
}
html[data-theme="light"] .tp-route::before { opacity: 0.22; }

.tp-route-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.tp-route-grid--single { grid-template-columns: minmax(0, 1fr); }
.tp-route-panel {
  position: sticky;
  top: 6.25rem;
  max-height: calc(100vh - 7.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Chart ── */
.tp-chart { margin: 0; flex: none; }
.tp-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--brand);
  font-family: var(--tp-num);
}
.tp-grid line { stroke: var(--line); stroke-width: 1; }
.tp-grid text,
.tp-axis text {
  fill: var(--text-muted);
  font-size: 13px;
  font-feature-settings: "tnum";
}
.tp-axis text { font-size: 15px; transition: fill 0.24s var(--tp-ease); }
.tp-axis text.is-empty { fill: var(--text-dim); }
.tp-axis text.is-active { fill: var(--text); font-weight: 600; }
.tp-area { opacity: 0; transition: opacity 0.62s var(--tp-ease) 0.6s; }
.tp-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s var(--tp-ease);
}
.tp-line-gap {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
  opacity: 0;
  transition: opacity 0.62s var(--tp-ease) 0.9s;
}
.is-drawn .tp-line { stroke-dashoffset: 0; }
.is-drawn .tp-area { opacity: 1; }
.is-drawn .tp-line-gap { opacity: 0.6; }
.tp-point {
  fill: var(--section-alt);
  stroke: var(--brand);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.24s var(--tp-ease), fill 0.24s var(--tp-ease);
}
.tp-point.is-past { fill: var(--brand); }
.tp-point.is-active { fill: var(--brand); transform: scale(1.55); }
.tp-cursor { transition: transform 0.24s var(--tp-ease); }
.tp-cursor line { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 4; }
/* Stage-profile place labels: vertical, with a leader to the point. */
.tp-place-label line { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 1 3; transition: stroke 0.24s var(--tp-ease); }
.tp-place-label text { fill: var(--text-muted); font-size: 15px; transition: fill 0.24s var(--tp-ease); }
.tp-place-label .tp-place-alt-svg { font-weight: 600; font-feature-settings: "tnum"; }
.tp-place-label.is-past text { fill: var(--text-soft); }
.tp-place-label.is-active text { fill: var(--text); }
.tp-place-label.is-active line { stroke: var(--text-soft); }
.tp-place-label.is-summit text { fill: var(--brand); }
.tp-place-label.is-summit .tp-place-name { font-weight: 600; }
.tp-place-label.is-summit line { stroke: var(--brand); stroke-dasharray: none; }
.tp-point.is-summit { stroke-width: 2.5; }
.tp-day-hit { fill: transparent; cursor: pointer; }

/* Hourly schedules: a day on a clock. */
.tp-clock-track { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.tp-clock-progress {
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  transition: x2 0.24s var(--tp-ease);
}
.tp-mark {
  fill: var(--section-alt);
  stroke: var(--text-muted);
  stroke-width: 2;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform 0.24s var(--tp-ease), fill 0.24s var(--tp-ease), stroke 0.24s var(--tp-ease);
}
.tp-mark.is-past { fill: var(--brand); stroke: var(--brand); }
.tp-mark.is-active { fill: var(--brand); stroke: var(--brand); transform: scale(1.3); }

/* ── Index ── */
.tp-route-index {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.tp-route-index ol { list-style: none; display: grid; gap: 2px; }
.tp-route-index button {
  width: 100%;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.95rem;
  text-align: start;
  cursor: pointer;
  transition: background 0.2s var(--tp-ease), color 0.2s var(--tp-ease);
}
.tp-route-index button[aria-current] {
  color: var(--text);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}
.tp-route-index button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.tp-index-when {
  font-family: var(--tp-num);
  font-feature-settings: "tnum";
  font-weight: 500;
  color: var(--brand);
}
.tp-index-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Trail ──
   when | blaze | body. The trail runs through the blaze column: dashed
   ahead of the reader, solid orange behind. */
.tp-trail { list-style: none; position: relative; }
.tp-stop {
  --when: 4.5rem;
  --blaze-col: 1.5rem;
  --col-gap: 1.25rem;
  position: relative;
  display: grid;
  grid-template-columns: var(--when) var(--blaze-col) minmax(0, 1fr);
  column-gap: var(--col-gap);
  padding-bottom: clamp(2.25rem, 4vw, 3rem);
  outline: none;
}
.tp-stop:last-child { padding-bottom: 0; }
.tp-stop::before {
  content: "";
  position: absolute;
  top: 1.9rem;
  bottom: -0.3rem;
  inset-inline-start: calc(var(--when) + var(--col-gap) + var(--blaze-col) / 2 - 1px);
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line-strong) 0 6px, transparent 6px 12px);
}
.tp-stop:last-child::before { display: none; }
.tp-stop.is-past::before { background: var(--brand); }

.tp-when {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: end;
  line-height: 1;
  padding-top: 0.1rem;
}
.tp-when-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
[data-mode="hour"] .tp-when-label { margin: 0.35rem 0 0; }
.tp-when-num {
  font-family: var(--tp-num);
  font-size: 2.75rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  color: var(--text-muted);
  transition: color 0.24s var(--tp-ease);
}
[data-mode="hour"] .tp-when-num { font-size: 1.45rem; letter-spacing: -0.01em; }
.tp-stop.is-past .tp-when-num { color: var(--text); }
.tp-stop.is-active .tp-when-num { color: var(--brand); }
.tp-when-text { font-size: 0.92rem; color: var(--text-soft); line-height: 1.35; }

/* Trail blaze: the painted rectangle hikers follow. */
.tp-blaze {
  grid-column: 2;
  justify-self: center;
  position: relative;
  z-index: 1;
  width: 12px;
  height: 18px;
  margin-top: 0.55rem;
  border: 2px solid var(--text-muted);
  border-radius: 2px;
  background: var(--section-alt);
  transition: background 0.24s var(--tp-ease), border-color 0.24s var(--tp-ease), transform 0.24s var(--tp-ease), box-shadow 0.24s var(--tp-ease);
}
.tp-stop.is-past .tp-blaze,
.tp-stop.is-active .tp-blaze { background: var(--brand); border-color: var(--brand); }
.tp-stop.is-active .tp-blaze { transform: scale(1.25); }
.tp-stop.is-summit .tp-blaze {
  width: 22px;
  height: 19px;
  border: 0;
  border-radius: 0;
  background: var(--text-muted);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  box-shadow: none;
}
.tp-stop.is-summit.is-past .tp-blaze,
.tp-stop.is-summit.is-active .tp-blaze { background: var(--brand); }

.tp-stop-body { grid-column: 3; min-width: 0; max-width: 60ch; padding-top: 0.3rem; }
.tp-stop-title {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.55rem;
}
body[dir="rtl"] .tp-stop-title { font-family: var(--display-ar); font-weight: 600; letter-spacing: 0; }
.tp-summit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.8rem 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand-light);
  font-size: 0.88rem;
  font-weight: 600;
  font-feature-settings: "tnum";
}
html[data-theme="light"] .tp-summit { color: var(--brand-dark); }
.tp-summit .icon { width: 16px; height: 16px; }

.tp-route-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.65rem;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.4;
}
.tp-place { display: inline-flex; align-items: baseline; gap: 0.4rem; white-space: nowrap; }
.tp-place-alt {
  font-family: var(--tp-num);
  font-size: 0.8em;
  font-feature-settings: "tnum";
  color: var(--text-muted);
}
.tp-hop {
  position: relative;
  display: inline-block;
  width: 1.1rem;
  height: 1.5px;
  background: var(--brand);
}
.tp-hop::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 0;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--brand);
  border-inline-end: 1.5px solid var(--brand);
  transform: translateY(-50%) rotate(45deg);
}
body[dir="rtl"] .tp-hop::after { transform: translateY(-50%) rotate(-45deg); }

.tp-note { color: var(--text-soft); font-size: 1.02rem; line-height: 1.75; }
.tp-alt {
  font-family: var(--tp-num);
  font-feature-settings: "tnum";
  color: var(--text);
  white-space: nowrap;
}
.tp-arrow { color: var(--brand); }

.tp-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 0.9rem;
  color: var(--text-soft);
  font-size: 0.94rem;
}
.tp-facts li { display: inline-flex; align-items: center; gap: 0.45rem; }
.tp-facts .icon { width: 16px; height: 16px; color: var(--brand); }
.tp-facts b {
  font-family: var(--tp-num);
  font-weight: 600;
  font-feature-settings: "tnum";
  color: var(--text);
}

@media (max-width: 960px) {
  .tp-route-grid { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .tp-route-panel { position: static; max-height: none; }
  .tp-route-index { display: none; }
}
@media (max-width: 600px) {
  .tp-place-label text { font-size: 18px; }
  .tp-axis text { font-size: 18px; }
  .tp-grid text { font-size: 16px; }
  .tp-stop { --when: 2.9rem; --blaze-col: 1.25rem; --col-gap: 0.75rem; }
  .tp-when-num { font-size: 1.9rem; }
  [data-mode="hour"] .tp-stop { --when: 3.6rem; }
  [data-mode="hour"] .tp-when-num { font-size: 1.1rem; }
  .tp-when-label { font-size: 0.72rem; }
  .tp-stop-title { font-size: 1.22rem; }
  .tp-route-line { font-size: 1rem; }
}

/* ============================================
   Photo wall
   ============================================ */
.tp-photos-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tp-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.2s var(--tp-ease), background 0.2s var(--tp-ease);
}
.tp-tool:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.tp-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.tp-tool[hidden] { display: none; }
.tp-tool .icon { width: 17px; height: 17px; }
.tp-photos-more { display: flex; justify-content: center; margin-top: 1.5rem; }
.tp-tool--all { min-height: 48px; padding: 0.7rem 1.5rem; border-color: var(--brand); }

.tp-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(62px, 7.2vw, 98px);
  gap: clamp(8px, 1.1vw, 14px);
}
.tp-frame {
  position: relative;
  grid-column: span var(--c, 2);
  grid-row: span var(--r, 3);
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius);
  background: var(--bg-card);
}
/* Top shade keeps the grip legible on bright skies. */
.tp-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 13, 10, 0.5), transparent 34%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--tp-ease);
}
.tp-frame:hover::after,
.tp-frame:focus-within::after,
.tp-frame.is-dragging::after { opacity: 1; }

.tp-frame-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  clip-path: inset(0);
}
.tp-frame-open:focus-visible { outline: none; }
.tp-frame:has(.tp-frame-open:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.tp-frame-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.24s var(--tp-ease), transform 0.6s var(--tp-ease);
}
.tp-frame.is-loaded img { opacity: 1; }
.tp-frame-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}
.tp-frame.is-broken .tp-frame-fallback { display: grid; }
.tp-frame.is-broken img { display: none; }

/* Viewfinder corners: lock on when a frame is pointed at. */
.tp-frame-corners {
  position: absolute;
  inset: 14px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.24s var(--tp-ease), transform 0.24s var(--tp-ease);
}
.tp-frame-corners i {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid var(--on-dark-text);
}
.tp-frame-corners i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.tp-frame-corners i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.tp-frame-corners i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.tp-frame-corners i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.tp-frame-open:hover .tp-frame-corners,
.tp-frame-open:focus-visible .tp-frame-corners { opacity: 0.95; transform: none; }

.tp-frame-grip {
  position: absolute;
  z-index: 3;
  top: 10px;
  inset-inline-end: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(236, 229, 211, 0.35);
  border-radius: var(--radius);
  background: rgba(8, 32, 26, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--on-dark-text);
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.2s var(--tp-ease), border-color 0.2s var(--tp-ease);
}
.tp-frame-grip .icon { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.tp-frame:hover .tp-frame-grip,
.tp-frame-grip:focus-visible,
.tp-frame.is-dragging .tp-frame-grip { opacity: 1; }
.tp-frame-grip:hover { border-color: var(--brand); }
.tp-frame-grip:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (hover: none) { .tp-frame-grip { opacity: 1; } }

.tp-frame.is-dragging {
  z-index: 5;
  cursor: grabbing;
  box-shadow: var(--shadow-e3), 0 0 0 2px var(--brand);
}
.tp-frame.is-dragging .tp-frame-open,
.tp-frame.is-dragging .tp-frame-grip { cursor: grabbing; }
.tp-frame.is-dragging .tp-frame-open img { transform: none; }
.tp-bento.is-sorting .tp-frame:not(.is-dragging) { filter: brightness(0.72) saturate(0.8); transition: filter 0.24s var(--tp-ease); }
.tp-bento.is-sorting .tp-frame.is-target { filter: none; }
.tp-frame.is-target .tp-frame-corners { opacity: 1; transform: scale(0.94); }

@media (prefers-reduced-motion: no-preference) {
  .tp-bento.is-waiting .tp-frame-open { opacity: 0; clip-path: inset(14%); }
  .tp-bento.is-in .tp-frame-open {
    transition:
      opacity 0.62s var(--tp-ease) calc(var(--i, 0) * 90ms),
      clip-path 0.62s var(--tp-ease) calc(var(--i, 0) * 90ms);
  }
}

@media (max-width: 720px) {
  .tp-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 26vw; gap: 8px; }
  .tp-frame { grid-column: span var(--mc, 1); grid-row: span var(--mr, 2); }
  .tp-frame-corners { inset: 10px; }
  .tp-frame-corners i { width: 14px; height: 14px; }
  .tp-frame-grip { top: 8px; inset-inline-end: 8px; width: 34px; height: 34px; }
}

/* ============================================
   Before you go
   Three different things, so three different forms: a map card, a
   two-column ledger, and a checklist people actually tick.
   ============================================ */
.trip-kit-title {
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
body[dir="rtl"] .trip-kit-title { font-family: var(--display-ar); font-weight: 700; letter-spacing: 0; }
.kit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  grid-template-areas: "meet ledger" "pack ledger";
  gap: 1.25rem;
  align-items: start;
}
.kit-grid.no-meet { grid-template-areas: "pack ledger"; }
.kit-grid.no-pack { grid-template-areas: "meet ledger"; }
.kit-meet { grid-area: meet; }
.kit-ledger { grid-area: ledger; }
.kit-pack { grid-area: pack; }
.kit-grid h3 {
  color: var(--text);
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
}
body[dir="rtl"] .kit-grid h3 { font-family: var(--display-ar); font-weight: 600; }

/* Meeting point: a scrap of map with the pin on it. */
.kit-meet {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.kit-meet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--green-light);
  opacity: 0.32;
  -webkit-mask: url("../images/contours.svg") 30% 40% / 900px auto no-repeat;
  mask: url("../images/contours.svg") 30% 40% / 900px auto no-repeat;
}
.kit-meet-pin {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.1rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
}
.kit-meet-pin .icon { width: 22px; height: 22px; }
.kit-meet h3 { margin-bottom: 0.4rem; }
.kit-meet p { color: var(--text-soft); font-size: 1rem; line-height: 1.6; }
.kit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.95rem;
}
.kit-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.kit-link .icon { width: 15px; height: 15px; }

/* Included / not included, side by side. */
.kit-ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem 2.25rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.kit-ledger h3 { margin-bottom: 1rem; }
.kit-ledger ul { list-style: none; display: grid; gap: 0.7rem; }
.kit-ledger li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.5;
}
.kit-ledger li .icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
  stroke-width: 2.4;
}
.kit-ledger-col.is-out li { color: var(--text-muted); }
.kit-ledger-col.is-out li .icon { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-muted); }

/* Packing list: a real checklist, remembered per trip on this device. */
.kit-pack {
  padding: 1.5rem 1.6rem 1.4rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.kit-pack-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.kit-pack-count {
  color: var(--text-muted);
  font-family: var(--tp-num);
  font-size: 0.88rem;
  white-space: nowrap;
}
.kit-pack.is-done .kit-pack-count { color: var(--brand); font-weight: 600; }
.kit-pack-hint { margin-top: 0.3rem; color: var(--text-muted); font-size: 0.88rem; }
.kit-pack-bar {
  display: block;
  height: 3px;
  margin: 1rem 0 0.9rem;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.kit-pack-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s var(--tp-ease);
}
body[dir="rtl"] .kit-pack-bar span { transform-origin: right center; }
.kit-pack ul { list-style: none; display: grid; gap: 0.15rem; }
.kit-pack label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  padding: 0.45rem 0.35rem;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.2s var(--tp-ease);
}
.kit-pack label:hover { background: rgba(236, 229, 211, 0.04); }
html[data-theme="light"] .kit-pack label:hover { background: rgba(8, 32, 26, 0.04); }
.kit-pack input { position: absolute; opacity: 0; pointer-events: none; }
.kit-box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius);
  color: transparent;
  transition: background 0.2s var(--tp-ease), border-color 0.2s var(--tp-ease), color 0.2s var(--tp-ease);
}
.kit-box .icon { width: 14px; height: 14px; stroke-width: 3; }
.kit-pack input:checked + .kit-box { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.kit-pack input:checked ~ .kit-pack-text { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--text-dim); }
.kit-pack input:focus-visible + .kit-box { outline: 2px solid var(--brand); outline-offset: 3px; }
.kit-pack-guides {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.85rem;
  margin-inline-start: 2.45rem;
  padding-block-end: 0.65rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
.kit-pack-guides > span { color: var(--text-muted); }
.kit-pack-guides a { color: var(--brand); padding-block: 0.4rem; text-decoration: underline; text-underline-offset: 3px; }
.kit-pack-guides a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

@media (max-width: 880px) {
  .kit-grid,
  .kit-grid.no-meet,
  .kit-grid.no-pack {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "meet" "ledger" "pack";
  }
  .kit-grid.no-meet { grid-template-areas: "ledger" "pack"; }
  .kit-grid.no-pack { grid-template-areas: "meet" "ledger"; }
}

/* ── Closing call, on the trip's own photo ── */
.trip-final {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem 3rem;
  min-height: 400px;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 4.5rem);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(0deg, rgba(5, 18, 14, 0.94) 0%, rgba(5, 18, 14, 0.55) 55%, rgba(5, 18, 14, 0.25) 100%),
    var(--final-img) center 45% / cover no-repeat,
    var(--bg-card);
  color: var(--on-dark-text);
}
.trip-final h2 {
  max-width: 16ch;
  color: var(--on-dark-text);
  font-family: var(--display);
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
body[dir="rtl"] .trip-final h2 { font-family: var(--display-ar); font-weight: 700; letter-spacing: 0; line-height: 1.25; }
.trip-final p {
  max-width: 46ch;
  margin-top: 0.9rem;
  color: var(--on-dark-text-soft);
  font-size: 1.08rem;
}
.trip-final-action { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.trip-final-price { display: flex; flex-direction: column; }
.trip-final-price .plate-price { font-size: 2.1rem; }

/* ============================================
   Viewer
   ============================================ */
body.tp-viewer-open { overflow: hidden; }
.tp-viewer {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(3, 12, 9, 0.96);
  color: var(--on-dark-text);
  opacity: 0;
  transition: opacity 0.22s var(--tp-ease);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tp-viewer {
    background: rgba(3, 12, 9, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
.tp-viewer[hidden] { display: none; }
.tp-viewer.is-open { opacity: 1; }
.tp-viewer button { font: inherit; color: inherit; }
.tp-viewer button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.tp-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(0.9rem, 3vw, 2rem);
}
.tp-viewer-title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  min-width: 0;
}
.tp-viewer-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 500;
}
body[dir="rtl"] .tp-viewer-title strong { font-family: var(--display-ar); font-weight: 600; }
.tp-viewer-title span {
  flex: none;
  color: var(--on-dark-text-muted);
  font-family: var(--tp-num);
  font-feature-settings: "tnum";
  font-size: 0.95rem;
}
.tp-viewer-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.tp-zoom {
  display: inline-flex;
  border: 1px solid rgba(236, 229, 211, 0.22);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.tp-zoom button,
.tp-viewer-close {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s var(--tp-ease);
}
.tp-zoom button + button { border-inline-start: 1px solid rgba(236, 229, 211, 0.14); }
.tp-zoom [data-viewer="zoom-reset"] { min-width: 60px; font-family: var(--tp-num); font-feature-settings: "tnum"; font-size: 0.85rem; }
.tp-zoom button:disabled { opacity: 0.35; cursor: default; }
.tp-zoom button:not(:disabled):hover,
.tp-viewer-close:hover { background: rgba(236, 229, 211, 0.08); }
.tp-viewer-close { border: 1px solid rgba(236, 229, 211, 0.22); border-radius: var(--radius); }
.tp-viewer .icon { width: 20px; height: 20px; }

.tp-viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0.5rem clamp(3.75rem, 7vw, 6.5rem);
  overflow: hidden;
}
.tp-viewer-figure { position: relative; margin: 0; display: grid; max-width: 100%; }
.tp-viewer-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 15.5rem);
  max-height: calc(100dvh - 15.5rem);
  border-radius: 3px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.24s var(--tp-ease);
}
.tp-viewer-figure .tp-frame-corners {
  inset: -14px;
  opacity: 0.55;
  transform: none;
  transition: opacity 0.2s var(--tp-ease);
}
.tp-viewer-stage.is-zoomed .tp-frame-corners { opacity: 0; }
.tp-viewer-stage.is-zoomed img { cursor: grab; }
.tp-viewer-stage.is-panning img { cursor: grabbing; transition: none; }

.tp-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  translate: 0 -50%;
  border: 1px solid rgba(236, 229, 211, 0.3);
  border-radius: var(--radius);
  background: rgba(8, 32, 26, 0.72);
  cursor: pointer;
  transition: border-color 0.2s var(--tp-ease), background 0.2s var(--tp-ease);
}
.tp-viewer-nav:hover { border-color: var(--brand); background: rgba(8, 32, 26, 0.92); }
.tp-viewer-nav:disabled { display: none; }
.tp-viewer-prev { inset-inline-start: clamp(0.5rem, 2vw, 1.5rem); }
.tp-viewer-next { inset-inline-end: clamp(0.5rem, 2vw, 1.5rem); }
.tp-viewer-nav .icon { width: 24px; height: 24px; stroke-width: 2; }
.tp-viewer-prev .icon { transform: scaleX(-1); }
.tp-viewer[dir="rtl"] .tp-viewer-prev .icon { transform: none; }
.tp-viewer[dir="rtl"] .tp-viewer-next .icon { transform: scaleX(-1); }

.tp-viewer-foot {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  padding: 0.35rem 1rem 1.2rem;
}
.tp-viewer.is-single .tp-dock { display: none; }

/* The dock: slide mounts dropped on a light table. */
.tp-dock {
  position: relative;
  min-width: 0;
  z-index: 3;
  max-width: min(100%, 720px);
  padding: 0 0.75rem 0.2rem;
  border: 1px solid rgba(236, 229, 211, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(13, 42, 34, 0.78);
  box-shadow: var(--shadow-e3), var(--edge);
  transition: translate 0.24s var(--tp-ease);
}
.tp-dock.is-moving { transition: none; }
.tp-dock-handle {
  display: grid;
  place-items: center;
  width: 68px;
  height: 22px;
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--on-dark-text-muted);
  cursor: grab;
  touch-action: none;
}
.tp-dock-handle:active { cursor: grabbing; }
.tp-dock-rail {
  display: flex;
  gap: 12px;
  padding: 12px 10px 14px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 229, 211, 0.2) transparent;
}
.tp-dock-thumb {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 3px solid var(--on-dark-text);
  border-radius: 3px;
  background: var(--bg-card);
  box-shadow: var(--shadow-e1);
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.24s var(--tp-ease), border-color 0.2s var(--tp-ease);
}
.tp-dock-thumb:nth-child(4n + 1) { --tilt: -6deg; }
.tp-dock-thumb:nth-child(4n + 2) { --tilt: 4deg; }
.tp-dock-thumb:nth-child(4n + 3) { --tilt: -2deg; }
.tp-dock-thumb:nth-child(4n + 4) { --tilt: 7deg; }
.tp-dock-thumb[aria-current="true"] {
  z-index: 1;
  border-color: var(--brand);
  transform: translateY(-7px) rotate(0deg) scale(1.14);
}
.tp-dock-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tp-viewer-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: rgba(236, 229, 211, 0.08);
}
.tp-viewer-progress span {
  display: block;
  height: 100%;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s var(--tp-ease);
}
.tp-viewer[dir="rtl"] .tp-viewer-progress span { transform-origin: right center; }

@media (max-width: 600px) {
  .tp-zoom { display: none; }
  .tp-viewer-stage { padding: 0.25rem 0.5rem 3.5rem; }
  .tp-viewer-figure img { max-height: calc(100dvh - 14.5rem); }
  .tp-viewer-nav { top: auto; bottom: 0; translate: none; width: 46px; height: 46px; }
  .tp-viewer-prev { inset-inline-start: calc(50% - 56px); }
  .tp-viewer-next { inset-inline-end: calc(50% - 56px); }
  .tp-dock-thumb { flex-basis: 50px; width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-line { stroke-dashoffset: 0; transition: none; }
  .tp-area, .tp-line-gap { opacity: 1; transition: none; }
  .tp-cursor, .tp-point, .tp-mark, .tp-blaze, .tp-clock-progress { transition: none; }
  .tp-dock-thumb { --tilt: 0deg !important; transition: none; }
  .tp-frame-open img, .tp-viewer-figure img { transition: none; }
}

/* Hover effects, only where a fine pointer can hover (design.md §8). */
@media (hover: hover) and (pointer: fine) {
  .tp-day-hit:hover { fill: rgba(236, 229, 211, 0.04); }
  html[data-theme="light"] .tp-day-hit:hover { fill: rgba(8, 32, 26, 0.04); }
  .tp-route-index button:hover { color: var(--text); background: rgba(236, 229, 211, 0.05); }
  html[data-theme="light"] .tp-route-index button:hover { background: rgba(8, 32, 26, 0.05); }
  .tp-frame-open:hover img { transform: scale(1.045); }
  .trip-about-photo:hover img { transform: scale(1.04); }
  .tp-dock-thumb:hover { transform: translateY(-6px) rotate(0deg) scale(1.08); }
}

html[lang="en"] .plate-cell dt,
html[lang="en"] .tp-when-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
