/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Cormorant Garamond", serif;
  background-color: #000;
  color: #fff;
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  margin-bottom: 0.5em;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

p {
  font-size: 1.25rem;
  margin-bottom: 1em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Scroller Container */
.scroller {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
  position: relative;
  z-index: 10;
}

/* Fixed Background Container */
#bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #000;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.bg-layer.active {
  opacity: 1;
}

/* Sections */
.section {
  position: relative;
  height: 100vh;
  width: 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  /* Removed individual background images from sections */
  background: transparent;
  overflow: hidden;
}

/* Dark Overlay for readability */
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Increased opacity for better readability */
  z-index: 1;
}

/* Content Container */
.content {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 1.5s ease,
    transform 1.5s ease;
  max-width: 800px;

  /* Readability enhancements */
  background: rgba(0, 0, 0, 0.6);
  padding: 2rem;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Typography Specifics */
h1 {
  font-size: 2.5rem;
  color: #f8f1e5; /* Warm white/cream */
}

h2 {
  font-size: 1.8rem;
  color: #e0d0b0; /* Gold-ish */
}

/* Page Specific Styles */

/* Page 4: Nativity (Visual Only) */
.visual-only {
  justify-content: center;
}

.star-container {
  position: absolute;
  top: 27%;
  left: 45%;
  transform: translateX(-50%);
  z-index: 2;
}

.star {
  /* Core of the star */
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  position: relative;
  opacity: 0;
  transition: opacity 2s ease;

  /* Initial Glow */
  box-shadow:
    0 0 15px 5px #fff,
    0 0 30px 10px rgba(255, 255, 255, 0.8),
    0 0 0 0 rgba(255, 255, 255, 0);
}

/* Star Beams (Cross shape) */
.star::before,
.star::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: linear-gradient(to right, transparent, #fff, transparent);
  transform: translate(-50%, -50%);
  opacity: 1; /* Increased opacity for beams */
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8); /* Glow for beams */
}

.star::before {
  width: 60px;
  height: 2px;
}

.star::after {
  width: 2px;
  height: 60px;
}

/* Active State Animation */
@keyframes starPulse {
  0% {
    box-shadow:
      0 0 20px 8px #fff,
      0 0 50px 20px rgba(255, 255, 255, 0.8),
      0 0 80px 30px rgba(255, 255, 255, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 30px 12px #fff,
      0 0 70px 30px rgba(255, 255, 255, 0.9),
      0 0 100px 40px rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
  }
  100% {
    box-shadow:
      0 0 20px 8px #fff,
      0 0 50px 20px rgba(255, 255, 255, 0.8),
      0 0 80px 30px rgba(255, 255, 255, 0.4);
    transform: scale(1);
  }
}

.section.active .star {
  opacity: 1;
  animation: starPulse 4s infinite ease-in-out;
}

.section.active .star::before,
.section.active .star::after {
  /* Slightly rotate/pulse beams if desired, but keeping it simple/elegant */
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.9),
    transparent
  );
}

/* Page 5: Photo Grid */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 1200px;
  /* Remove background from grid container since items have it, or keep consistent */
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.photo-card {
  background: rgba(0, 0, 0, 0.6);
  padding: 0.5rem;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 45%;
  flex: 1 1 300px; /* Responsive sizing */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.caption {
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
  text-shadow: none; /* Already on a card background */
}

/* Page 8: Bible Verse */
.bible-verse {
  font-style: italic;
  border-left: 3px solid #e0d0b0;
  padding-left: 1.5rem;
  margin: 2rem auto;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
}

.verse-text {
  font-size: 1.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.verse-ref {
  text-align: right;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #e0d0b0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Music Toggle */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s;
}

.music-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Snow Container */
#snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .content {
    padding: 1.5rem 1rem;
    margin: 0 1rem;
    width: auto;
  }

  .photo-card {
    max-width: 100%;
  }
}
