/* ----------------------------------------
   TRAVEL PAGE STYLES
----------------------------------------- */

.hb-travel {
  padding-top: 120px;
  --hb-np: linear-gradient(135deg, #60a5fa 0%, #6366f1 100%);
  --hb-park: #14b8a6;
  --hb-other: #94a3b8;
}

/* Hero */
.hb-travel-hero {
  text-align: center;
  padding: clamp(48px, 8vw, 84px) 20px clamp(28px, 4vw, 40px);
}

.hb-travel-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(48px, 6.5vw, 70px);
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1.0;
  text-transform: uppercase;
  margin-bottom: 0;
  background: var(--hb-np);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-travel-subtitle {
  font-size: 17px;
  color: var(--hb-text-2-alt);
  font-weight: 400;
  margin-top: 14px;
}

/* ── Map + timeline ───────────────────── */

/* Spans the full screen width on wide displays instead of a narrow centre column. */
.hb-travel-explore {
  margin: 0 auto;
  padding: 0 clamp(24px, 3vw, 64px) 80px;
  --hb-panel-h: min(calc(100vh - 150px), 820px);
}

.hb-travel-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hb-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hb-border-cool);
  background: var(--hb-bg);
  color: var(--hb-text-2-cool);
  font: 500 14px 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.hb-chip:hover { border-color: var(--hb-border-strong); }

.hb-chip.is-on {
  color: var(--hb-text-alt);
  border-color: var(--hb-indigo-line);
  background: var(--hb-tint);
}

.hb-chip:not(.is-on) .hb-dot { opacity: 0.35; }

.hb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.hb-dot-np    { background: var(--hb-np); }
.hb-dot-park  { background: var(--hb-park); }
.hb-dot-other { background: var(--hb-other); }

/* Golden ratio: the map is 61.8% of the screen width, the timeline fills the rest. */
.hb-travel-layout {
  display: grid;
  grid-template-columns: minmax(0, 61.8vw) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}

.hb-map-wrap {
  position: relative;
  height: var(--hb-panel-h);
  min-height: 480px;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 20% 10%, var(--hb-map-bg-1) 0%, var(--hb-map-bg-2) 55%, var(--hb-map-bg-3) 100%);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 30px rgba(79, 70, 229, 0.08);
  border: 1px solid var(--hb-border);
}

.hb-map,
.hb-map.maplibregl-map {
  position: absolute;
  inset: 0;
  z-index: 0;              /* keep the dots below the card and buttons */
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hb-map.is-ready { opacity: 1; }
.hb-map.is-tilting .maplibregl-canvas { cursor: ns-resize; }

.hb-map .maplibregl-ctrl-attrib {
  font-size: 10px;
  background: rgb(var(--hb-glass) / 0.7);
}

/* Dots (HTML markers that follow the terrain) */
.hb-dot-marker {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid var(--hb-bg);
  border-radius: 50%;
  background: var(--hb-np);
  box-shadow: 0 1px 4px rgba(30, 27, 75, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hb-dot-wrap { line-height: 0; }
.hb-dot-wrap[hidden] { display: none; }
.hb-dot-marker-park  { width: 12px; height: 12px; background: var(--hb-park); }
.hb-dot-marker-other { width: 9px; height: 9px; border-width: 1.5px; background: var(--hb-other); }

.hb-dot-marker:hover,
.hb-dot-marker:focus-visible { transform: scale(1.25); }

.hb-dot-marker.is-selected {
  transform: scale(1.35);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.25), 0 1px 4px rgba(30, 27, 75, 0.35);
}

.hb-dot-count {
  position: absolute;
  left: 100%;
  bottom: 60%;
  margin-left: 3px;
  font: 600 11px 'Inter', system-ui, sans-serif;
  color: var(--hb-indigo-text);
  text-shadow: 0 0 3px var(--hb-bg), 0 0 3px var(--hb-bg), 0 0 3px var(--hb-bg);
  pointer-events: none;
}

.hb-map-reset {
  z-index: 2;
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hb-border-cool);
  background: rgb(var(--hb-glass) / 0.9);
  font: 500 13px 'Inter', system-ui, sans-serif;
  color: var(--hb-text-strong);
  cursor: pointer;
}

.hb-map-reset:hover { border-color: var(--hb-border-strong); }

.hb-map-hint {
  z-index: 2;
  position: absolute;
  left: 14px;
  top: 14px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(var(--hb-glass) / 0.88);
  box-shadow: 0 1px 6px rgba(67, 56, 202, 0.12);
  font-size: 13px;
  font-weight: 500;
  color: var(--hb-indigo-text);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hb-map-wrap:has(.hb-map.is-active) .hb-map-hint { opacity: 0; }

.hb-map-card {
  z-index: 2;
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: min(300px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 40px 12px 14px;
  border-radius: 16px;
  background: rgb(var(--hb-glass) / 0.97);
  box-shadow: 0 10px 34px rgba(17, 24, 39, 0.16);
  border: 1px solid var(--hb-border);
}

.hb-map-card[hidden] { display: none; }

.hb-map-card.has-photo {
  width: min(420px, calc(100% - 32px));
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.hb-map-card-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  padding: 0;
  background: var(--hb-fill-tint);
  cursor: zoom-in;
  overflow: hidden;
}

.hb-map-card-photo[hidden] { display: none; }

.hb-map-card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hb-map-card-photo:hover img { transform: scale(1.03); }

.hb-map-card-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.55);
  color: #ffffff;
  font-size: 16px;
}

.has-photo .hb-map-card-text { padding: 12px 16px 14px; }

.has-photo .hb-map-card-close {
  top: 10px;
  right: 10px;
  border-radius: 50%;
  background: rgb(var(--hb-glass) / 0.9);
  color: var(--hb-text-strong);
}

.hb-map-card-text { min-width: 0; padding-left: 4px; }

.hb-map-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--hb-text-alt);
}

.hb-map-card-meta {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--hb-text-2-cool);
}

/* Explore: only shown for places that have a gallery folder */
.hb-map-card-explore {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.hb-map-card-explore::after { content: "→"; font-weight: 500; }
.hb-map-card-explore:hover { background: #4338ca; transform: translateX(1px); }
.hb-map-card-explore:focus-visible { outline: 2px solid #4338ca; outline-offset: 2px; }
.hb-map-card-explore[hidden] { display: none; }

.hb-map-card-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--hb-text-3-cool);
  cursor: pointer;
}

.hb-map-card-close:hover { color: var(--hb-text-strong); }

/* Timeline: scrolls inside its own box, the same height as the map */
.hb-timeline,
.hb-stops {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hb-timeline {
  height: var(--hb-panel-h);
  min-height: 480px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 12px 24px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--hb-indigo-line) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 40px), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 40px), transparent 100%);
}

.hb-trip {
  position: relative;
  padding: 0 0 18px 18px;
  border-left: 2px solid var(--hb-border-soft);
}

.hb-trip[hidden] { display: none; }

.hb-trip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hb-bg);
  border: 2px solid #a5b4fc;
}

.hb-trip-year {
  display: block;
  margin: 0 0 4px;
  line-height: 1.2;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.02em;
  background: var(--hb-np);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-trip:not(.has-year) .hb-trip-year { display: none; }
.hb-trip.has-year { padding-top: 0; }
.hb-trip.has-year::before { top: 12px; }
.hb-trip.has-year:not(:first-child) { padding-top: 10px; }
.hb-trip.has-year:not(:first-child)::before { top: 22px; }

.hb-trip-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hb-text-2-cool);
  margin-bottom: 4px;
}

.hb-stop button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-left: -10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: 400 15px 'Inter', system-ui, sans-serif;
  color: var(--hb-text-alt);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hb-stop button:hover { background: var(--hb-tint); }

.hb-stop button.is-selected {
  background: var(--hb-tint-strong);
  color: var(--hb-tint-ink);
  font-weight: 500;
}

.hb-stop-name { flex: 1; min-width: 0; }

.hb-stop-date {
  font-size: 13px;
  color: var(--hb-text-3-cool);
  white-space: nowrap;
}

.hb-stop[data-cat="other"] .hb-stop-name { color: var(--hb-text-2-cool); }

.hb-hide-np    .hb-stop[data-cat="np"],
.hb-hide-park  .hb-stop[data-cat="park"],
.hb-hide-other .hb-stop[data-cat="other"] { display: none; }

/* ── Photo viewer ─────────────────────── */

html.hb-lb-open { overflow: hidden; }

.hb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 24, 0.92);
}

.hb-lightbox[hidden] { display: none; }

.hb-lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 72px 24px;
  box-sizing: border-box;
}

.hb-lb-img {
  max-width: 100%;
  max-height: calc(100% - 40px);
  object-fit: contain;
  border-radius: 6px;
  transition: opacity 0.25s ease;
}

.hb-lightbox.is-loading .hb-lb-img { opacity: 0.35; }

.hb-lb-caption {
  margin-top: 14px;
  font-size: 15px;
  color: #e5e7eb;
}

.hb-lb-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hb-lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.hb-lb-close { top: 14px; right: 14px; font-size: 28px; }
.hb-lb-prev  { left: 14px; top: 50%; transform: translateY(-50%); }
.hb-lb-next  { right: 14px; top: 50%; transform: translateY(-50%); }

/* ── Responsive ───────────────────────── */

@media (max-width: 1000px) {
  .hb-travel-layout { grid-template-columns: 1fr; }
  .hb-map-wrap { height: 64vh; min-height: 380px; }
  .hb-timeline { height: auto; max-height: 60vh; min-height: 0; }
}

@media (max-width: 600px) {
  .hb-travel-hero { padding: 40px 16px 24px; }
  .hb-travel-explore { padding: 0 16px; }
  .hb-travel-explore { padding-bottom: 56px; }
  .hb-map-wrap { height: 58vh; min-height: 360px; border-radius: 16px; }
  .hb-map-hint { display: none; }
  .hb-map-card, .hb-map-card.has-photo { left: 10px; bottom: 10px; width: calc(100% - 20px); }
  .hb-map-card.has-photo .hb-map-card-photo { aspect-ratio: 16 / 9; }
  .hb-lb-figure { padding: 60px 8px 16px; }
  .hb-lb-prev, .hb-lb-next { top: auto; bottom: 14px; transform: none; }
  .hb-lb-prev { left: calc(50% - 60px); }
  .hb-lb-next { right: calc(50% - 60px); }
  .hb-lb-figure { padding-bottom: 80px; }
}

/* ──────────────────────────────────────────────────────────────────
   Place gallery — /travel/?place=<slug>
   A plain photo grid; the lightbox markup and styles are shared with
   the map view above.
   ────────────────────────────────────────────────────────────────── */

.hb-gallery-page .hb-travel-hero { position: relative; }

.hb-gallery-back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--hb-text-2-cool);
  text-decoration: none;
  transition: color 0.18s ease;
}

.hb-gallery-back:hover { color: #4f46e5; }

.hb-gallery {
  padding: 0 clamp(16px, 4vw, 48px) clamp(32px, 4vw, 48px);
}

.hb-gallery:last-of-type { padding-bottom: clamp(56px, 8vw, 96px); }

/* Year heading, styled like the timeline's year labels */
.hb-gallery-year {
  max-width: 1280px;
  margin: 0 auto 14px;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: var(--hb-np);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-gallery-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}

.hb-gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--hb-fill-tint);
  overflow: hidden;
  cursor: zoom-in;
}

.hb-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.hb-gallery-item:hover img { transform: scale(1.04); }
.hb-gallery-item:focus-visible { outline: 2px solid #4f46e5; outline-offset: 3px; }

/* Fade-in on load. Done in CSS, not with a scroll observer, so the photos are
   never left invisible if the animation never runs. --i staggers the first rows. */
@keyframes hb-gallery-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hb-gallery-grid li .hb-gallery-item {
    animation: hb-gallery-in 0.5s ease both;
    animation-delay: min(calc(var(--i, 0) * 45ms), 360ms);
  }
}

@media (max-width: 560px) {
  .hb-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hb-gallery-item { border-radius: 10px; }
}
