.custom-book-reader {
  padding: 8px clamp(8px, 2vw, 18px) 6px;
  background: rgba(2, 16, 9, 0.3);
}

.book-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(68vw, 830px);
  min-height: min(68vw, 830px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 249, 231, 0.1), transparent 54%),
    rgba(1, 12, 7, 0.5);
  border: 1px solid rgba(210, 179, 117, 0.28);
}

.flipbook {
  visibility: hidden;
}

.flipbook.is-ready.is-covered {
  visibility: hidden;
}

.flipbook.is-ready {
  visibility: visible;
}

.book-loading {
  color: var(--itinerary-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.book-cover-preview {
  position: absolute;
  z-index: 3;
  display: none;
  height: calc(100% - 16px);
  aspect-ratio: 612 / 792;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #fbf7eb;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  touch-action: pan-y;
  transition: opacity 180ms ease, transform 180ms ease;
}

.book-cover-preview.is-ready {
  display: block;
}

.book-cover-preview[hidden] {
  display: none !important;
}

.book-cover-preview.is-opening {
  opacity: 0;
  transform: translateX(-12%);
  pointer-events: none;
}

.book-cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-page {
  background: #fbf7eb;
  overflow: hidden;
}

.book-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 0 0;
}

.book-icon-button,
.book-sound-button {
  min-height: 38px;
  border: 1px solid rgba(210, 179, 117, 0.7);
  color: var(--itinerary-ink);
  background: rgba(7, 28, 18, 0.62);
  cursor: pointer;
}

.book-icon-button {
  width: 40px;
  padding: 0;
  font-size: 1.16rem;
  line-height: 1;
}

.book-sound-button {
  padding: 0 10px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  font-weight: 900;
}

.book-icon-button:hover,
.book-sound-button:hover,
.book-icon-button:focus-visible,
.book-sound-button:focus-visible {
  color: #142b20;
  background: var(--itinerary-gold);
  outline: none;
}

.book-status {
  width: 86px;
  margin: 0;
  color: var(--itinerary-ink);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.book-control-divider {
  width: 1px;
  height: 24px;
  background: rgba(247, 242, 231, 0.28);
}

.itinerary-reader:fullscreen {
  width: 100%;
  height: 100vh;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: 0;
  background-color: #426d5e;
  background-image:
    linear-gradient(rgba(5, 24, 16, 0.12), rgba(5, 24, 16, 0.18)),
    url("../assets/tralee-hero-web.jpg");
  background-position: center;
  background-size: cover;
}

.itinerary-reader:fullscreen .custom-book-reader {
  padding: 6px 12px;
}

.itinerary-reader:fullscreen .book-stage {
  width: min(100%, 1280px);
  height: min(calc(100vh - 142px), 830px);
  min-height: 0;
  margin: 0 auto;
}

@media (max-width: 750px) {
  .custom-book-reader {
    padding: 6px 0 4px;
  }

  .book-stage {
    width: min(100%, 540px);
    height: min(132vw, 760px);
    min-height: 480px;
    margin: 0 auto;
    border-right: 0;
    border-left: 0;
  }

  .book-cover-preview {
    height: calc(100% - 10px);
  }

  .book-controls {
    padding: 7px 6px 0;
  }

  .itinerary-reader:fullscreen .book-stage {
    width: min(100%, 540px);
    height: calc(100vh - 104px);
    min-height: 420px;
  }
}

@media (max-width: 390px) {
  .book-controls { gap: 4px; padding-right: 4px; padding-left: 4px; }
  .book-icon-button { width: 32px; min-height: 32px; font-size: 0.92rem; }
  .book-status { width: 48px; font-size: 0.66rem; }
  .book-sound-button { min-height: 32px; padding: 0 5px; font-size: 0.5rem; }
  .book-control-divider { height: 20px; }
}