/* =========================
   LETTER PAGE
   ========================= */

.letter-page {
  padding-top: 3rem; /* nav clearance */
  padding-bottom: 3rem;
}

/* HEADER */
.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 5% 2rem 5%;
  font-size: 1.2rem;
}

/* =========================
   ENVELOPE
   ========================= */

.envelope-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 5rem;
}

.envelope {
  width: 700px;
  cursor: pointer;
  transition: transform 0.6s ease;
}

.envelope img {
  width: 100%;
  display: block;
}

/* Open animation */
.envelope.opening {
  transform: scale(1.05);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

/* =========================
   OVERLAY
   ========================= */

.letter-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 4000; /* ABOVE NAV */
}

.letter-overlay.active {
  display: block;
}

/* Backdrop */
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.85);
  animation: fadeIn 0.5s ease forwards;
}

/* Letter */
.letter-paper {
  position: relative;
  width: 210mm;
  height: 297mm;
  max-width: 90vw;
  max-height: 90vh;

  margin: auto;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: #fff9f0;

  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
  animation: paperIn 0.6s ease forwards;

  z-index: 2;
}

.letter-paper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Close */
.close-letter {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
}

/* Static click zone */
.static-zone {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  width: 100px;
  height: 48px;
  cursor: pointer;
}

/* =========================
   NAV
   ========================= */

.letter-nav {
  margin-top: 6rem;
  margin-bottom: 3rem;
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.18em;
}

.letter-nav a {
  text-decoration: none;
  color: inherit;
  opacity: 0.9;
  margin-left: 15px;
  margin-right: 15px;
}

.letter-nav strong {
  opacity: 1;
  margin-left: 15px;
  margin-right: 15px;
}

/* =========================
   ANIMATIONS
   ========================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes paperIn {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

.text {
  flex: 1;
  max-width: 600px; /* Limit the maximum width of the text */
  text-align: center; /* Center the text */
  text-align: left;
}

.text h3 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.image {
    flex: 1;
    position: relative;
    overflow: hidden; /* Ensures the image doesn't overflow the container */
    max-width: 600px; /* Limit the maximum width of the image */
    width: 551px; /* Set a fixed width for the container */
    height: 300px; /* Set a fixed height for the container */
    display: flex; /* Ensure the image respects the container's width */
    justify-content: center; /* Center the image horizontally */
}

.info {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap on smaller screens */
  flex-direction: row; /* Default direction */
  gap: 4rem; /* Space between text and image */
  margin: 0 auto; /* Center the entire info container */
  align-items: center; /* Vertically center the text and image */
  justify-content: center; /* Horizontally center the text and image */
  padding: 0 5%; /* Add responsive padding on both sides */
}