/* ============================================================
   BookletViewer styles. The magazine is the hero — chrome is
   understated and dark-friendly. Theme via --booklet-bg.
   ============================================================ */
.bv-root {
  --booklet-bg: #0d0d0f;
  --bv-fg: rgba(255,255,255,0.85);
  --bv-muted: rgba(255,255,255,0.45);
  --bv-line: rgba(255,255,255,0.14);
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--booklet-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-display, system-ui, sans-serif);
  color: var(--bv-fg);
}
.bv-root.bv-fullscreen { width: 100vw; height: 100vh; }

/* ---- loading (minimal, no text) ---- */
.bv-loading {
  position: absolute; inset: 0; z-index: 25;
  background: var(--booklet-bg);
  display: flex; align-items: center; justify-content: center;
}
.bv-loading-bar {
  width: 120px; height: 2px;
  background: var(--bv-line);
  position: relative; overflow: hidden;
}
.bv-loading-bar::after {
  content: ''; position: absolute; inset: 0;
  width: 40%; background: var(--bv-fg);
  animation: bv-slide 1.1s var(--ease-out, cubic-bezier(.16,1,.3,1)) infinite;
}
@keyframes bv-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ---- error ---- */
.bv-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; text-align: center;
}
.bv-error-mark {
  width: 46px; height: 46px; border: 1px solid var(--bv-line);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--bv-muted);
}
.bv-error-text {
  font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--bv-muted);
}

/* ---- stage / book ---- */
.bv-stage {
  flex: 1; min-height: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  /* soft ambient depth */
  perspective: 2400px;
}
.bv-book-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  transform: rotateX(4deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 40px 60px rgba(0,0,0,0.55));
}
.bv-book { margin: 0 auto; }

/* page surfaces */
.bv-page {
  background: #fff;
  overflow: hidden;
}
.bv-page[data-density="hard"] { background: #f3f3f3; }
.bv-canvas {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ---- zoom (flat high-res inspection) ---- */
.bv-zoom {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(8,8,8,0.94);
  display: flex; align-items: center; justify-content: center;
  padding: 4vmin; cursor: zoom-out;
  opacity: 0; transition: opacity 0.25s var(--ease-out, ease);
}
.bv-zoom.open { opacity: 1; }
.bv-zoom-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

/* ---- UI chrome ---- */
.bv-ui {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 16px;
  z-index: 20;
}
.bv-btn {
  height: 38px; min-width: 38px; padding: 0 12px;
  border: 1px solid var(--bv-line);
  background: transparent; color: var(--bv-muted);
  font-family: inherit; font-size: 18px; line-height: 1;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.bv-btn:hover { border-color: var(--bv-fg); color: var(--bv-fg); }
.bv-indicator {
  min-width: 110px; text-align: center;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bv-muted); font-variant-numeric: tabular-nums;
}
.bv-close { margin-left: 6px; font-size: 14px; }

/* ---- portfolio fullscreen overlay host ---- */
#booklet-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: #0d0d0f;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease-out, ease);
}
#booklet-overlay.open { opacity: 1; pointer-events: all; }
#booklet-stage { width: 100%; height: 100%; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .bv-book-wrap { transform: none; filter: drop-shadow(0 20px 36px rgba(0,0,0,0.5)); }
  .bv-stage { perspective: 1600px; }
  .bv-ui { gap: 8px; padding: 12px; }
  .bv-indicator { min-width: 84px; letter-spacing: 0.14em; }
}
