/* =====================
   Base Styles
   ===================== */
.memorial-page,
#memorial-overlay {
  background: #000;
  color: #e7ddc8;
  font-family: "Playfair Display", serif;
  text-align: center;
}

/* Standalone page centering */
.memorial-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* =====================
   Overlay
   ===================== */
#memorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 2.5s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#memorial-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =====================
   Content Container
   ===================== */
.memorial-content {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1rem, 3vh, 2.5rem) clamp(1.5rem, 4vw, 1.5rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vh, 2rem);
}

/* =====================
   Image
   ===================== */
.memorial-image {
  width: auto;
  max-width: 100%;
  max-height: 65vh;
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: brightness(1) contrast(1.1);
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      black 20%,
      black 80%,
      transparent 100%
    ),
    linear-gradient(to bottom, black 65%, transparent 100%);
  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      black 20%,
      black 80%,
      transparent 100%
    ),
    linear-gradient(to bottom, black 65%, transparent 100%);
  -webkit-mask-composite: intersect;
  mask-composite: intersect;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* =====================
   Heading (name + years)
   ===================== */
.memorial-heading {
  margin-top: clamp(-1rem, -2vh, -1.6rem);
  text-align: center;
}

.memorial-name {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #d6c27a;
  margin-bottom: clamp(0.2rem, 0.5vh, 0.4rem);
}

.memorial-years {
  font-family: "Playfair Display", serif;
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: #d6c27a;
}

/* =====================
   Message
   ===================== */
.memorial-message {
  font-family: "Playfair Display", serif;
  font-size: clamp(0.9rem, 2.2vw, 1.15rem);
  margin-top: 0.1rem;
  line-height: 1.55;
  opacity: 0.92;
}

/* =====================
   Continue Button
   ===================== */
.memorial-continue {
  background: none;
  border: none;
  color: #d6c27a;
  font-family: "Oswald", system-ui, sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  letter-spacing: 0.18em;
  margin-top: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.memorial-continue:hover {
  opacity: 1;
}

/* =====================
   Mobile Responsive
   ===================== */
@media (max-width: 768px) {
  #memorial-overlay {
    align-items: flex-start;
  }

  .memorial-image {
    max-width: 90%;
  }

  .memorial-footer {
    padding-bottom: 1rem;
  }
}
