.anu-pdf-book { position: relative; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

/* ---- Cover matches viewer size ---- */
.anu-book-cover {
  /* width = min(95vw, viewHeight * ratio); height derives from aspect-ratio */
  width: min(95vw, calc(var(--anu-view-height, 90vh) * var(--anu-view-ratio, 0.707)));
  aspect-ratio: var(--anu-view-ratio, 0.707);
  margin: 2rem auto;
  position: relative;
  perspective: 1200px;
}
.anu-book-front {
  position: absolute; inset: 0;
  background: linear-gradient(135deg,#101418,#1a2430); /* replaced by JS with featured image */
  background-size: cover; background-position: center;
  border-radius: 14px; box-shadow: 0 15px 40px rgba(0,0,0,.35);
  transform-origin: left center; transform: rotateY(0deg); transition: transform .6s ease;
  display: grid; place-items: end; /* binder at bottom */
}
.anu-cover-binder {
  width: 100%; padding: 1.25rem 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,.35));
  color: #fff; border-radius: 0 0 14px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.anu-cover-binder h3 { margin: 0; font-weight: 600; }
.anu-book-open { background: #fffb; border: 0; padding: .6rem 1rem; border-radius: 999px; cursor: pointer; color:#111; }

/* “Open book” animation */
.anu-pdf-book.open .anu-book-front { transform: rotateY(-150deg); }

/* ---- Viewer ---- */
.anu-book-viewer { margin: 1rem auto 3rem; width: fit-content; }
.anu-book-toolbar, .anu-book-footer {
  display:flex; align-items:center; justify-content:center; gap:1rem; padding:.5rem;
}

.anu-spread {
  /* Exactly the same sizing rule as the cover */
  width: min(95vw, calc(var(--anu-view-height, 90vh) * var(--anu-view-ratio, 0.707)));
  aspect-ratio: var(--anu-view-ratio, 0.707);
  height: auto;
  margin: 0 auto;
  position: relative; display:grid; place-items:center;
  background: #f4f6f8; padding: 12px; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  overflow: auto; /* scroll when zoomed */
}

/* Canvas renders to intrinsic pixels; JS toggles max- when zooming */
.anu-page {
  display:block; width:auto; height:auto;
  max-width: 100%; max-height: 100%;
  background:#fff; border-radius:8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* Upsell */
.anu-upsell-overlay {
  position:absolute; inset:12px; display:grid; place-items:center;
  backdrop-filter: blur(6px) saturate(1.2); background: rgba(255,255,255,.35);
  border-radius: 12px;
}
.anu-upsell-card { background:#0f1725; color:#eef3ff; padding:1rem 1.25rem; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.3); text-align:center; }
.anu-upsell-card p { margin:.2rem 0; }
.anu-upsell-button { display:inline-block; margin-top:.4rem; background:#ffffff; color:#0f1725; padding:.5rem 1rem; border-radius:999px; text-decoration:none; font-weight:600; }

/* Fullscreen */
.anu-spread:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }

/* --- Fullscreen edge navigation --- */
.anu-swipe-zone {
  position: absolute; top: 0; bottom: 0; width: 20%;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: flex-start;
  opacity: 0; pointer-events: none; transition: background .2s ease, opacity .2s ease;
  border-style: none;
}
.anu-swipe-zone.left  { left: 0;  justify-content: flex-start; }
.anu-swipe-zone.right { right: 0; justify-content: flex-end; }

.anu-swipe-zone .anu-chevron {
  font-size: clamp(24px, 4vw, 56px);
  color: #fff; padding: 0 .8rem;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .2s ease, transform .2s ease;
}
.anu-swipe-zone.right .anu-chevron { transform: translateX(6px); }

/* Only active/visible in fullscreen */
.anu-spread:fullscreen .anu-swipe-zone { opacity: 1; pointer-events: auto; }
.anu-spread:fullscreen .anu-swipe-zone:hover { background: rgba(0,0,0,.18); }
.anu-spread:fullscreen .anu-swipe-zone.left:hover  .anu-chevron { opacity: 1; transform: translateX(0); }
.anu-spread:fullscreen .anu-swipe-zone.right:hover .anu-chevron { opacity: 1; transform: translateX(0); }

