/**
 * LOBBY — BUILDING FACADE
 * Full-viewport dark void with a centered building PNG.
 * Transparent glass panes are revealed by per-window hotspot buttons.
 *
 * Naming: BFL (Building Facade Lobby)
 */

/* ── Outer container: full-viewport sky (day) or void (night) ───────────── */

.bfl {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  /* Day sky — shows through transparent areas of the building PNG */
  background: linear-gradient(180deg, #5aa0d0 0%, #88c4ec 40%, #b8dcf7 100%);
  overflow: hidden;
}

/* Night override — re-enabled once Day testing is complete */
.bfl--night {
  background: var(--color-void);
}

/* ── Stage: sized to exact PNG aspect ratio (2304 × 1856) ─────────────────
   Formula: min(92vw, 92vh × ASPECT) × min(92vh, 92vw / ASPECT)
   Guarantees stage = same aspect ratio as PNG, so hotspot % coords map
   pixel-perfectly to PNG pixel coords with zero JS math.
   ──────────────────────────────────────────────────────────────────────── */

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

  /* Fade-in on load */
  opacity: 0;
  animation: bflIn 1.2s var(--ease-gentle, ease) 0.1s forwards;
}

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

/* ── Room preview layer — behind the PNG, reveals through glass panes ───── */
/* DOM order: previews → img → hotspots. z-index makes the order explicit.  */

.bfl__previews {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bfl__preview {
  position: absolute;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 6%;
}

.bfl__preview-art {
  height: 66%;
  max-width: 38%;
  width: auto;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Building PNG fills the stage exactly ───────────────────────────────── */
/* object-fit:fill = no crop, no letterbox (stage matches PNG aspect ratio) */
/* position:relative + z-index:1 places img above preview layer via DOM.    */

.bfl__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* ── Hotspot overlay: covers the full stage ─────────────────────────────── */

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

/* ── Individual hotspot: invisible clickable window overlay ─────────────── */

.bfl__hotspot {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: all;
  border-radius: 2px;
  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 amber glow on hover — mirrors the room spotlight colour */
.bfl__hotspot:hover,
.bfl__hotspot:focus-visible {
  background: rgba(255, 200, 80, 0.20);
  box-shadow:
    inset 0 0 14px 4px rgba(255, 210, 100, 0.28),
          0 0 22px 8px rgba(255, 200,  80, 0.14);
}

/* ── Shared tooltip (repositioned by JS on mouseenter) ──────────────────── */

.bfl__tooltip {
  position: fixed;
  z-index: 200;
  pointer-events: none;

  display: flex;
  flex-direction: column;
  gap: 3px;

  background: rgba(5, 5, 6, 0.93);
  border: 1px solid var(--color-frame);
  border-radius: 3px;
  padding: 10px 14px;
  min-width: 150px;
  max-width: 260px;

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

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

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

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

.bfl__tt-count {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 300;
  color: var(--color-text-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

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

@media (max-width: 480px) {
  .bfl__stage {
    width:  min(100vw, calc(100vh * (2304 / 1856)));
    height: min(100vh, calc(100vw * (1856 / 2304)));
  }
  /* Tooltip too cramped on small screens */
  .bfl__tooltip { display: none; }
}
