body {
  margin: 0;
  background-color: #FFD59F;
  font-family: Georgia, serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

#book {
  width: min(900px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 120px));

  background: #fffaf3;
  box-shadow: 0 15px 40px rgba(118, 148, 201, 0.15);

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 16px;
  box-sizing: border-box;
  position: relative;

  border-radius: 16px;
}


.page {
  font-size: 24px;
  line-height: 1.5;
}

.page-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#controls {
  margin-top: 20px;
}


#page-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
}

.page-image {
  max-height: 100%;
  object-fit: contain;
}

/* When there are two images (a spread) */
#page-container img + img {
  border-left: 1px solid #ddd;
}

/* Animate the page container on change */
#page-container {
  position: relative;
  opacity: 1;
  transition: opacity 300ms ease;
}

#page-container.fading {
  opacity: 0;
}

/* Very subtle spine glow */
#page-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 80px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.08),
    rgba(0,0,0,0.03),
    transparent 70%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

#page-container.fading::after {
  opacity: 1;
}

/* Make sure #book can contain absolutely positioned buttons */
#book {
  position: relative;
}

/* Circular navigation buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 60px;
  height: 60px;

  border-radius: 50%;
  border: none;

  background-color: rgba(118, 148, 201, 0.75);
  color: white;

  box-shadow: 0 4px 14px rgba(118, 148, 201, 0.25);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;

  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background-color: #7694C9;
  box-shadow: 0 6px 18px rgba(118, 148, 201, 0.35);
  transform: translateY(-50%) scale(1.05);
}

/* Positioning */
.nav-btn.left {
  left: 20px;
}

.nav-btn.right {
  right: 20px;
}

@media (max-width: 700px) {
  .nav-btn {
    display: none !important;
  }
}
