/* ── Book Album Viewer — flip-through photo album ── */
.book-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: radial-gradient(ellipse at center, rgba(30,10,50,.92) 0%, rgba(8,2,16,.97) 100%);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  padding: 24px 16px;
}
.book-overlay.active { display: flex; }
.book-close {
  position: absolute; top: 20px; right: 24px; z-index: 20;
  background: rgba(255,255,255,.1); border: none; color: #fff;
  width: 42px; height: 42px; border-radius: 50%; font-size: 18px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s;
}
.book-close:hover { background: rgba(255,255,255,.22); }

.book-wrap { width: min(960px, 96vw); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.book-title {
  color: #f3e9ff; font-family: 'Playfair Display', serif; font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  text-align: center; letter-spacing: .3px;
}

.book {
  position: relative; width: 100%; height: min(66vh, 540px);
  perspective: 2400px;
  display: flex;
  border-radius: 8px;
  box-shadow:
    0 2px 0 #d8cdb8, 0 6px 0 #cfc2a8, 0 10px 24px rgba(0,0,0,.35),
    0 30px 60px rgba(0,0,0,.5);
  background: linear-gradient(135deg, #3a1e57, #6b2f8a);
  overflow: hidden;
}

.book-page {
  position: relative; height: 100%; overflow: hidden;
  background: linear-gradient(120deg, #fffdf7 0%, #f6efe0 100%);
}
.book-page::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.015) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.book-page-left { width: 38%; flex: 0 0 38%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 20px; }
.book-left-icon img { height: 128px; opacity: 1; filter: brightness(1.2) saturate(1.2) contrast(1.05); margin-bottom: 16px; }
.book-left-title { font-family: 'Playfair Display', serif; color: var(--purple-dark, #3d0960); font-size: 1.15rem; margin-bottom: 10px; }
.book-left-caption { color: #6b6070; font-size: 13.5px; line-height: 1.7; max-width: 240px; }
.book-left-counter {
  margin-top: 22px; font-size: 12.5px; font-weight: 700; letter-spacing: .5px; color: var(--accent, #00897B);
  background: rgba(0,137,123,.1); padding: 6px 16px; border-radius: 50px;
}

.book-spine {
  width: 18px; flex: 0 0 18px;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.05) 30%, rgba(0,0,0,.05) 70%, rgba(0,0,0,.28));
}

.book-page-right { position: relative; flex: 1 1 auto; perspective: 2000px; }
.book-leaf-under, .book-leaf {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, #fffdf7 0%, #f6efe0 100%);
}
.book-leaf-under img, .book-leaf img {
  max-width: 92%; max-height: 90%; object-fit: contain; border-radius: 4px;
  box-shadow: 0 6px 22px rgba(0,0,0,.25); user-select: none; pointer-events: none;
  background: #fff; padding: 6px;
}
.book-leaf-under { z-index: 1; }
.book-leaf {
  z-index: 2; transform-origin: left center; transform: rotateY(0deg);
  transition: transform .68s cubic-bezier(.45,.05,.55,.95);
  box-shadow: -2px 0 0 rgba(0,0,0,.04);
}
.book-leaf::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.18) 100%);
  transition: opacity .68s ease;
}
.book-leaf.turning-next { transform: rotateY(-115deg) translateX(-4%); }
.book-leaf.turning-next::after { opacity: 1; }
.book-leaf.turning-prev {
  transform-origin: right center;
  transform: rotateY(115deg) translateX(4%);
}
.book-leaf.turning-prev::after {
  background: linear-gradient(270deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.18) 100%);
  opacity: 1;
}
.book-leaf.no-transition { transition: none !important; }

.book-corner {
  position: absolute; width: 34px; height: 34px; cursor: pointer; z-index: 5;
  opacity: 0; transition: opacity .2s;
}
.book-page-right:hover .book-corner { opacity: .55; }
.book-corner:hover { opacity: 1 !important; }
.corner-next { top: 0; right: 0; background: linear-gradient(225deg, rgba(0,0,0,.18) 50%, transparent 50%); border-radius: 0 8px 0 0; }
.corner-prev { bottom: 0; left: 0; background: linear-gradient(45deg, rgba(0,0,0,.18) 50%, transparent 50%); border-radius: 0 0 0 8px; }

.book-nav { display: flex; align-items: center; gap: 18px; }
.book-btn {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #f3e9ff;
  padding: 10px 22px; border-radius: 50px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: background .2s, transform .15s;
}
.book-btn:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.book-btn:disabled { opacity: .4; cursor: default; transform: none; }

@media (max-width: 767px) {
  .book { height: min(56vh, 460px); }
  .book-page-left { display: none; }
  .book-spine { display: none; }
  .book-page-right { flex: 1 1 100%; }
  .book-wrap { gap: 10px; }
  .book-mobile-caption { display: block; color: #e8dcf5; font-size: 13px; text-align: center; }
  .book-mobile-caption .book-mobile-counter { display: block; margin-top: 4px; font-weight: 700; color: var(--yellow, #FEC91D); font-size: 12.5px; letter-spacing: .5px; }
}
@media (min-width: 768px) {
  .book-mobile-caption { display: none; }
}
