/* ==========================================================================
   Expedition Map — Clean Cartographic & Trip Log Styles
   ========================================================================== */

* {
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
}

img, svg {
  -webkit-user-drag: none;
  user-drag: none;
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.map-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

button {
  font-family: inherit;
}

/* ---------------- Top Bar ---------------- */
.map-hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.8rem;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.hud-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--fg);
  transition: all 0.3s var(--ease);
}

.hud-back-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}

.hud-back-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.hud-back-btn:hover svg {
  transform: translateX(-3px);
}

.hud-title-wrap {
  display: flex;
  flex-direction: column;
}

.hud-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--fg);
}

/* Right */
.hud-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hud-filters {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.hud-filter-btn {
  background: transparent;
  border: none;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.hud-filter-btn:hover {
  color: var(--fg);
}

.hud-filter-btn.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

/* ---------------- Map Viewport & Surface ---------------- */
.map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: var(--bg);
}

.map-viewport:active {
  cursor: grabbing;
}

.map-surface {
  position: absolute;
  width: 2000px;
  height: 1400px;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.map-svg-terrain {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------------- Trail Line & Animations ---------------- */
.route-line-bg {
  stroke-linecap: round;
  animation: routeDash 35s linear infinite;
}

@keyframes routeDash {
  to {
    stroke-dashoffset: -400;
  }
}

.basecamp-pulse {
  animation: bcPulse 3s var(--ease) infinite;
  transform-origin: center;
}

@keyframes bcPulse {
  0% {
    r: 10;
    opacity: 0.8;
  }

  50% {
    r: 22;
    opacity: 0;
  }

  100% {
    r: 10;
    opacity: 0;
  }
}

/* ---------------- Waypoint Pins ---------------- */
.map-waypoints-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.waypoint-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.3s var(--ease), z-index 0.1s ease;
}

.waypoint-pin.is-hidden {
  opacity: 0.15;
  pointer-events: none;
  filter: grayscale(1);
}

.pin-diamond {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
}

.pin-glyph {
  transform: rotate(-45deg);
  font-size: 12px;
  color: var(--accent-text);
}

.pin-pulse {
  position: absolute;
  inset: -2px;
  border: 1.2px solid var(--accent);
  border-radius: 5px;
  animation: pinPulse 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes pinPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }

  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

.pin-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  transition: all 0.25s var(--ease);
  pointer-events: auto;
}

/* Directional Label Offset Modifiers (Anchored around the centered diamond) */
.waypoint-pin.label-right .pin-label {
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-start;
  text-align: left;
}

.waypoint-pin.label-left .pin-label {
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-end;
  text-align: right;
}

.waypoint-pin.label-top .pin-label {
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  text-align: center;
}

.waypoint-pin.label-bottom .pin-label {
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  text-align: center;
}

.pin-label strong {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg);
}

.waypoint-pin:hover {
  z-index: 60;
}

.waypoint-pin:hover .pin-diamond {
  transform: rotate(45deg) scale(1.18);
  background: var(--accent);
  border-color: #fff;
  box-shadow: 0 6px 18px -2px rgba(0, 0, 0, 0.5);
}

.waypoint-pin:hover .pin-label {
  border-color: var(--accent);
  box-shadow: 0 8px 22px -3px rgba(0, 0, 0, 0.45);
}

/* ---------------- Bottom Bar ---------------- */
.map-hud-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.8rem;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
}

.hud-bottom-center {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-bottom-right {
  flex-shrink: 0;
}

.waypoint-quickbar {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  padding: 0.2rem 0;
}

.waypoint-quickbar::-webkit-scrollbar {
  display: none;
}

.quickbar-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.quickbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  transform: translateY(-2px);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.zoom-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.zoom-btn.reset-btn {
  font-size: 0.9rem;
}

/* ---------------- Spot Modal & Carousel ---------------- */
.spot-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  padding: max(1rem, env(safe-area-inset-top)) max(0.8rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left));
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  transition: opacity 0.28s var(--ease);
}

@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .spot-modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

.spot-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.spot-modal-card {
  position: relative;
  background: var(--bg);
  border: none;
  outline: none;
  border-radius: 20px;
  max-width: 980px;
  width: 94vw;
  height: min(86vh, 680px);
  height: min(86dvh, 680px);
  max-height: min(86vh, 680px);
  max-height: min(86dvh, 680px);
  display: grid;
  grid-template-columns: auto 1fr;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
  will-change: transform;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.32s var(--ease);
  box-shadow: 0 32px 70px -18px rgba(0, 0, 0, 0.6);
}

.spot-modal-overlay.is-open .spot-modal-card {
  transform: translateY(0) scale(1);
}

/* Left: Full Image Carousel Column (Strict 3:4 Portrait Ratio) */
.spot-modal-media-col {
  position: relative;
  height: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #12141A;
  border-radius: 20px 0 0 20px;
}

.spot-carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  background: #12141A;
  margin-bottom: 0;
  box-shadow: none;
}

.spot-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  transform: translateZ(0);
  transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  cursor: zoom-in;
}

.carousel-slide-art {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.6rem;
  color: #fff;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  transform: translateZ(0);
}

/* Right: Content Column */
.spot-modal-content-col {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 0 20px 20px 0;
  padding: 2.4rem 2.2rem 1.8rem;
  overflow-y: auto;
  contain: content;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
  box-sizing: border-box;
  max-height: min(88vh, 740px);
  max-height: min(88dvh, 740px);
}

.spot-modal-content-col::-webkit-scrollbar {
  width: 5px;
}

.spot-modal-content-col::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 999px;
}

.spot-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--fg);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  z-index: 15;
}

.spot-modal-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.spot-modal-header {
  margin-bottom: 1rem;
}

.spot-modal-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding-right: 2.8rem; /* prevents overlap with close button */
  box-sizing: border-box;
}

.spot-meta-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent-text);
}

.spot-meta-badge.date {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--fg-dim);
}

.spot-modal-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  color: var(--fg);
}

.slide-overlay-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(18, 20, 26, 0.75);
  backdrop-filter: blur(6px);
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  display: inline-block;
  align-self: flex-start;
}

.spot-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18, 20, 26, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  z-index: 5;
}

.spot-carousel-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.spot-carousel-arrow.prev {
  left: 10px;
}

.spot-carousel-arrow.next {
  right: 10px;
}

.spot-carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.carousel-dot.is-active {
  background: var(--accent);
  width: 20px;
  border-radius: 999px;
}

/* Story Text */
.spot-story-wrap {
  margin-bottom: 1.4rem;
}

.spot-story-p {
  font-size: 1rem;
  line-height: 1.68;
  color: var(--fg-dim);
  margin: 0 0 1rem;
}

.spot-story-p:last-child {
  margin-bottom: 0;
}

/* Google Map Location Link (Clean text link with location icon) */
.spot-map-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.15rem;
}

.spot-map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-text);
  background: transparent;
  border: none;
  padding: 0;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.spot-map-link:hover {
  color: var(--accent-strong);
}

.spot-map-link:hover span:first-of-type {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spot-map-link .spot-map-link-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  transition: transform 0.22s var(--ease), stroke 0.2s var(--ease);
}

.spot-map-link:hover .spot-map-link-arrow {
  transform: translate(2.5px, -2.5px);
  stroke: var(--accent-strong);
}

.spot-footer-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
  padding: 0.8rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 1.4rem;
}

.spot-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
}

.spot-modal-footer .btn-cta,
#modalDoneBtn {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.spot-modal-footer .btn-cta:hover,
.spot-modal-footer .btn-cta:focus,
.spot-modal-footer .btn-cta:focus-visible,
.spot-modal-footer .btn-cta:active,
#modalDoneBtn:hover,
#modalDoneBtn:focus,
#modalDoneBtn:focus-visible,
#modalDoneBtn:active {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ---------------- Responsive Adjustments ---------------- */
@media (max-width: 900px) {
  .map-hud-top {
    height: auto;
    padding: 0.65rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand theme"
      "filters filters";
    row-gap: 0.55rem;
    column-gap: 0.75rem;
    align-items: center;
  }

  .hud-left {
    grid-area: brand;
    gap: 0.65rem;
    min-width: 0;
  }

  .hud-title-wrap {
    min-width: 0;
  }

  .hud-title {
    font-size: 1.05rem;
  }

  .hud-right {
    display: contents;
  }

  
  .hud-filters {
    grid-area: filters;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .hud-filter-btn {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
  }

  .hud-bottom-left {
    display: none;
  }

  .hud-bottom-center {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    overflow: hidden;
  }

  .map-hud-bottom {
    padding: 0.5rem 0.8rem;
    gap: 0.6rem;
  }

  .waypoint-quickbar {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .hud-bottom-right {
    flex-shrink: 0;
  }
}

@media (max-width: 800px) {
  .spot-modal-overlay {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 10, 14, 0.88);
  }

  /* Native Bottom Sheet Card (Flex Column prevents grid track squishing) */
  .spot-modal-card {
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    max-width: 640px;
    width: 100%;
    height: 90vh;
    height: 90dvh;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    margin: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    will-change: transform;
    transform: translateZ(0) translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.65);
  }

  
  .spot-carousel-arrow {
    display: none !important;
  }

  /* Subtle Grab Handle at top */
  .spot-modal-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    z-index: 30;
    pointer-events: none;
  }

  /* Flush edge-to-edge photography in bottom sheet */
  .spot-modal-media-col {
    width: 100%;
    flex-shrink: 0;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
  }

  .spot-carousel-container {
    width: 100%;
    aspect-ratio: 3 / 4 !important;
    height: auto !important;
    min-height: 0;
    max-height: none;
    flex-shrink: 0;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: none;
  }

  .carousel-slide-art {
    padding: 1.4rem 1.2rem;
  }

  .spot-modal-content-col {
    width: 100%;
    flex-shrink: 0;
    flex-grow: 1;
    display: block;
    box-sizing: border-box;
    padding: 1.6rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
    overflow-y: visible;
    max-height: none;
  }

  .spot-modal-close {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .spot-modal-overlay {
    padding: 0;
  }

  .spot-modal-card {
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    height: 92vh;
    height: 92dvh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    width: 100%;
    margin: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    will-change: transform;
  }

  .spot-modal-media-col {
    width: 100%;
    flex-shrink: 0;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
  }

  .spot-carousel-container {
    width: 100%;
    aspect-ratio: 3 / 4 !important;
    height: auto !important;
    min-height: 0;
    max-height: none;
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    margin-bottom: 0;
  }

  .spot-modal-content-col {
    width: 100%;
    flex-shrink: 0;
    flex-grow: 1;
    display: block;
    border-radius: 0;
    box-sizing: border-box;
    padding: 1.4rem 1.2rem calc(1.8rem + env(safe-area-inset-bottom));
  }

  .spot-modal-title {
    font-size: 1.4rem;
    margin-bottom: 0.85rem;
  }

  .spot-modal-badge-row {
    margin-bottom: 0.6rem;
  }

  
  .carousel-slide-art {
    padding: 1.2rem 1rem;
  }

  
  
  .spot-story-wrap {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
  }

  .spot-footer-note {
    font-size: 0.72rem;
    padding: 0.65rem 0.8rem;
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   Fullscreen Photo Lightbox Overlay
   ========================================================================== */
.photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  z-index: 1500;
  background: #080A0E;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
  padding: 1.5rem;
  box-sizing: border-box;
}

.photo-lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.lightbox-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.lightbox-stage {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  max-height: 88dvh;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

.lightbox-media-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(88vh - 75px);
  max-height: calc(88dvh - 75px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  display: block;
}

.lightbox-gradient-art {
  width: min(800px, 88vw);
  aspect-ratio: 16/9;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.lightbox-info-bar {
  margin-top: 0.9rem;
  text-align: left;
  max-width: 800px;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lightbox-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.35rem;
  display: block;
}

.lightbox-caption {
  margin: 0;
  font-size: 0.95rem;
  color: #EFE9DC;
  line-height: 1.5;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.lightbox-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-arrow.prev {
  left: 1.5rem;
}

.lightbox-arrow.next {
  right: 1.5rem;
}

/* ---------------- Mobile Lightbox Refinements (Edge-to-Edge True Fullscreen) ---------------- */
@media (max-width: 768px) {
  .photo-lightbox-overlay {
    padding: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    background: #080A0E;
    border-radius: 0;
  }

  .lightbox-close {
    top: max(0.85rem, env(safe-area-inset-top));
    right: max(0.85rem, env(safe-area-inset-right));
    width: 38px;
    height: 38px;
    font-size: 1.35rem;
    background: rgba(18, 20, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .lightbox-stage {
    max-width: 100vw;
    max-width: 100dvw;
    max-height: 100vh;
    max-height: 100dvh;
    width: 100%;
    height: 100%;
    padding: max(3.5rem, calc(env(safe-area-inset-top) + 2.5rem)) max(0.8rem, env(safe-area-inset-right)) max(1.2rem, env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .lightbox-media-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }

  .lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  }

  .lightbox-gradient-art {
    width: 100%;
    max-height: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
  }

  .lightbox-info-bar {
    margin-top: 0.75rem;
    width: 100%;
    max-width: 100%;
    padding: 0 0.4rem;
    box-sizing: border-box;
  }

  .lightbox-tag {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.25rem;
  }

  .lightbox-caption {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .lightbox-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    background: rgba(18, 20, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  
  }

/* ==========================================================================
   Matches the rest of the site: paper, ink, handwriting
   ========================================================================== */
.hud-back-btn {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
}

.hud-back-btn:hover {
  color: var(--on-accent);
}

.hud-eyebrow {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  color: var(--accent-text);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}

.hud-title {
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: -0.015em;
}

.hud-filter-btn {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
}

.hud-filter-btn.is-active,
.zoom-btn:hover {
  color: var(--on-accent);
}

/* map labels read like paper tags written on the map */
.pin-label {
  border-radius: 4px;
  background: var(--card-bg);
  padding: 0.28rem 0.7rem 0.34rem;
}

.pin-tag {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  color: var(--accent-text);
}

.pin-label strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.waypoint-pin:hover .pin-diamond {
  border-color: var(--bg);
}

.waypoint-pin:hover .pin-glyph {
  color: var(--on-accent);
}

.basecamp-marker text {
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
}

.map-compass text {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
}

.wishlist-text {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--fg-faint);
}

.quickbar-btn {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
}

/* the trip log card: no pills, just handwriting and a margin note */
.spot-modal-badge-row {
  align-items: baseline;
  gap: 0.2rem 0.9rem;
}

.spot-meta-badge,
.spot-meta-badge.date {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  letter-spacing: 0;
  text-transform: none;
}

.spot-meta-badge {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent-text);
}

.spot-meta-badge.date {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--fg-faint);
}

.spot-modal-title {
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.spot-story-p {
  font-size: 1.04rem;
  line-height: 1.72;
}

.spot-footer-note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  background: none;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 0.2rem 0 0.2rem 1rem;
  color: var(--fg-dim);
}

.spot-map-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent-text);
}

.slide-overlay-tag {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  color: #FFE2C8;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.lightbox-tag {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #FFD2AE;
}

@media (max-width: 640px) {
  .spot-meta-badge {
    font-size: 1.4rem;
    padding: 0;
  }

  .spot-modal-title {
    font-size: 1.7rem;
  }

  .slide-overlay-tag {
    font-size: 1.3rem;
    padding: 0;
  }
}

/* Photo viewer on phones: the side arrows are just plain, soft chevrons, a hint that there's more to swipe to */
@media (max-width: 768px) {
  .lightbox-arrow,
  .lightbox-arrow:hover {
    width: 36px;
    height: 56px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: rgba(255, 255, 255, 0.62);
    font-size: 2.1rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
    transform: translateY(-50%);
  }

  .lightbox-arrow.prev {
    left: max(0.1rem, env(safe-area-inset-left));
  }

  .lightbox-arrow.next {
    right: max(0.1rem, env(safe-area-inset-right));
  }
}

/* Photo viewer on phones: the close button is a plain x too, with no ring */
@media (max-width: 768px) {
  .lightbox-close,
  .lightbox-close:hover {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.7rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
    transform: none;
  }
}

/* Trip sheet on phones: fewer forced layers, so scrolling it back up no longer blanks the photo and text for a moment */
@media (max-width: 800px) {
  .spot-modal-card {
    background: transparent !important;
    will-change: auto;
  }

  .spot-modal-overlay.is-open .spot-modal-card {
    transform: none;
  }

  .spot-modal-content-col {
    contain: none;
    background: var(--bg);
  }

  .spot-carousel-track {
    will-change: auto;
  }

  .carousel-slide-art {
    transform: none;
  }
}
