
/* =========================
   1) Global Reset & Fonts
   ========================= */
html {
  scroll-behavior: smooth;
}

body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Avoid horizontal scroll without breaking fixed elements */
  font-family: "Battambang", "Kantumruy Pro", "Noto Sans Khmer", "Khmer OS",
    system-ui, -apple-system, sans-serif;
}

/* Basic typography */
h1 { font-size: 1.8rem; margin: 0; }
p { font-size: 1rem; line-height: 1.6; }

/* =========================
   2) Khmer Font Helpers
   ========================= */
.moul-regular {
  font-family: "Moul", "Bayon", "Battambang", serif;
  font-weight: 400;
}
.bayon-regular {
  font-family: "Bayon", "Battambang", sans-serif;
}
.freehand-regular {
  font-family: "Bokor", "Bayon", cursive;
  font-weight: 400;
}

/* =========================
   3) Audio Button (Floating)
   ========================= */
.audio-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 22px;
  cursor: pointer;
  z-index: 10001;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, background 0.3s ease;
}
.audio-btn:hover {
  transform: scale(1.1);
  background: #fff;
}
.audio-btn:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

/* =========================
   4) Layout Sections
   ========================= */
.invite-card {
  
 /* Background */
  background-image:
    linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
    url("/myday/pic/DSC_2923.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;

  /* Layout so it becomes visible */
 
  min-height: 100vh;             /* fallback */

  justify-content: center;
  align-items: center;
  text-align: center;

  color: #B76E79;

}



.couple-grid {
  display: flex;              /* Fallback */
  flex-wrap: wrap;            /* Fallback */
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;

  display: grid;              /* Modern override */
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Fallback children sizing */
.couple-grid > * {
  flex: 1 1 calc(50% - 20px); /* approximate two columns with gap */
}



@media (max-width: 768px) {
  .couple-grid {
    grid-template-columns: 1fr;
  }
}


.profile-img {
  width: 180px;               /* adjust size */
  height: 180px;
  border-radius: 50%;         /* ✅ makes it a circle */
  object-fit: cover;          /* prevents stretching */
  display: block;
  margin: 0 auto 12px;
  border: 4px solid #fff;     /* optional white border */
  box-shadow: 0 8px 25px rgba(0,0,0,0.15); /* optional elegance */
}


/* =========================
   5) Modern Background Sections
   ========================= */
.event-section,
.avenue-section {
  background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 60px 20px;
  color: #f8f7f7;
}
.event-section { background-color: #4c608b; }
.avenue-section { background-color: #894c8b; }

/* =========================
   6) Glassmorphism Boxes
   ========================= */
.glass-box {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  padding: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);

  
}


.fly-left.animate .profile-img,
.fly-right.animate .profile-img {
  animation: softZoom 0.8s ease forwards;
}

@keyframes softZoom {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


.profile-img {
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.9),
    0 10px 28px rgba(0,0,0,0.2);
}


.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: #fff;
    text-decoration: none;
}

.glass-box-time-day{
    display: flex;
    max-width: 800px;
  margin: 0 auto 1.5rem;
  padding: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-box-time{

    max-width: 800px;
  margin: 0 auto 1.5rem;
  padding: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* =========================
   7) Animations
   ========================= */
/* Start hidden with a small offset to avoid jump on reveal */
.hidden {
  opacity: 0;
  transform: translateY(30px);
}

/* Directional variants can stack with .hidden */
.fly-left.hidden { transform: translateX(-100px); }
.fly-right.hidden { transform: translateX(100px); }

/* Transition only the properties needed for performance */
.fly-left,
.fly-right {
  transition: opacity 1s ease-out, transform 3s ease-out;
}

/* Applied by JS/IntersectionObserver to reveal */
.animate {
  opacity: 1 !important;
  transform: translateX(0) translateY(0) !important;
}

/* Text scale/appear */
.text-appear {
  animation: appearFromCenter 1.5s cubic-bezier(0.17, 0.67, 0.83, 0.67) forwards;
}

@keyframes appearFromCenter {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* Optional reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .fly-left,
  .fly-right,
  .text-appear {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================
   8) RSVP Section & Buttons
   ========================= */
.rsvp-section {
  background: #5a3828;
  padding: 80px 20px;
  text-align: center;
  color: white;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: 2px solid white;
  background: transparent;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease, color 0.3s ease;
}
.btn:hover,
.btn:focus-visible {
  background: white;
  color: #5a3828;
  outline: none;
}

/* ==========================================================
   Gallery (grid) + Fullscreen Overlay (click-to-zoom)
   Tailored to your HTML/JS: .gallery, .item, .detail-overlay
   ========================================================== */

/* ---------- Section & Container ---------- */
.gallery-section {
  padding: 40px 20px;
  min-height: 100vh;     /* fallback */
  min-height: 100svh;    /* safer viewport on modern mobile */
  box-sizing: border-box;
}
.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- Responsive Grid ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* Each tile/card */
.gallery .item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #f2f2f2;                     /* visible placeholder while loading */
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  margin: 0;                                /* ensure no stray margins */
  cursor: zoom-in;                          /* communicate click-to-zoom */
}

/* Images: fill width, keep aspect ratio; never stretch */
.gallery .item img {
  display: block;                           /* remove inline gap */
  width: 100%;
  height: auto !important;                  /* override any global img {height:100%} */
  object-fit: cover;                        /* safe even if container height is constrained later */
  transition: transform 0.35s ease, opacity 0.3s ease;
  opacity: 1;
}

/* Hover effect (subtle) */
.gallery .item:hover img {
  transform: scale(1.04);
}

/* ---------- Mobile Tweaks ---------- */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
}
@media (max-width: 520px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
}

/* ==========================================================
   Fullscreen Overlay (matches your #detailOverlay structure)
   JS toggles: .detail-overlay.open
   ========================================================== */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;                          /* above .audio-btn (10001) */
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
  place-items: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(2px);               /* nice, but safe if unsupported */
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.01);
  transition: opacity 220ms ease, visibility 0s linear 220ms, transform 220ms ease;
}

/* Open (visible) state */
.detail-overlay.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 220ms ease, visibility 0s linear 0s, transform 220ms ease;
}

/* The zoomed image */
.detail-overlay img {
  max-width: min(92vw, 1400px);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  background: #111;                         /* shows while image decodes */
}

/* Metadata panel (optional info under/over the image) */
.detail-overlay .detail-meta {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 4vh, 28px);
  transform: translateX(-50%);
  max-width: min(92vw, 1000px);
  width: max-content;
  padding: 10px 14px;
  color: #f8f8f8;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-align: center;
  line-height: 1.35;
  pointer-events: none;                      /* click-through so overlay click closes */
}

.detail-overlay .detail-meta .title {
  font-weight: 700;
  margin: 0;
}
.detail-overlay .detail-meta .secondary {
  opacity: 0.85;
  font-weight: 600;
  margin-top: 2px;
}
.detail-overlay .detail-meta .description {
  opacity: 0.9;
  margin-top: 4px;
}

/* Close button (top-right) */
.detail-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  color: #111;
  font-size: 26px;
  line-height: 42px;
  text-align: center;
  cursor: pointer;
  z-index: 100001;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, background 0.2s ease;
}
.detail-close:hover { transform: scale(1.06); }
.detail-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Click outside to close (cursor cue) */
.detail-overlay {
  cursor: zoom-out;
}
.detail-overlay img {
  cursor: default; /* prevent zoom-out cursor on the image itself */
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .gallery .item img,
  .detail-overlay,
  .detail-close {
    transition: none !important;
  }
}

/* ---------- Safety: ensure overlay always above Bootstrap modals/backdrops ---------- */
.modal-backdrop,
.modal {
  z-index: 1040; /* Bootstrap default */
}


/* =========================
   Footer (Site Credits)
   ========================= */
.site-footer {
  /* Layout */
  width: 100%;
  box-sizing: border-box;

  /* Spacing */
  padding: clamp(14px, 2.4vw, 18px)
           clamp(16px, 3.5vw + env(safe-area-inset-right), 28px);

  /* Colors (works on both light/dark pages) */
  background: #101114;            /* deep neutral */
  color: #cfd3d8;                 /* soft text */
  border-top: 1px solid rgba(255, 255, 255, 0.08);

  /* Typography */
  font-size: 0.5rem;
  line-height: 1.5;
}

.footer-inner {
  /* Center the row and wrap nicely on small screens */
  max-width: 1200px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: center;        /* center content */
  gap: 10px 16px;                 /* row & column gaps */
  flex-wrap: wrap;
  text-align: center;
}

/* Footer link style */
.footer-link {
  color: #e7eaee;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.2s ease;
}

/* Underline on hover with subtle animation */
.footer-link::after {
  
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  transform: scaleX(0);
  transform-origin: left;
  background: currentColor;
  transition: transform 0.2s ease;
}

.footer-link:hover {
  color: #ffffff;
}
.footer-link:hover::after {
  transform: scaleX(1);
}

/* Keyboard accessibility */
.footer-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  border-radius: 4px;
}

.rsvp-section{
    background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 60px 20px;
  color: #f8f7f7;
}

.wish-section{
    background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 60px 20px;
  color: #0821C4;
}
.rsvp3-card{
  width:min(100%, 440px);
  background:#fff;
  border-radius:20px;
  padding:22px 18px;
  border:1px solid rgba(0,0,0,3);
  box-shadow:0 6px 24px rgba(0,0,0,.10);
}
.rsvp3-title{
  text-align:center; color:#5a3929; font-size:28px; margin:0 0 8px 0;
}
.rsvp3-steps{
  display:flex; justify-content:center; gap:10px; margin:8px 0 14px 0;
}
.rsvp3-steps .dot{
  width:10px;height:10px;border-radius:50%;
  background:#d9c9bf; display:inline-block; transition:transform .15s ease;
}
.rsvp3-steps .dot.active{ background:#5a3929; transform:scale(1.15); }
.rsvp3-question{ text-align:center; color:#3a2a22; margin:8px 0 6px 0; }
.divider{height:1px; background:#e7dcd6; margin:10px 0;}
.choices .choice-btn{
  width:100%; padding:10px 14px; border-radius:12px; border:2px solid #5a3929;
  background:transparent; color:#5a3929; font-weight:600; cursor:pointer;
}
.choices .choice-btn:hover{ background:#5a3929; color:#fff; }

.rsvp3-form .field{ margin:10px 0; }
.rsvp3-label{ display:block; color:#5a3929; font-weight:600; margin-bottom:6px; }
.rsvp3-input{
  width:100%; border:0; outline:none; background:#fff; color:#3a2a22;
  padding:10px 8px; border-radius:10px; border:1px solid #eadfd8;
}
.rsvp3-input::placeholder{ color:#9b857a; }
.rsvp3-actions{ display:flex; gap:8px; margin-top:10px; }
.rsvp3-primary, .rsvp3-outline{
  flex:1; padding:10px 14px; border-radius:12px; cursor:pointer; text-align:center;
}
.rsvp3-primary{
  background:#5a3929; color:#fff; border:2px solid #5a3929;
}
.rsvp3-primary:hover{ filter:brightness(1.05); }
.rsvp3-outline{
  background:transparent; color:#5a3929; border:2px solid #5a3929;
}
.rsvp3-outline:hover{ background:#5a3929; color:#fff; }
.rsvp3-msg{ margin-top:8px; font-size:14px; }
.rsvp3-msg.success{ color:#0f766e; } .rsvp3-msg.error{ color:#b91c1c; }

.aba-qr{ width:100%; border-radius:12px; border:1px solid #eadfd8; }
.aba-line{ color:#3a2a22; margin:6px 0; }
.copy-btn{
  padding:8px 12px; border-radius:10px; background:#f7f2ef; color:#5a3929;
  border:1px solid #dfcfc6; cursor:pointer;
}
.copy-btn:hover{ background:#ebded6; }

.rsvp3-thanks{ text-align:center; color:#3a2a22; padding:10px; }
.rsvp3-thanks .emoji{ font-size:42px; }
.rsvp3-thanks .title{ font-size:22px; margin-top:6px; }
.rsvp3-thanks .text{ color:#6b5a52; margin-top:6px; }

.d-none{ display:none !important; }
.vstack{ display:flex; flex-direction:column; }
.gap-2{ gap:.5rem; }


/* ===== Reveal base ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  will-change: opacity, transform;
  transition: opacity .6s ease, transform .6s ease;
}
.reveal-in {
  opacity: 1;
  transform: none;
}

/* Stagger helpers (delay steps) */
.stagger-0 { transition-delay: 0s; }
.stagger-1 { transition-delay: .06s; }
.stagger-2 { transition-delay: .12s; }
.stagger-3 { transition-delay: .18s; }
.stagger-4 { transition-delay: .24s; }
.stagger-5 { transition-delay: .30s; }
.stagger-6 { transition-delay: .36s; }
.stagger-7 { transition-delay: .42s; }
.stagger-8 { transition-delay: .48s; }
.stagger-9 { transition-delay: .54s; }

/* Optional: slide directions like your .fly-left/.fly-right */
.slide-left { transform: translateX(-24px); }
.slide-right { transform: translateX(24px); }

/* For gallery light pop-in */
.scale-in {
  transform: scale(.98);
}
.reveal-in.scale-in {
  transform: scale(1);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-in {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

.screen {
  position: fixed;
  inset: 0;           /* replaces top/left/width/height */
  height: 100dvh;     /* ✅ dynamic viewport height */
  width: 100vw;
  overflow: hidden;
}

.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills but NEVER stretches screen */
}
.video-wrap {
  height: calc(var(--vh) * 100);
}
