/* ===== Fonts ===== */
@font-face {
  font-family: "Crimson Pro";
  src: url("assets/fonts/CrimsonPro-ExtraLight.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Crimson Pro";
  src: url("assets/fonts/CrimsonPro-ExtraLightItalic.woff2") format("woff2");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}

/* ===== Base ===== */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Georgia", serif;
  color: #2f2f2f;
  background: radial-gradient(
    circle at top,
    rgba(255, 255, 255, 0.95),
    rgba(230, 240, 255, 0.85),
    rgba(245, 240, 230, 0.9)
  );
}

/* ===== Shared Content Page Layout ===== */
.content-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-attachment: fixed;
}

.content-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  box-sizing: border-box;
}

.content-title {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8b7d5a;
  margin: 0 0 2.5rem;
}

/* ===== Home Page ===== */
.home.sacred {
  min-height: 100vh;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.home.sacred section {
  margin-bottom: 1rem;
}

.intro-line {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #8b7d5a;
  margin-bottom: 0;
}

.halo-line {
  width: 120px;
  height: 1px;
  margin: 0 auto 1rem;
  background: linear-gradient(
    to right,
    transparent,
    rgba(200, 170, 90, 0.85),
    transparent
  );
}

.name {
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 3.6rem;
  font-weight: 200;
  font-style: italic;
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.remembrance-text {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.8;
  color: #4a4a4a;
}

.sacred-frame.soft-frame {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.95),
    rgba(240, 230, 200, 0.85)
  );
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18),
              0 0 40px rgba(255, 235, 190, 0.5);
}

.sacred-frame.soft-frame img {
  width: 320px;
  max-width: 90vw;
  border-radius: 12px;
  display: block;
}

/* ===== Messages Page ===== */
body.messages-page {
  margin: 0;
  overflow: hidden;
  font-family: Georgia, serif;
  background: linear-gradient(
    to bottom,
    rgba(250, 248, 245, 0.98),
    rgba(245, 240, 230, 0.98)
  );
}

.messages-page.sacred {
  background: linear-gradient(
    to bottom,
    rgba(250, 248, 245, 0.98),
    rgba(245, 240, 230, 0.98)
  );
}

/* ===== Fixed Hero (Messages page only) ===== */
.messages-page .fixed-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  overflow: hidden;
  z-index: 1;
}

.messages-page .fixed-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92) saturate(0.85);
}

.messages-page .fixed-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08),
    rgba(245, 240, 230, 0.95)
  );
}

.messages-page .fixed-image {
  background: red;
}

/* ===== Scrollable Messages Area ===== */
.messages-page .messages-scroll {
  position: absolute;
  top: 30vh;
  bottom: 80px;
  width: 100%;
  overflow-y: auto;
  padding: 3.5rem 2rem;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  z-index: 2;
}

.messages-page .messages-scroll h2 {
  text-align: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #8b7d5a;
  margin: 0 0 3rem;
}


/* Message Blocks */
.message-block {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 1.4rem;
  margin-bottom: 2.4rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.message-block.locked {
  background: rgba(250, 248, 245, 0.95);
  color: #6f6a5c;
  box-shadow: inset 0 0 0 1px rgba(200, 170, 90, 0.15);
}

.message-block textarea {
  width: 100%;
  min-height: calc(1.6em * 2);
  max-height: calc(1.6em * 5);
  overflow-y: auto;
  resize: none;
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1.6;
  padding: 0.75rem;
  box-sizing: border-box;
}

.message-block.locked textarea {
  background: transparent;
  border: none;
  color: #6f6a5c;
}

.message-block button {
  margin-top: 0.75rem;
  padding: 0.5rem 1.4rem;
  border: none;
  border-radius: 30px;
  background: linear-gradient(to right, #e6d3a3, #f3e7c4);
  color: #4a3b1f;
  cursor: pointer;
}

.message-block.locked button {
  display: none;
}

/* ===== Page Actions Footer ===== */
.page-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(to top,
    rgba(245,240,230,0.98),
    rgba(245,240,230,0.85),
    rgba(245,240,230,0)
  );
  z-index: 2;
}

.page-actions .sacred-link {
  padding: 0.6rem 1.6rem;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4a3b1f;
  background: linear-gradient(to right,
    rgba(230,211,163,0.85),
    rgba(243,231,196,0.85)
  );
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.page-actions .sacred-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

/* ===== Photography Page ===== */
.photography-page {
  min-height: 100vh;
  background: radial-gradient(circle at top,
    rgba(255,255,255,0.95),
    rgba(245,240,230,0.95)
  );
}

.photography-page .gallery-page {
  padding-bottom: 140px;
}

.photography-page .content-main {
  max-width: 1100px;
}

.photography-page .gallery-intro {
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8b7d5a;
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
  line-height: 1.8;
  font-style: normal;
  text-align: center;
}

.photography-page .gallery-intro::after {
  content: "";
  display: block;
  width: 120px;
  height: 1px;
  margin: 2rem auto 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(200,170,90,0.7),
    transparent
  );
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 1rem;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: rgba(245,240,230,0.6);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.photo-grid img:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

@media(max-width:768px){
  .photo-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

.translation-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: rgba(255,252,245,0.97);
  color: #4a3b1f;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  line-height: 1.5;
  max-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(200,170,90,0.25);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.translation-tooltip.visible { opacity: 1; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 9999;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* ======================
   Photo viewer popup
====================== */
.photo-viewer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;             /* Page background behind popup */
  justify-content: center;
  align-items: center;
  z-index: 9999;               /* Above everything */
  cursor: zoom-out;
}

/* Show popup */
.photo-viewer.visible {
  display: flex;
}

/* Popup image styling */
.photo-viewer img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  border-radius: 4px;
}

/* Hide page content behind popup */
.photo-viewer.visible ~ .gallery-page,
.photo-viewer.visible ~ .page-actions {
  visibility: hidden;
}



document.addEventListener("keydown", e => {
  if (e.key === "Escape") {
    viewer.classList.remove("visible");
    viewerImg.src = "";
  }
});


/* ===== Mobile tweaks ===== */
@media(max-width:480px){
  .name { font-size:2.6rem; }
  .page-actions { height:70px; }
  .page-actions .sacred-link { font-size:0.7rem; }
}

[data-flagged]{ display:none; }
[data-flagged].is-visible{ display:inline-block; }

.actions { display:flex; flex-direction:column; align-items:center; }
.secondary-actions { margin-top:1.2rem; display:flex; gap:1rem; }
