/* =====================================================
   TRAVEL DIARY — main.css
   ===================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: #1a0a05;
}

.scene {
  width: 100vw;
  height: 100vh;
  background: url('../assets/parts/travel_diary_table.png') center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* =====================================================
   BOOK — static leather cover
   ===================================================== */
.book {
  position: relative;
  width: 960px;
  height: 615px;
  background: url('../assets/parts/diary_cover.png') center / cover no-repeat;
  border-radius: 6px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.70),
    0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden; /* clip any 3D overflow at the cover edges */
}

/* =====================================================
   PAGES WRAPPER — holds both page halves,
   provides perspective for 3D rotation
   ===================================================== */
.pages-wrapper {
  position: absolute;
  top: 5%;
  bottom: 4%;
  left: 4%;
  right: 4%;
  perspective: 1500px;
}

/* =====================================================
   PAGE HALVES — each side of the open spread
   ===================================================== */
.page-half {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
}

.page-left-half {
  left: 0;
  width: 50%;
}

.page-right-half {
  right: 0;
  width: 50%;
}

/* =====================================================
   PAGE TEXTURE LAYERS — both sets always rendered.
   .on-top controls which is visible on top.
   JS only toggles .on-top, never changes backgrounds.
   ===================================================== */
.page-tex {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.page-tex.on-top { z-index: 1; }

.left-tex-1  { background-image: url('../assets/parts/page_left_1.png');  }
.left-tex-2  { background-image: url('../assets/parts/page_left_2.png');  }
.right-tex-1 { background-image: url('../assets/parts/page_right_1.png'); }
.right-tex-2 { background-image: url('../assets/parts/page_right_2.png'); }

/* =====================================================
   PAGE CONTENT — positioned inside each half
   ===================================================== */
.page-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.left-content {
  align-items: center;
  justify-content: center;
  padding: 20px 18px 16px 14px;
  gap: 16px;
}

.right-content {
  padding: 30px 18px 20px 20px;
}

/* =====================================================
   SPINE SHADOWS
   ===================================================== */
.spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  z-index: 2;
}

.spine-shadow-left {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.18) 0%, transparent 100%);
}

.spine-shadow-right {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, transparent 100%);
}

/* =====================================================
   POLAROID
   ===================================================== */
.polaroid {
  transform: rotate(-2.5deg);
  filter: drop-shadow(2px 8px 16px rgba(0, 0, 0, 0.38));
  flex-shrink: 0;
}

.polaroid-frame {
  background: url('../assets/parts/photo_part.png') center / cover no-repeat;
  width: 210px;
  height: 231px;
  position: relative;
}

.polaroid-photo {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 13px;
  bottom: 32px;
  background: #7a6e6a center / cover no-repeat;
}

/* =====================================================
   ENTRY META
   ===================================================== */
.entry-meta {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.location {
  font-family: 'Caveat', cursive;
  font-size: 17px;
  font-weight: 600;
  color: #4e3c2b;
  letter-spacing: 0.02em;
}

.date {
  font-family: 'Caveat', cursive;
  font-size: 14px;
  color: #7a6655;
}

/* =====================================================
   JOURNAL TEXT
   ===================================================== */
.entry-text {
  font-family: 'Lora', Georgia, serif;
  font-size: 13.5px;
  line-height: 1.85;
  color: #3a2e22;
  white-space: pre-wrap;
  flex: 1;
  overflow: hidden;
}

.page-number {
  font-family: 'Caveat', cursive;
  font-size: 12px;
  color: #9a8877;
  text-align: center;
  display: block;
  margin-top: auto;
  padding-top: 10px;
}

/* =====================================================
   NAV ARROWS
   ===================================================== */
.nav-arrows {
  display: flex;
  gap: 64px;
  align-items: center;
}

.nav-btn {
  background: rgba(45, 22, 6, 0.75);
  border: 1.5px solid rgba(160, 120, 70, 0.45);
  color: #c8a878;
  font-size: 38px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
  padding: 0 0 3px 0;
  font-family: Georgia, serif;
  user-select: none;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(75, 38, 10, 0.90);
  border-color: rgba(185, 145, 90, 0.65);
  transform: scale(1.10);
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.93);
}

.nav-btn:disabled {
  opacity: 0.20;
  cursor: not-allowed;
}
