/* EBWS manuals — screenshot lightbox
   Click a screenshot to enlarge it in an overlay on the same page.
   Zoom with the +/- buttons, the mouse wheel, or a two-finger pinch; drag to pan; click (or Esc) to close.
   Self-contained; loaded by every manual next to manual.css. */

figure.fig .win__body img { cursor: zoom-in; }

.lb-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(11, 15, 21, 0.92);
  -webkit-user-select: none; user-select: none;
  touch-action: none;                 /* we handle pinch/pan ourselves */
  overscroll-behavior: contain;
}
.lb-overlay.lb-open { display: flex; }

.lb-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: zoom-out;
}
.lb-stage.lb-zoomed { cursor: grab; }
.lb-stage.lb-panning { cursor: grabbing; }

.lb-img {
  max-width: 92vw; max-height: 86vh;
  max-height: 86dvh;                  /* dynamic viewport height: correct with the mobile address bar */
  transform-origin: center center;
  transform: translate(0,0) scale(1);
  will-change: transform;
  transition: transform 0.13s ease-out;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  -webkit-user-drag: none;
}
.lb-img.lb-notransition { transition: none; }   /* while actively pinching/dragging */

.lb-bar {
  position: absolute; z-index: 3;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  display: flex; gap: 8px;
}
.lb-btn {
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(20,26,36,0.55);       /* solid-ish so buttons read over any screenshot */
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.lb-btn:hover { background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.44); }
.lb-btn:active { transform: scale(0.94); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-btn svg { width: 20px; height: 20px; display: block; }

.lb-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); text-align: center;
  color: rgba(255,255,255,0.88); font-size: 13.5px; line-height: 1.4;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0));
  pointer-events: none;
}
.lb-hint {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 2;
  color: rgba(255,255,255,0.62); font-size: 12px; pointer-events: none; white-space: nowrap;
}

@media (max-width: 640px) {
  .lb-btn { width: 46px; height: 46px; }   /* larger touch targets */
  .lb-hint { display: none; }
  /* leave room for the top toolbar and the bottom caption so the image never sits under them */
  .lb-img { max-width: 95vw; max-height: 74vh; max-height: 74dvh; }
  .lb-cap { font-size: 12.5px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}
@media print { .lb-overlay { display: none !important; } }
