/* =============================================================
   style.css — gaya kustom kecil yang tidak praktis ditulis
   dengan utility Tailwind (animasi, state JS, scrollbar).
   ============================================================= */

/* Tinggi layar penuh yang aman di mobile (address bar) */
.screen-min { min-height: 100vh; min-height: 100svh; }

/* ---------- Cover / Buka Undangan ---------- */
.cover {
  transition: transform 1.1s cubic-bezier(.76, 0, .24, 1), opacity 1.1s ease;
  will-change: transform;
}
.cover.is-opened { transform: translateY(-100%); opacity: .6; }

/* ---------- Pilih Bahasa (tampil sebelum sampul) ---------- */
.lang-gate { transition: opacity .6s ease, visibility .6s; }
.lang-gate.is-closing { opacity: 0; visibility: hidden; pointer-events: none; }
.lang-gate-option.is-active { outline: 2px solid #E3C27A; outline-offset: 2px; }

/* ---------- Hero fade slider (Ken Burns halus) ---------- */
.hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 1.8s ease, transform 9s linear;
}
.hero-slide.is-active { opacity: 1; transform: scale(1); }

/* ---------- Reveal saat di-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Carousel galeri ---------- */
.carousel:focus-visible { outline: none; }
.carousel:focus-visible [data-track] { box-shadow: 0 0 0 4px #E7B7A1; border-radius: 1.75rem; }
.carousel-track {
  transition: transform .7s cubic-bezier(.65, 0, .35, 1);
  touch-action: pan-y;          /* swipe horizontal, scroll vertikal tetap jalan */
  user-select: none;
  cursor: grab;
  will-change: transform;
}
.carousel-track.is-dragging { transition: none; cursor: grabbing; }
.carousel-dot {
  height: 8px; width: 8px;
  border-radius: 9999px;
  background: #E7B7A1;
  transition: width .35s ease, background-color .35s ease;
}
.carousel-dot[aria-current="true"] { width: 26px; background: #7E3F26; }
.carousel-dot:focus-visible { outline: 2px solid #7E3F26; outline-offset: 3px; }

/* ---------- Elemen melayang: muncul setelah undangan dibuka ---------- */
.floating-ui {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .6s ease .5s, transform .6s ease .5s, visibility 0s linear 1.1s;
}
body.is-opened .floating-ui {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .6s ease .5s, transform .6s ease .5s, visibility 0s;
}

.nav-link {
  display: grid; place-items: center;
  height: 2.6rem; width: 2.6rem;
  border-radius: 9999px;
  color: #7E3F26;
  transition: background-color .3s ease, color .3s ease;
}
.nav-link svg { height: 1.15rem; width: 1.15rem; }
.nav-link:hover { background: #F3D9CE; }
.nav-link.is-active { background: #7E3F26; color: #FBF3E8; }
.nav-link:focus-visible { outline: 2px solid #7E3F26; outline-offset: 2px; }

/* ---------- Tombol musik ---------- */
.music-btn .icon-pause { display: none; }
.music-btn.is-playing .icon-pause { display: block; }
.music-btn.is-playing .icon-play { display: none; }
.music-ring {
  position: absolute; inset: 4px;
  border-radius: 9999px;
  border: 1.5px dashed rgba(251, 243, 232, .55);
  pointer-events: none;
}
.music-btn.is-playing .music-ring { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Select dengan ikon panah ---------- */
.select-chevron {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237E3F26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 18px;
}

/* ---------- Modal sukses ---------- */
.modal.is-open { display: flex; animation: fade-in .3s ease both; }
.modal.is-open .modal-card { animation: pop-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.modal.is-open .check-draw path {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: draw .6s ease .25s forwards;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in  { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes draw    { to { stroke-dashoffset: 0; } }

/* ---------- Daftar ucapan ---------- */
.wishes-scroll { scrollbar-width: thin; scrollbar-color: #D89274 transparent; }
.wishes-scroll::-webkit-scrollbar { width: 6px; }
.wishes-scroll::-webkit-scrollbar-thumb { background: #D89274; border-radius: 9999px; }
.wish-new { animation: pop-in .5s ease both; }

/* ---------- Nama tamu: denyut halus saat menunggu data dari sheet "Tamu" ---------- */
.js-guest-name.is-loading { animation: pulse-opacity 1.4s ease-in-out infinite; }
@keyframes pulse-opacity { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- Hormati preferensi kurangi animasi ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
