/* ============================================================
   PDF Flipbook Styles (InDesign page)
   ============================================================ */

.pdf-flipbook-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 5rem 4rem 6rem;
  position: relative;
  overflow: hidden;
}
.pdf-flipbook-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 100%, rgba(107,77,163,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 100% 0%,  rgba(107,77,163,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.pdf-flipbook-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.pdf-flipbook-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.pdf-flipbook-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.pdf-flipbook-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.pdf-download-btn:hover {
  border-color: var(--accent);
  background: rgba(107,77,163,0.08);
  color: var(--accent2);
}

/* ─── FLIPBOOK STAGE ─────────────────────────────────────── */
.flipbook-stage {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}
.flipbook-viewport { flex: 1; min-width: 0; }

.book-wrap {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}
.book-shadow {
  position: absolute;
  bottom: -18px; left: 50%;
  transform: translateX(-50%);
  width: 85%; height: 24px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
  pointer-events: none;
}

.book-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  background: var(--surface2);
  overflow: hidden;
  aspect-ratio: 8.5 / 5.5;
  position: relative;
}
.book-spine {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--border), var(--border), transparent);
  z-index: 5;
  pointer-events: none;
}
.book-page {
  position: relative;
  overflow: hidden;
  background: #1a1714;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-page canvas {
  display: block;
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  object-fit: contain;
}

/* Page loading indicator */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}
.page-loading::after {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  border: 1px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.6rem;
}

/* ─── FLIPBOOK CONTROLS ──────────────────────────────────── */
.flipbook-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.flip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.flip-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(107,77,163,0.08);
}
.flip-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.flipbook-page-info {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  min-width: 80px;
  text-align: center;
}

/* ─── THUMBNAIL STRIP ────────────────────────────────────── */
.flipbook-thumbs {
  width: 90px;
  flex-shrink: 0;
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-right: 4px;
}
.flipbook-thumbs::-webkit-scrollbar       { width: 3px; }
.flipbook-thumbs::-webkit-scrollbar-track { background: transparent; }
.flipbook-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.thumb-item {
  position: relative;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.thumb-item:hover  { border-color: var(--accent); }
.thumb-item.active { border-color: var(--accent2); }
.thumb-item canvas { display: block; width: 100%; height: auto; }

.thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 2px 0;
  background: rgba(14,13,11,0.7);
}

@media (max-width: 768px) {
  .pdf-flipbook-section { padding: 3rem 1.5rem 4rem; }
  .flipbook-stage       { flex-direction: column-reverse; }
  .flipbook-thumbs {
    width: 100%; max-height: none;
    flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    padding-right: 0; padding-bottom: 4px;
  }
  .thumb-item { width: 60px; flex-shrink: 0; }
}
