/**
 * LOBBY — BUILDING PHOTO
 * Full-viewport building JPEG with per-zone hotspot overlays and popup cards.
 *
 * Naming: BFPL (Building Photo Lobby)
 * Image dimensions: 2304 × 1856 (same as Building02 PNG — same aspect ratio)
 */

/* ── Outer container: full-viewport dark void ───────────────────────────── */

.bfpl {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  background: var(--color-void, #050506);
  overflow: hidden;
}

/* ── Stage: sized to exact image aspect ratio (2304 × 1856) ───────────────
   Hotspot % coords are relative to stage dimensions, which match the image
   pixel dimensions exactly — zero JS math needed for mapping.
   ──────────────────────────────────────────────────────────────────────── */

.bfpl__stage {
  position: relative;
  width:  min(92vw, calc(92vh * (2304 / 1856)));
  height: min(92vh, calc(92vw * (1856 / 2304)));
  flex-shrink: 0;

  opacity: 0;
  animation: bfplIn 1.2s var(--ease-gentle, ease) 0.1s forwards;
}

@keyframes bfplIn {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Building JPEG fills the stage exactly ──────────────────────────────── */

.bfpl__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;   /* no crop, no letterbox — stage matches image ratio */
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ── Hotspot overlay layer ──────────────────────────────────────────────── */

.bfpl__hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;   /* container transparent; children re-enable */
}

/* ── Individual hotspot: invisible clickable zone ───────────────────────── */

.bfpl__hotspot {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: all;
  padding: 0;
  outline: none;
  transition:
    background var(--duration-normal, 0.25s) var(--ease-gentle, ease),
    box-shadow  var(--duration-normal, 0.25s) var(--ease-gentle, ease);
}

/* Warm glow on hover — lights up the window/storefront */
.bfpl__hotspot:hover,
.bfpl__hotspot:focus-visible {
  background: rgba(255, 200, 80, 0.14);
  box-shadow:
    inset 0 0 20px 6px rgba(255, 210, 100, 0.22),
          0 0 28px 8px rgba(255, 200,  80, 0.10);
  outline: 1px solid rgba(255, 200, 80, 0.25);
  outline-offset: -1px;
}

/* ── Popup card (shared, repositioned by JS on each mouseenter) ─────────── */

.bfpl__popup {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  width: 280px;

  background: rgba(5, 5, 6, 0.96);
  border: 1px solid rgba(200, 185, 154, 0.15);
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 0   32px rgba(0, 0, 0, 0.3);

  /* Hidden by default; shown by JS adding .bfpl__popup--on */
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity   0.20s var(--ease-gentle, ease),
    transform 0.20s var(--ease-gentle, ease);
}

.bfpl__popup--on {
  opacity: 1;
  transform: translateY(0);
}

/* ── Popup visual area (16:9 preview image or fallback thumbnail strip) ─── */

.bfpl__popup-visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0c0c0f;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Room screenshot (generated by generate-room-previews.js) */
.bfpl__popup-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback: artwork thumbnail strip when preview screenshot doesn't exist */
.bfpl__popup-strip {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
}

.bfpl__popup-thumb {
  height: 80%;
  max-width: 30%;
  object-fit: cover;
  flex-shrink: 0;
  filter: brightness(0.85);
}

/* ── Popup text info ────────────────────────────────────────────────────── */

.bfpl__popup-info {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bfpl__popup-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bfpl__popup-sub {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.07em;
}

.bfpl__popup-count {
  font-family: var(--font-body);
  font-size: 0.70rem;
  font-weight: 300;
  color: var(--color-text-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .bfpl__stage {
    width:  min(98vw, calc(98vh * (2304 / 1856)));
    height: min(98vh, calc(98vw * (1856 / 2304)));
  }
}

@media (max-width: 480px) {
  .bfpl__stage {
    width:  min(100vw, calc(100vh * (2304 / 1856)));
    height: min(100vh, calc(100vw * (1856 / 2304)));
  }
  /* Popup too cramped on small screens — rely on tap-to-enter directly */
  .bfpl__popup { display: none; }
}
