/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Georgia", serif;
  background: #eeeae4;
  color: #2b2b2b;
  height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: #f7f5f2;
  border-bottom: 1px solid #ddd;
}

.topbar button {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Book container */
.book {
  position: relative;
  /* A5 landscape ratio (210 x 148) — page lies sideways */
  width: clamp(420px, 80vw, 1200px);
  aspect-ratio: 210 / 148;
  margin: 2rem auto;
  perspective: 2200px;
  transform-style: preserve-3d;
}

/* Pages */
.page {
  position: absolute;
  inset: 0;
  padding: 2.4rem 3rem;
  background: #faf8f5;
  transform-origin: left center;
  /* default closed state (page facing away) */
  transform: rotateY(180deg);
  transition: transform 0.9s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
  backface-visibility: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
}

/* Visible page */
.page.active {
  transform: rotateY(0deg);
  z-index: 1000;
  box-shadow: 0 18px 32px rgba(0,0,0,0.12);
}

/* Pages that have been turned (appear folded to the left) */
.page.flipped {
  transform: rotateY(-180deg);
}

/* Typography */
h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.date {
  margin-top: 2rem;
  font-style: italic;
}

/* Location page specific styles */
#location {
  display: flex;
  flex-direction: column;
  position: relative;
}

#location .location-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

#location .location-image {
  height: 70%;
  width: auto;
  object-fit: contain;
}

#location .top-image {
  position: absolute;
  top: 2rem;
  right: 0.5rem;
  height: 25%;
  width: auto;
  object-fit: contain;
}

#location .bottom-left-image {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  height: 25%;
  width: auto;
  object-fit: contain;
}

/* Cover page image */
.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: -1;
}
