@import url('https://fonts.googleapis.com/css2?family=Space+Mono&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: unset;
  padding: 16px;
  overflow-x: hidden;
}

/* ── Stage — content-height, Squarespace-safe ───────────────────────────── */

#stage {
  width: 100%;
  height: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.scene {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.book-shadow {
  position: relative;       /* for #panOverlay and nav buttons */
  margin: 0 auto;
  transform-origin: center center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.1);
}

/* Pan overlay — shown when zoomed, sits over flipbook to block turn.js */
#panOverlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 999;
  touch-action: none;
  cursor: grab;
}
#panOverlay:active {
  cursor: grabbing;
}

.flipbook {
  width: 400px;
  height: 552px;
  overflow: hidden;
}

.flipbook, .flipbook * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none;
  user-select: none;
}

/* ── Hard covers ────────────────────────────────────────────────────────── */

.flipbook .hard {
  background-color: #1b1b1d;
  background-image:
    repeating-linear-gradient(
      70deg,
      rgba(255,255,255,0.022) 0px,
      rgba(255,255,255,0.022) 1px,
      transparent 1px,
      transparent 8px
    ),
    repeating-linear-gradient(
      -70deg,
      rgba(255,255,255,0.022) 0px,
      rgba(255,255,255,0.022) 1px,
      transparent 1px,
      transparent 8px
    );
  color: #fff;
  padding: 0;
  border: none;
}

/* Sketchbook cover photo */
.front-cover {
  cursor: pointer;
}

.front-cover {
  background-image: url('SketchbookCover.webp') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: #ffffff !important;
}

.back-cover {
  background-image: url('SketchbookBackCover.webp') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: #ffffff !important;
}

/* Inner covers */
.inner-cover {
  background-color: #ffffff !important;
  background-image: none !important;
}

/* ── Content pages ──────────────────────────────────────────────────────── */

.flipbook .page {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.07);
  padding: 0;
}

.flipbook .page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #ffffff;
  pointer-events: none;
}

/* ── Navigation buttons — absolute, flush to book edges ─────────────────── */

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  font-size: 56px;
  line-height: 1;
  color: rgba(70,60,55,0.28);
  cursor: pointer;
  padding: 0 6px;
  min-width: 44px;
  min-height: 44px;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

#prevBtn { left: -40px; }
#nextBtn { right: -40px; }

.nav-btn:hover  { color: rgba(70,60,55,0.6); }
.nav-btn:active { color: rgba(70,60,55,0.85); transform: translateY(-50%) scale(0.94); }

/* ── Zoom controls ──────────────────────────────────────────────────────── */

.zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
}

.zoom-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: rgba(70,60,55,0.35);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.zoom-btn:hover  { color: rgba(70,60,55,0.7); background: rgba(70,60,55,0.06); }
.zoom-btn:active { color: rgba(70,60,55,0.9); background: rgba(70,60,55,0.12); }

.zoom-display {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(70,60,55,0.45);
  min-width: 44px;
  text-align: center;
}

/* ── Page indicator ─────────────────────────────────────────────────────── */

.page-indicator {
  margin-top: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(70,60,55,0.45);
  min-height: 18px;
}
