/* ── IMAGE LIGHTBOX ─────────────────────────────
   Contained macOS-style window on desktop, fullscreen on mobile.
   Backdrop sits above the drawer at z:800 > drawer z:600 so gallery
   images open on top of an open drawer.

   Structure:
     .image-lightbox          — fixed backdrop
       .image-lightbox-window — contained window (rounded, chrome)
         .window-bar          — traffic lights + title + zoom
         .lightbox-body       — nav arrows + stage
           .lightbox-nav-prev/next
           .lightbox-stage    — <img> inside

   See 09b-image-lightbox.js. */
.image-lightbox{
  position:fixed;inset:0;z-index:800;
  display:flex;align-items:center;justify-content:center;
  padding:16px;
  background:rgba(3,3,7,.76);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  animation:fadeIn .2s var(--ease);
  user-select:none;-webkit-user-select:none
}
.image-lightbox[hidden]{display:none}

.image-lightbox-window{
  width:min(1180px, calc(100vw - 32px));
  height:min(820px, calc(100vh - 32px));
  border:1px solid rgba(255,255,255,.11);
  border-radius:22px;
  background:#0b0b10;
  box-shadow:0 40px 120px rgba(0,0,0,.72);
  overflow:hidden;
  display:flex;flex-direction:column;
  animation:demoIn .4s var(--ease)
}

/* Bar-specific tweaks on the shared .window-bar chrome */
.image-lightbox-bar{background:rgba(14,14,20,.96)}

.lightbox-body{
  flex:1;min-height:0;position:relative;
  display:flex;
  background:radial-gradient(circle at 50% 0,rgba(167,139,250,.05),transparent 40%),#07070b
}

.lightbox-stage{
  flex:1;min-width:0;min-height:0;
  display:flex;align-items:center;justify-content:center;
  padding:32px 56px;
  overflow:hidden
}
.lightbox-image{
  max-width:100%;max-height:100%;
  width:auto;height:auto;
  display:block;
  transform-origin:center center;
  transition:transform .18s var(--ease);
  box-shadow:0 30px 80px rgba(0,0,0,.55);
  border-radius:6px;
  -webkit-user-drag:none;user-drag:none
}
/* JS toggles this while dragging so pan updates land instantly
   instead of chasing the transition. */
.lightbox-image.is-panning{transition:none}

/* Page counter — small mono chip inside the address bar */
.lightbox-counter{
  font-family:'JetBrains Mono',monospace;font-size:var(--fs-xs);
  color:rgba(255,255,255,.55);letter-spacing:.08em;
  padding-left:10px;border-left:1px solid rgba(255,255,255,.14);
  margin-left:6px;flex-shrink:0
}

/* Zoom stepper in window-tools */
.lightbox-zoom{
  display:flex;align-items:center;gap:8px;
  padding:4px 6px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.1);
  border-radius:9px;
  font-family:'JetBrains Mono',monospace;font-size:var(--fs-xs);
  color:rgba(255,255,255,.85)
}
.lightbox-zoom-btn{
  width:24px;height:24px;
  display:grid;place-items:center;
  border:none;background:transparent;color:inherit;
  cursor:pointer;border-radius:5px;
  transition:background .2s
}
.lightbox-zoom-btn:hover{background:rgba(255,255,255,.08)}
.lightbox-zoom-btn:disabled{opacity:.4;cursor:not-allowed}

/* Prev/Next arrows — floating over the stage */
.lightbox-nav{
  position:absolute;top:50%;transform:translateY(-50%);
  width:40px;height:40px;
  display:grid;place-items:center;
  border-radius:50%;
  background:rgba(20,20,28,.85);
  border:1px solid rgba(255,255,255,.14);
  color:rgba(255,255,255,.85);
  cursor:pointer;
  transition:background .2s,border-color .2s,color .2s;
  z-index:1
}
.lightbox-nav:hover{
  background:rgba(30,30,40,.95);
  border-color:rgba(167,139,250,.4);
  color:#fff
}
.lightbox-nav[hidden]{display:none}
.lightbox-nav-prev{left:12px}
.lightbox-nav-next{right:12px}

/* Mobile: fullscreen — no rounded corners, no padding, edge-to-edge. */
@media(max-width:640px){
  .image-lightbox{padding:0}
  .image-lightbox-window{
    width:100vw;height:100dvh;
    max-width:none;max-height:none;
    border-radius:0;border:0
  }
  .lightbox-stage{padding:16px 8px}
  .lightbox-nav{width:36px;height:36px}
  .lightbox-nav-prev{left:6px}
  .lightbox-nav-next{right:6px}
  .lightbox-counter{display:none}
  .lightbox-zoom{padding:2px 4px}
  .lightbox-zoom-btn{width:22px;height:22px}
}
