/* ------------------------------------------------------------
   TRIP PAGES — hero title card, four scroll-story transitions,
   a persistent route map, prev/next chain.

   --scroll-factor controls how much scrolling each pinned photo
   requires before releasing — raise it to slow the whole journey
   down, lower it to speed it up.
------------------------------------------------------------- */

:root {
  --scroll-factor: 3.5;
}

.site-nav__index-link {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.3s var(--ease);
}
.site-nav__index-link:hover { color: var(--accent); }

/* ---------- Trip hero ---------- */
.trip-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.trip-hero__media {
  position: absolute;
  inset: 0;
  background: #000;
}

.trip-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Portrait hero photos: show the full frame instead of cropping
   into the landscape hero box. */
.trip-hero__media img.is-portrait {
  object-fit: contain;
  background: #000;
}

.trip-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 45%, rgba(0,0,0,0.35) 100%);
}

.trip-hero__content {
  position: relative;
  z-index: 2;
  padding: 0 clamp(24px, 6vw, 72px) clamp(70px, 11vh, 130px);
  max-width: 760px;
}

.trip-hero__index {
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 16px;
}

.trip-hero__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.98;
  margin-bottom: 14px;
}

.trip-hero__loc {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 20px;
}

.trip-hero__desc {
  color: var(--fg-dim);
  font-weight: 300;
  line-height: 1.7;
  max-width: 520px;
}

.trip-hero__scroll-cue {
  position: absolute;
  bottom: 40px;
  right: clamp(24px, 6vw, 72px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.trip-hero__scroll-cue span {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--accent) 60%, transparent);
  animation: cueMove 2s ease-in-out infinite;
}

.trip-hero__scroll-cue p {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

@keyframes cueMove {
  0%   { transform: translateY(-10px); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* ---------- Section framing ---------- */
.section-head {
  padding: clamp(70px, 12vh, 130px) clamp(24px, 8vw, 100px) clamp(30px, 6vh, 60px);
  max-width: 760px;
}

.section-head__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  margin: 14px 0 16px;
}

.section-head__desc {
  color: var(--fg-dim);
  font-weight: 300;
  line-height: 1.7;
  max-width: 520px;
}

/* ---------- Prev / Next chain ---------- */
.trip-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.trip-nav__link {
  padding: clamp(40px, 8vh, 90px) clamp(24px, 6vw, 60px);
  transition: background 0.4s var(--ease);
}

.trip-nav__link:hover {
  background: var(--bg-raised);
}

.trip-nav__next {
  text-align: right;
  border-left: 1px solid var(--line);
}

.trip-nav__label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 12px;
}

.trip-nav__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
}

@media (max-width: 720px) {
  .trip-nav { grid-template-columns: 1fr; }
  .trip-nav__next { border-left: none; border-top: 1px solid var(--line); text-align: left; }
}

/* ==============================================================
   SCENE — a photo pins in place and keeps zooming for the length
   of the section before releasing to the next one.
============================================================== */

.scene {
  position: relative;
  height: calc(100vh * var(--scroll-factor));
}

.scene__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.scene__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  will-change: transform;
}

.scene__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* Portrait photos: rather than letterboxing a vertical photo inside
   this landscape-shaped full-bleed box (object-fit: contain leaves
   black bars either side), shrink the box itself to the photo's own
   2:3 proportions — full pin height, width computed from that ratio,
   centered — so the image fills its own box edge-to-edge with zero
   internal letterboxing. Page/section background is still visible
   outside the narrower box; that's expected, not a bug. */
.scene__media:has(img.is-portrait) {
  inset: auto;
  top: 0;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 100%;
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
}

.scene__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.12) 42%, rgba(0,0,0,0.32) 100%);
  pointer-events: none;
}

.scene__caption {
  position: relative;
  z-index: 2;
  padding: 0 clamp(24px, 6vw, 72px) clamp(64px, 10vh, 120px);
  max-width: 620px;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

.scene.is-active .scene__caption {
  opacity: 1;
  transform: translateY(0);
}

.scene__caption-index {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 12px;
}

.scene__caption-text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg-dim);
  font-weight: 300;
}

@media (prefers-reduced-motion: reduce) {
  .scene__caption { transition: none !important; }
}

/* ==============================================================
   STACK — photos pin in place, zoom further, and crossfade into
   the next one before scrolling is allowed to continue. Used for
   moments meant to linger rather than pass by.
============================================================== */

.stack {
  position: relative;
  height: calc(var(--frames, 3) * 100vh * var(--scroll-factor));
}

.stack__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.stack__frame {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.stack__frame:first-child { opacity: 1; }

.stack__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* Same "size the box to the photo's own ratio" fix as .scene__media —
   see comment there. */
.stack__frame:has(img.is-portrait) {
  inset: auto;
  top: 0;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 100%;
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
}

.stack__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.12) 42%, rgba(0,0,0,0.32) 100%);
  pointer-events: none;
  z-index: 2;
}

.stack__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 0 clamp(24px, 6vw, 72px) clamp(64px, 10vh, 120px);
  max-width: 620px;
}

/* ==============================================================
   SWIPE — the frame pins and vertical scroll pans sideways
   through a strip of photos, like turning to look down a street.
============================================================== */

.swipe {
  position: relative;
  height: calc(var(--frames, 4) * 100vh * var(--scroll-factor));
}

.swipe__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.swipe__track {
  display: flex;
  height: 100%;
  width: calc(var(--frames, 4) * 100%);
  will-change: transform;
}

.swipe__frame {
  position: relative;
  flex: 0 0 calc(100% / var(--frames, 4));
  height: 100%;
  background: #000;
}

.swipe__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* .swipe__frame's own width drives the JS scroll math (each frame is
   exactly one viewport wide, panned via translateX), so unlike the
   other scroll-story patterns we can't resize the frame itself for
   portrait photos without breaking that math. Instead size the <img>
   to the photo's own 2:3 ratio and center it within the still
   full-width frame — same "no internal letterboxing" result, just
   with the narrowing happening on the image rather than its parent. */
.swipe__frame img.is-portrait {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  height: 100%;
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
  object-fit: cover;
}

.swipe__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 45%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
  z-index: 2;
}

.swipe__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 0 clamp(24px, 6vw, 72px) clamp(64px, 10vh, 120px);
  max-width: 620px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.swipe__caption.is-visible {
  opacity: 1;
}

.swipe__progress {
  position: absolute;
  bottom: clamp(30px, 6vh, 60px);
  right: clamp(24px, 6vw, 72px);
  z-index: 3;
  display: flex;
  gap: 8px;
}

.swipe__progress span {
  width: 18px;
  height: 2px;
  background: rgba(244, 242, 238, 0.3);
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}

.swipe__progress span.is-current {
  background: var(--accent);
  width: 30px;
}

/* ==============================================================
   WIPE — photos pin in place while the next one sweeps in on a
   diagonal, like a page being turned rather than crossfaded.
============================================================== */

.wipe {
  position: relative;
  height: calc(var(--frames, 2) * 100vh * var(--scroll-factor));
}

.wipe__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.wipe__frame {
  position: absolute;
  inset: 0;
  background: #000;
}

.wipe__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Same "size the box to the photo's own ratio" fix as .scene__media —
   see comment there. The clip-path sweep JS applies to this frame
   keeps working the same way, just against the narrower box. */
.wipe__frame:has(img.is-portrait) {
  inset: auto;
  top: 0;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 100%;
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
}

.wipe__frame--incoming {
  clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%);
  will-change: clip-path;
}

.wipe__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.12) 42%, rgba(0,0,0,0.32) 100%);
  pointer-events: none;
  z-index: 2;
}

.wipe__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 0 clamp(24px, 6vw, 72px) clamp(64px, 10vh, 120px);
  max-width: 620px;
}

@media (prefers-reduced-motion: reduce) {
  .stack__frame, .swipe__track, .swipe__caption, .wipe__frame--incoming { transition: none !important; }
}

/* ==============================================================
   LOCATION MAP — fixed to the side for the whole page. The
   country's real outline, a title, and a few labeled pins.
============================================================== */

.location-map {
  position: absolute;
  top: 110px;
  right: clamp(20px, 5vw, 56px);
  z-index: 500;
  width: 210px;
  padding: 16px 16px 14px;
  background: rgba(9, 9, 9, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.location-map__title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 12px;
}

.location-map__svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.location-map__outline {
  fill: rgba(244, 242, 238, 0.09);
  stroke: rgba(244, 242, 238, 0.4);
  stroke-width: 1;
}

.location-map__pin {
  fill: #e2493d;
  stroke: rgba(5, 5, 5, 0.6);
  stroke-width: 0.6;
}

.location-map__pin-label {
  font-family: var(--font-sans);
  font-size: 8.5px;
  fill: var(--fg-dim);
}

@media (max-width: 980px) {
  .location-map { display: none; }
}
