/* ========================================================
   SCROLL REVEAL ANIMATIONS — SCRAPBOOK POLAROID
   Section trồi lên nhẹ; ảnh polaroid & tờ note "dán" xuống trang.
   Độ nghiêng dùng thuộc tính `rotate` riêng nên không bị `transform` ở đây ghi đè.
   ======================================================== */
:root {
  --reveal-duration: 1.4s;
  --reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --stick-ease: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Ngăn thanh cuộn ngang (dùng 100% thay 100vw — 100vw dễ tràn trên WebView) */
html,
body {
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

.app-container {
  overflow-x: hidden;
  overflow-x: clip;
}

/* Các section và card luôn hiển thị trọn vẹn, không sinh thanh cuộn dọc bên trong */
.reveal-section,
.red-card,
.reception-card,
.venue-card,
.timeline-card,
.countdown-card,
.dresscode-card,
.guestbook-card,
.gift-wrapper {
  overflow: visible !important;
}

/* Section: mờ → rõ, trồi lên */
.reveal-section {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--reveal-duration) var(--reveal-ease),
              transform var(--reveal-duration) var(--reveal-ease) !important;
  will-change: opacity, transform;
}

.reveal-section.visible {
  opacity: 1;
  transform: translateY(0) !important;
}

/* Ảnh & note: phóng nhẹ rồi "dán" xuống */
.hero-polaroid,
.couple-card,
.gallery-item,
.count-box,
.dresscode-item,
.map-embed-wrapper {
  opacity: 0;
  scale: 1.08;
  transition: opacity 0.7s ease, scale 0.8s var(--stick-ease), transform 0.2s ease, box-shadow 0.2s ease;
}

.visible .hero-polaroid,
.visible .couple-card,
.visible .gallery-item,
.visible .count-box,
.visible .dresscode-item,
.visible .map-embed-wrapper {
  opacity: 1;
  scale: 1;
}

.visible .hero-polaroid--main { transition-delay: 0.15s; }
.visible .hero-polaroid--small { transition-delay: 0.45s; }
.visible .couple-card + .couple-card { transition-delay: 0.15s; }
.visible .map-embed-wrapper { transition-delay: 0.2s; }

.visible .gallery-item:nth-child(2),
.visible .count-box:nth-child(2),
.visible .dresscode-item:nth-child(2) { transition-delay: 0.08s; }
.visible .gallery-item:nth-child(3),
.visible .count-box:nth-child(3),
.visible .dresscode-item:nth-child(3) { transition-delay: 0.16s; }
.visible .gallery-item:nth-child(4),
.visible .count-box:nth-child(4),
.visible .dresscode-item:nth-child(4) { transition-delay: 0.24s; }
.visible .gallery-item:nth-child(5),
.visible .dresscode-item:nth-child(n+5) { transition-delay: 0.32s; }
.visible .gallery-item:nth-child(6) { transition-delay: 0.4s; }

/* Tờ note lễ thành hôn & lời chúc có observer riêng */
.red-card,
.wish-item {
  opacity: 0;
  scale: 1.06;
  transition: opacity 0.8s ease 0.1s, scale 0.9s var(--stick-ease) 0.1s;
}

.red-card.visible,
.wish-item.visible,
.wishes-list.visible .wish-item {
  opacity: 1;
  scale: 1;
}

/* Footer */
footer {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--reveal-duration) var(--reveal-ease), transform var(--reveal-duration) var(--reveal-ease);
}

footer.visible,
.visible footer {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-section,
  .hero-polaroid,
  .couple-card,
  .gallery-item,
  .count-box,
  .dresscode-item,
  .map-embed-wrapper,
  .red-card,
  .wish-item,
  footer {
    opacity: 1 !important;
    scale: none !important;
    transform: none !important;
    transition: none !important;
  }
}
