/* Home uses a compact photo rail on the same canvas as the trip CTA. */
[data-traveler-gallery] {
  --travel-photo-width: clamp(152px, 15vw, 222px);
  --travel-photo-height: calc(var(--travel-photo-width) * .8);
  --travel-photo-gap: clamp(14px, 1.25vw, 20px);
  --travel-photo-rise: 0px;
  --travel-edge-fade: clamp(16px, 4.5vw, 64px);
  position: relative;
  width: min(100%, 1440px);
  margin-inline: auto;
  background: transparent;
}

@media (max-width: 599px) {
  [data-traveler-gallery] {
    --travel-photo-width: clamp(142px, 42vw, 176px);
    margin-top: 44px;
  }
}

[data-traveler-gallery][data-gallery-ready] {
  display: grid;
  grid-template: "stage" auto / minmax(0, 1fr);
  overflow: visible;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
  scroll-margin-block: 78px 18px;
}

[data-traveler-gallery] .traveler-gallery-viewport {
  grid-area: stage;
  align-self: start;
  min-width: 0;
  overflow: clip;
}

[data-traveler-gallery][data-gallery-ready] .travel-cta-track {
  box-sizing: border-box;
  padding-block: 12px 16px;
  animation: none;
  transition: opacity .18s ease;
  mask: linear-gradient(to right, transparent,
    rgb(0 0 0 / .1) calc(var(--travel-edge-fade) * .25),
    rgb(0 0 0 / .5) calc(var(--travel-edge-fade) * .5),
    rgb(0 0 0 / .9) calc(var(--travel-edge-fade) * .75),
    #000 var(--travel-edge-fade), #000 calc(100% - var(--travel-edge-fade)),
    rgb(0 0 0 / .9) calc(100% - var(--travel-edge-fade) * .75),
    rgb(0 0 0 / .5) calc(100% - var(--travel-edge-fade) * .5),
    rgb(0 0 0 / .1) calc(100% - var(--travel-edge-fade) * .25), transparent)
    var(--travel-flat-scroll, 0px) 0 / var(--travel-flat-width, 100vw) 100% no-repeat;
}

[data-traveler-gallery][data-gallery-ready] img { -webkit-user-drag: none; }
[data-traveler-gallery][data-dragging],
[data-traveler-gallery][data-dragging] .traveler-photo-trigger { cursor: grabbing; }

.traveler-photo-tile {
  display: block;
  width: var(--travel-photo-width);
}

.traveler-photo-trigger {
  padding: 0;
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.traveler-photo-surface {
  position: relative;
  display: block;
  width: 100%;
  height: var(--travel-photo-height);
  overflow: hidden;
  border-radius: 11px;
  background: var(--surface-muted, #f4f1ec);
  box-shadow: 0 9px 20px -14px rgb(42 35 29 / .42);
  transition: scale .21s ease;
}

.travel-cta-photo .traveler-photo-surface img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

[data-traveler-gallery] .travel-cta-photo[data-traveler-place="Xishuangbanna"] img { object-position: 50% 50%; }
[data-traveler-gallery] .travel-cta-photo[data-traveler-place="Great Wall"] img { object-position: 50% 52%; }
[data-traveler-gallery] .travel-cta-photo[data-traveler-place="Yangshuo"] img { object-position: 50% 58%; }
[data-traveler-gallery] .travel-cta-photo[data-traveler-place="Chengdu"] img { object-position: 50% 58%; }
[data-traveler-gallery] .travel-cta-photo[data-traveler-place="Mutianyu"] img { object-position: 50% 52%; }
[data-traveler-gallery] .travel-cta-photo[data-traveler-place="Yunnan"] img { object-position: 50% 60%; }

.traveler-photo-label {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-family: inherit;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-soft, #554c44);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  [data-traveler-gallery]:not([data-dragging], [data-review-open]) .traveler-photo-trigger:hover .traveler-photo-surface {
    scale: 1.04;
  }
}

.traveler-photo-trigger:focus-visible { outline: 2px solid var(--cinnabar, #af3828); outline-offset: 4px; }
[data-traveler-gallery][data-review-open] .travel-cta-track { opacity: .16; }

.traveler-review-dialog {
  position: fixed;
  inset: var(--traveler-review-top, 16px) 0 auto;
  box-sizing: border-box;
  width: min(calc(100% - 32px), 416px);
  max-width: none;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: var(--ink, #211f1a);
  user-select: text;
}

.traveler-review-dialog::backdrop { background: transparent; }

.traveler-review-card {
  --spotlight-x: 20%;
  --spotlight-y: 14%;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 4.8vw, 25px);
  border: 0;
  border-radius: 24px;
  background: radial-gradient(ellipse at 17% 0%, #262626, #131313 63%);
  color: #f6f5f4;
  box-shadow: 0 20px 47px -19px rgb(22 20 18 / .55);
}

.traveler-review-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity .29s ease;
  z-index: -1;
  background: radial-gradient(245px circle at var(--spotlight-x) var(--spotlight-y),
    rgb(255 251 244 / .17), rgb(255 251 244 / .095) 35%, transparent 100%);
}

.traveler-review-card[data-spotlight]::before { opacity: 1; }

.traveler-review-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: calc(100% - 42px);
  margin-bottom: 18px;
  padding: 3px;
  border-radius: 15px;
  background: #33302f;
  font: 600 12px/1.4 Inter, sans-serif;
}
.traveler-review-tabs button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f0d6bc;
  font: inherit;
  cursor: pointer;
}
.traveler-review-tabs button[aria-selected="true"] { background: #f4eee8; color: #322a25; }
.traveler-review-tabs button[aria-selected="false"]:hover { background: #48403c; }
.traveler-review-tabs button:focus-visible, .traveler-journal-read:focus-visible { outline: 2px solid #f3d2a9; outline-offset: 2px; }

.traveler-journal-cover {
  display: block;
  width: 100%;
  height: clamp(140px, 23dvh, 200px);
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 42%;
}
#journal-panel .traveler-journal-byline { margin: 16px 0 4px; font-size: 12px; color: #d2bba4; }
#journal-panel h2 { margin: 0; color: inherit; font: 500 clamp(24px, 5vw, 30px)/1.1 Fraunces, Georgia, serif; }
#journal-panel p { margin: 10px 0 0; color: #efedeb; font: 400 15px/1.55 Inter, sans-serif; }
.traveler-journal-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f4eee8;
  color: #322a25;
  font: 600 14px/1.4 Inter, sans-serif;
  text-decoration: none;
}
.traveler-journal-read:hover { background: #fff; }
.traveler-review-image {
  display: block;
  width: 100%;
  height: clamp(134px, 23dvh, 192px);
  margin: 19px 0 0;
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 60%;
  background: #2a2725;
  cursor: zoom-out;
}

.traveler-review-header { display: grid; justify-items: start; gap: 10px; padding-right: 43px; }

.traveler-review-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  overflow: hidden;
  border-radius: 50%;
  background: #534239;
  color: #fcf0e5;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .13);
  font-size: 14px;
  font-weight: 650;
}

.traveler-review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.traveler-review-avatar img[data-avatar-crop] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--avatar-width);
  max-width: none;
  height: auto;
  transform: translate(var(--avatar-x), var(--avatar-y));
}
.traveler-review-byline { min-width: 0; overflow-wrap: anywhere; }
.traveler-review-byline h2 {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: 21px;
  font-weight: 610;
  line-height: 1.16;
  letter-spacing: -.025em;
}
.traveler-review-trip { margin: 5px 0 0; color: #bab6b2; font-size: 13px; line-height: 1.35; }

.traveler-review-close {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 2px;
  border: 1px solid rgb(255 255 255 / .11);
  border-radius: 50%;
  background: rgb(255 255 255 / .075);
  color: inherit;
  font: 23px/1 system-ui, sans-serif;
  cursor: pointer;
}
.traveler-review-close:hover { background: rgb(255 255 255 / .16); }
.traveler-review-close:focus-visible,
.traveler-review-source:focus-visible { outline: 2px solid #f3d2a9; outline-offset: 2px; }

.traveler-review-preview { margin: 15px 0 0; color: #d2bba4; font-size: 11px; font-weight: 600; }
#traveler-review-text {
  margin: 9px 0 0;
  color: #efedeb;
  font-size: 15px;
  line-height: 1.63;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.traveler-review-source {
  display: inline-block;
  margin-top: 11px;
  color: #f0d6bc;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.traveler-review-dialog [hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  [data-traveler-gallery][data-gallery-ready] { touch-action: auto; cursor: auto; }

  [data-traveler-gallery] .traveler-gallery-viewport {
    overflow: auto hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  [data-traveler-gallery][data-gallery-ready] .travel-cta-track,
  .traveler-photo-surface,
  .traveler-review-card::before { transition: none; }

  [data-traveler-gallery][data-gallery-ready] .travel-cta-track { mask: none; }
}
