/* Photo strip + lightbox — Xinjiang itinerary map.
   Uses the page's own CSS custom properties so light/dark follow the theme. */

.xp-strip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: calc(100% - 32px);
  padding: 8px 9px 8px 10px;
  background: color-mix(in srgb, var(--paper-2) 94%, transparent);
  border: 1px solid var(--ink);
  box-shadow: -3px 3px 0 var(--gold);
}
.xp-strip[hidden] { display: none; }

.xp-strip-count {
  flex: 0 0 auto;
  padding-bottom: 2px;
  font-family: "Oswald", "Noto Sans SC", sans-serif;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}

.xp-strip-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.xp-strip-track::-webkit-scrollbar { display: none; }

.xp-thumb {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-3);
  cursor: pointer;
  line-height: 0;
  transition: transform .16s ease, box-shadow .16s ease;
}
.xp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xp-thumb:hover,
.xp-thumb:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--gold);
  outline: none;
}

/* ---------- lightbox ---------- */
.xp-lb {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 20px 20px;
  background: rgba(16, 11, 6, .94);
}
.xp-lb[hidden] { display: none; }

.xp-lb-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: auto;
  max-width: 96vw;
}

.xp-lb-fig {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  margin: 0;
  min-width: 0;
  max-width: calc(96vw - 116px);
}
.xp-lb-img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid rgba(244, 232, 201, .35);
  background: #0b0906;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.xp-lb-cap {
  max-width: 68ch;
  color: #f4e8c9;
  font-size: .92rem;
  line-height: 1.4;
  text-align: center;
}

.xp-lb-close {
  position: absolute;
  top: -32px;
  left: -2px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #f4e8c9;
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
}
.xp-lb-close:hover { color: var(--gold); }

.xp-lb-tools {
  position: absolute;
  top: -30px;
  right: -2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.xp-lb-count {
  color: #c7b792;
  font-family: "Oswald", "Noto Sans SC", sans-serif;
  font-size: .72rem;
  letter-spacing: .14em;
}
.xp-lb-play {
  width: 26px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(244, 232, 201, .45);
  background: none;
  color: #f4e8c9;
  font-size: .6rem;
  line-height: 1;
  cursor: pointer;
}
.xp-lb-play:hover,
.xp-lb-play:focus-visible { background: rgba(248, 239, 212, .22); outline: none; }

.xp-lb-rail {
  display: flex;
  gap: 5px;
  max-width: 100%;
  padding-top: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.xp-lb-rail::-webkit-scrollbar { display: none; }
.xp-lb-rail[hidden] { display: none; }
.xp-lb-dot {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 232, 201, .28);
  background: none;
  cursor: pointer;
  line-height: 0;
  opacity: .55;
  transition: opacity .15s ease, border-color .15s ease;
}
.xp-lb-dot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xp-lb-dot:hover { opacity: .85; }
.xp-lb-dot.is-current {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.xp-all-btn {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  background: transparent;
  color: inherit;
  font-family: "Oswald", "Noto Sans SC", sans-serif;
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.xp-all-btn:hover,
.xp-all-btn:focus-visible { background: var(--ink); color: var(--paper-2); outline: none; }

.xp-lb-nav {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(244, 232, 201, .45);
  border-radius: 50%;
  background: rgba(248, 239, 212, .08);
  color: #f4e8c9;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background .15s ease;
}
.xp-lb-nav:hover:not(:disabled) { background: rgba(248, 239, 212, .22); }
.xp-lb-nav:disabled { opacity: .28; cursor: default; }

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

@media (max-width: 640px) {
  .xp-strip { left: 10px; right: auto; bottom: 10px; max-width: calc(100% - 20px); gap: 7px; padding: 6px 7px; }
  .xp-thumb { width: 62px; height: 62px; }
  .xp-strip-count { font-size: .6rem; letter-spacing: .08em; }

  .xp-lb { padding: 40px 10px 14px; background: rgba(16, 11, 6, .97); }
  .xp-lb-inner { gap: 0; max-width: 100%; }
  .xp-lb-fig { max-width: 100%; }
  .xp-lb-img { max-height: 62vh; }
  .xp-lb-tools { top: -28px; }
  .xp-lb-dot { width: 38px; height: 38px; }
  .xp-all-btn { font-size: .7rem; padding: 5px 8px; }
  .xp-lb-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    background: rgba(16, 11, 6, .68);
    border-color: rgba(244, 232, 201, .62);
  }
  .xp-lb-prev { left: 4px; }
  .xp-lb-next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-thumb, .xp-lb-nav { transition: none; }
  .xp-thumb:hover, .xp-thumb:focus-visible { transform: none; }
}
