/* Hebrew art-book flipbook — preview viewer for october-7-art-edition.html only. */

.flipbook-preview-section {
  padding: 80px 0 88px;
  background: var(--bg-cream);
}

.flipbook-shell {
  width: min(1560px, calc(100vw - 48px));
}

.flipbook-preview-section .edition-section-heading {
  max-width: 1120px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

#flipbook-preview-title {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.04;
  white-space: normal;
}

.flipbook-section {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(216, 186, 114, 0.08), transparent 60%),
    var(--bg);
  box-shadow: var(--shadow);
}

.flipbook-topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 8px;
  color: var(--text-soft);
}

.flipbook-title {
  font-family: "EB Garamond", serif;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0;
}

.flipbook-title small {
  display: block;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}

.flipbook-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.flipbook-icon-btn:hover,
.flipbook-icon-btn:focus-visible { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }

.flipbook-icon-btn svg { width: 18px; height: 18px; }

.flipbook-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 8px 16px 0;
}

.flipbook-shadow {
  position: absolute;
  bottom: 8%;
  left: 50%;
  width: min(70vw, 760px);
  height: 46px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 72%);
  filter: blur(2px);
  pointer-events: none;
}

.flipbook-book-wrap {
  position: relative;
  width: min(97%, 1500px);
  aspect-ratio: 1.41 / 1;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
}

.flipbook-stage:fullscreen {
  background: var(--bg);
  width: 100vw;
  height: 100vh;
}

.flipbook-stage:fullscreen .flipbook-book-wrap {
  width: min(96vw, calc(92vh * 1.41));
  max-width: none;
}

.flipbook-book { width: 100%; height: 100%; }
.flipbook-book > .flipbook-page { display: none; }
.flipbook-page { background: #fff; overflow: hidden; }
.flipbook-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
.flipbook-page span { display: grid; place-items: center; height: 100%; color: #444; }
.flipbook-page [hidden], .flipbook-spinner[hidden] { display: none !important; }
/* No mirroring: the source PDF pairs "definition" and "plate" pages using
   plain sequential order (identical convention in the English edition) — the
   Hebrew-ness is in the in-page text alignment rendered from the PDF,
   not the binding/flip direction. Default page-flip orientation is correct. */

.flipbook-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.flipbook-loading[hidden] { display: none !important; }

.flipbook-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  animation: flipbook-spin 0.9s linear infinite;
}

@keyframes flipbook-spin { to { transform: rotate(360deg); } }

.flipbook-controls {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 22px 26px;
}

.flipbook-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.flipbook-nav-btn:hover,
.flipbook-nav-btn:focus-visible { background: var(--gold); color: #14100a; }

.flipbook-nav-btn:disabled { opacity: 0.3; cursor: default; background: none; color: var(--gold); }

.flipbook-nav-btn svg { width: 20px; height: 20px; }

.flipbook-page-count {
  min-width: 108px;
  text-align: center;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.flipbook-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.7;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .flipbook-title small { font-size: 0.62rem; }
  .flipbook-title { font-size: 0.92rem; }
  .flipbook-book-wrap { width: 94vw; }
  .flipbook-hint { display: none; }
  .flipbook-controls { gap: 14px; padding-bottom: 20px; }
}
