/* zone-view.css — the lightbox shell + zone-view photos (card, gallery, /p/find strip).
   Moved out of style.css 2026-10-26 so /p/find can load it; the homepage bundle
   imports it BEFORE style.css (scripts/build-home-bundle.mjs), where it sat no
   later than any rule that overrides it. */

/* ─── Seat View Lightbox ─────────────────────────────────────────────────── */
.lightbox-overlay {
  overscroll-behavior: contain;
  position: fixed;
  inset: 0;
  z-index: 1010; /* above .tp-modal — zone compare opens the zone-view photo */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Safe-area padding (2026-08-22) — the scrim is inset:0 so it now covers
     the status bar and home indicator too; padding it keeps the CARD inside
     the safe area without touching any of the card's own vh-based max-heights. */
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.lightbox-overlay.lightbox-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--black-rgb),0.85);
}
.lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
}
.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 32px;
  height: 32px;
  background: rgba(var(--surface-rgb),0.1);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
@media (hover: hover) { .lightbox-close:hover { background: rgba(var(--surface-rgb),0.2); } }

/* --- Zone view photo (card + big view in #seat-lightbox) --- */
.zone-view-figure {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 12px;
  padding: 0;
  border: 1px solid rgba(var(--surface-rgb), 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(var(--surface-rgb), 0.04);
  cursor: zoom-in;
}
.zone-view-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Blur-up (blur-up.js, 2026-10-17): while the photo loads, its own box shows
   a tiny generated thumbnail as a blurred background; .blur-up is removed on
   load and the real photo sharpens in place. */
.blur-up {
  background-size: cover;
  background-position: center;
  filter: blur(12px);
}
.zone-view-figure img, img.zone-view-big, .hero-poster { transition: filter 0.4s ease; }
.zone-view-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(var(--black-rgb), 0.6);
  color: var(--white);
}
@media (hover: hover) { .zone-view-figure:hover .zone-view-zoom { background: rgba(var(--black-rgb), 0.8); } }
.zone-view-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  border-style: dashed;
  font-size: 13px;
  color: var(--text-secondary);
}
/* Sized from the photo's own ratio (--ar, set by blur-up.js) so the box and its
   blur-up thumbnail exist before the photo loads, at the same size as after. */
.lightbox-content img.zone-view-big { width: min(90vw, calc(75vh * var(--ar, 0.75))); height: auto; }
/* Gallery box is a fixed size whatever the photo's shape (owner 2026-10-26):
   the photo is contained inside it on a black ground. */
.lightbox-content .zone-view-stage {
  width: min(92vw, 960px);
  height: min(70vh, 640px);
  background: rgb(var(--black-rgb));
  border-radius: var(--radius-md);
  overflow: hidden;
}
.lightbox-content .zone-view-stage.has-thumbs { height: min(60vh, 600px); }
.lightbox-content .zone-view-stage img.zone-view-big {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
  background-size: contain;
  background-repeat: no-repeat;
}
.lightbox-content .zone-view-bar,
.lightbox-content .zone-view-thumbs,
.lightbox-content .zone-view-credit { width: min(92vw, 960px); }
.zone-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}
.zone-view-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.zone-view-bar .sm-btn { flex: 0 0 auto; padding: 0 16px; }
/* Fan photos + gallery (zone-view-list.js, owner 2026-10-26). */
.zone-view-grid { display: grid; gap: 10px; margin-top: 12px; }
.zone-view-grid--2 { grid-template-columns: 1fr 1fr; }
.zone-view-grid .zone-view-figure { margin-top: 0; }
.zone-view-grid--2 .zone-view-figure { aspect-ratio: 4 / 3; }
.zone-view-cell { min-width: 0; }
.zone-view-cell .zone-view-credit { margin-top: 4px; }
.zone-view-meta:has(.zone-view-more) { justify-content: flex-end; }
.zone-view-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.zone-view-credit {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
/* The lightbox backdrop is always dark (rgba black 0.85) — its text stays light in both themes. */
.lightbox-content .zone-view-title { color: var(--white); }
.lightbox-content .zone-view-credit { width: 100%; color: rgba(var(--white-rgb), 0.75); }
.zone-view-more {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold-text);
  cursor: pointer;
}
@media (hover: hover) { .zone-view-more:hover { text-decoration: underline; } }
.zone-view-stage { position: relative; display: flex; justify-content: center; }
.zone-view-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--black-rgb), 0.6);
  color: var(--white);
  cursor: pointer;
}
.zone-view-prev { left: 8px; }
.zone-view-next { right: 8px; }
@media (hover: hover) { .zone-view-nav:hover { background: rgba(var(--black-rgb), 0.8); } }
.zone-view-thumbs {
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}
.zone-view-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(var(--white-rgb), 0.08);
  opacity: 0.55;
  cursor: pointer;
}
.zone-view-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zone-view-thumb.is-active { border-color: var(--white); opacity: 1; }
@media (hover: hover) { .zone-view-thumb:hover { opacity: 1; } }


/* /p/find zone panel strip (zone-view-gallery.js zoneViewStripEl, 2026-10-26):
   one photo at a fixed height, "+N รูป" badge, credit underneath. */
.zone-view-strip { margin-top: 0; } /* the find panel spaces its own children */
.zone-view-strip .zone-view-figure { margin-top: 0; height: 120px; aspect-ratio: auto; }
.zone-view-strip .zone-view-credit { margin-top: 4px; }
.zone-view-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--black-rgb), 0.6);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
}

/* Gallery as one raised card (owner 2026-10-26, option C): a lighter layer over
   the always-dark backdrop, a faint theme-red border, and the selected thumbnail
   in theme red. The seat-map view in the same #seat-lightbox is untouched. */
.lightbox-content:has(.zone-view-stage) {
  box-sizing: border-box;
  width: min(92vw, 992px);
  padding: 16px;
  gap: 12px;
  background: linear-gradient(rgba(var(--white-rgb), 0.06), rgba(var(--white-rgb), 0.06)), rgb(var(--black-rgb)); /* opaque */
  border: 1px solid rgba(var(--accent-gold-rgb), 0.55);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(var(--black-rgb), 0.6), 0 0 0 1px rgba(var(--black-rgb), 0.4);
}
.lightbox-content:has(.zone-view-stage) .zone-view-bar,
.lightbox-content:has(.zone-view-stage) .zone-view-stage,
.lightbox-content:has(.zone-view-stage) .zone-view-thumbs,
.lightbox-content:has(.zone-view-stage) .zone-view-credit { width: 100%; }
/* Close button = the 38px .sm-btn height, top-aligned with the title bar. */
.lightbox-content:has(.zone-view-stage) .zone-view-bar { padding-right: 50px; min-height: 38px; }
.lightbox-content:has(.zone-view-stage) .lightbox-close { top: 16px; right: 16px; width: 38px; height: 38px; color: var(--white); background: rgba(var(--white-rgb), 0.1); }
.lightbox-content .zone-view-stage { border: 1px solid rgba(var(--white-rgb), 0.12); }
.lightbox-content .zone-view-thumb.is-active { border-color: rgb(var(--accent-gold-rgb)); }
