/* Tema adat-aceh — UNDANGAN ADAT ACEH TA-002 V4 (3D, ornamen garis emas),
   kiriman user (undangan-aceh.zip). Menggantikan adaptasi V3.
   Desain V4: sampul + halaman berlatar ornamen atas/bawah + garis emas +
   gradien radial marun (BUKAN lagi foto frame); motif pintu + motif 3D
   memakai motif-garis.webp (400/447); rencong.webp.
   Semua aturan di-scope di bawah `.aa` (akar tema CoverGate) supaya tidak
   bocor ke tema lain; keyframe berawalan `aa3-`. Aset: /aceh/ornamen-atas.webp,
   /aceh/ornamen-bawah.webp, /aceh/motif-garis.webp, /aceh/rencong.webp.
   Musik: Ranup Lampuan (tombol .aa-music, pola bungong-jeumpa).
   CSS ini SUMBER KEBENARAN; `scripts/build-theme-css.mjs` menyalinnya ke
   `public/themes/adat-aceh.{hash}.css`. JANGAN di-import dari index.tsx
   (DECISIONS #31) — ia dikirim lewat <ThemeStyles slug="adat-aceh" />. */
@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cinzel+Decorative:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@300;400;500&display=swap");

.aa {
  --aa-acc: #d4a63a;
  --aa-acc-text: #8a6d1f;
  --aa-on-acc: #fff8e7;
  --aa-paper: #fbf6ec;
  --aa-ink: #2a0e08;
  --aa-maroon: #4a0d12;
  --aa-dark: #160503;
  --aa-cream: #f6ecd6;
  --aa-disp: "Cinzel Decorative", serif;
  --aa-body: "Montserrat", sans-serif;
  /* --rx/--ry WAJIB di akar (bukan cuma di .fr): rencong sampul (.aa-cover)
     memakai var(--ry) di keyframe aa3-swl, dan sampul BUKAN anak .fr —
     var tak terdefinisi → calc() tak valid → seluruh transform keyframe
     dibuang browser → rencong kehilangan translate(-50%,-50%) dan
     posisinya meleset (pojok kiri-atas di tengah stage, bilah keluar
     frame). Nilai 0 di sini = default sebelum pointer bergerak; V4Tilt
     menimpa via inline style di rootRef saat pointer/orientasi jalan. */
  --rx: 0;
  --ry: 0;
  background: #000;
  color: #f6ecd6;
  /* Amiri di depan supaya teks Arab apa pun di tema dirender font Arab
     (Amiri tak punya glif Latin → teks Latin jatuh ke Montserrat). */
  font-family: "Amiri", "Montserrat", sans-serif;
}

/* ---- tombol musik mengambang (muncul setelah sampul dibuka) ---- */
.aa-music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 55;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #d4a63a;
  background: #160503;
  color: #f1d58a;
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.aa.is-open .aa-music {
  display: grid;
}

/* ---- V3: wadah + tipografi ---- */
.aa .aceh * {
  box-sizing: border-box;
  margin: 0;
}
.aa-cover * {
  box-sizing: border-box;
  margin: 0;
}
.aa .aceh {
  font-family: "Montserrat", sans-serif;
  background: #000;
  display: flex;
  justify-content: center;
  color: #f6ecd6;
}
.aa .fr {
  width: 100%;
  max-width: 440px;
  position: relative;
  overflow: hidden;
  background: #000;
  --rx: 0;
  --ry: 0;
}
.aa .deco {
  font-family: "Cinzel Decorative", serif;
  color: #d4a63a;
}
.aa .serif {
  font-family: "Cormorant Garamond", serif;
}
.aa .gt {
  background: linear-gradient(100deg, #d4a63a 20%, #fff3c4 45%, #d4a63a 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: aa3-shine 4s linear infinite;
  filter: drop-shadow(1px 1px 0 #6b4a0e) drop-shadow(2px 2px 0 #4a3208)
    drop-shadow(0 7px 6px rgba(0, 0, 0, 0.6));
}
@keyframes aa3-shine {
  to {
    background-position: -220% 0;
  }
}
.aa .eb {
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #f1d58a;
}
/* Bismillah Arab — JANGAN pakai .eb: letter-spacing memutus sambungan huruf
   Arab dan uppercase tak berlaku. Font Amiri (Naskh, untuk teks Qur'an). */
.aa .bismillah {
  font-family: "Amiri", "Cormorant Garamond", serif;
  font-size: 26px;
  line-height: 1.7;
  color: #f1d58a;
  margin: 0;
}

/* ---- halaman berframe (V4: ornamen atas+bawah + garis emas + gradien radial,
   BUKAN lagi foto frame) ---- */
.aa .page {
  position: relative;
  aspect-ratio: 9/16;
  background:
    url(/aceh/ornamen-atas.webp) top center/100% auto no-repeat,
    url(/aceh/ornamen-bawah.webp) bottom center/100% auto no-repeat,
    linear-gradient(rgba(212, 166, 58, 0.55), rgba(212, 166, 58, 0.55)) 20px
      20%/1px 60% no-repeat,
    linear-gradient(rgba(212, 166, 58, 0.55), rgba(212, 166, 58, 0.55))
      calc(100% - 20px) 20%/1px 60% no-repeat,
    radial-gradient(ellipse at 50% 45%, #6b1218 0%, #2a0709 58%, #0d0305 100%);
  padding: 27% 11%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  perspective: 1100px;
}
.aa .page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 230, 150, 0.2) 50%,
    transparent 58%
  );
  background-size: 260% 100%;
  animation: aa3-sweep 7s ease-in-out infinite;
}
@keyframes aa3-sweep {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -130% 0;
  }
}
.aa .rv > * {
  opacity: 0;
}
.aa .rv.in > * {
  opacity: 1;
  animation: aa3-enter 1s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
@keyframes aa3-enter {
  from {
    opacity: 0;
    transform: translateY(34px) translateZ(-160px) rotateX(26deg);
  }
}
.aa .rv.in > :nth-child(2) {
  animation-delay: 0.12s;
}
.aa .rv.in > :nth-child(3) {
  animation-delay: 0.24s;
}
.aa .rv.in > :nth-child(4) {
  animation-delay: 0.36s;
}
.aa .rv.in > :nth-child(5) {
  animation-delay: 0.48s;
}
.aa .rv.in > :nth-child(6) {
  animation-delay: 0.6s;
}
.aa .rv.in > .petal {
  animation: aa3-fall linear infinite;
}
.aa .rv.in > .tw {
  animation: aa3-tw 2.4s ease-in-out infinite;
}

/* ---- rencong (divider) ---- */
.aa .dv {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 8px 0;
}
.aa .dv i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4a63a);
}
.aa .dv i:last-child {
  transform: scaleX(-1);
}
.aa .dv b {
  position: relative;
  width: 120px;
  height: 40px;
  flex: none;
}
.aa .dv img {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 104px;
  transform: translate(-50%, -50%) rotate(-54deg);
  animation: aa3-unsheath 4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(241, 213, 138, 0.7));
}
@keyframes aa3-unsheath {
  50% {
    transform: translate(-44%, -50%) rotate(-54deg);
  }
}

/* ---- cover (wadah CoverGate .aa-cover; wipe disetir .aa.is-open).
   Latar V4 sama seperti halaman (ornamen + garis emas + gradien). ---- */
.aa-cover {
  position: fixed;
  inset: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 440px;
  z-index: 60;
  overflow: hidden;
  background:
    url(/aceh/ornamen-atas.webp) top center/100% auto no-repeat,
    url(/aceh/ornamen-bawah.webp) bottom center/100% auto no-repeat,
    linear-gradient(rgba(212, 166, 58, 0.55), rgba(212, 166, 58, 0.55)) 20px
      20%/1px 60% no-repeat,
    linear-gradient(rgba(212, 166, 58, 0.55), rgba(212, 166, 58, 0.55))
      calc(100% - 20px) 20%/1px 60% no-repeat,
    radial-gradient(ellipse at 50% 45%, #6b1218 0%, #2a0709 58%, #0d0305 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 20vh 11% 20vh;
  transition:
    opacity 0.9s ease 1s,
    visibility 0s 1.9s;
}
.aa.is-open .aa-cover {
  opacity: 0;
  visibility: hidden;
}
.aa-cover .stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  perspective: 900px;
}
.aa-cover .mt {
  position: relative;
  z-index: 2;
  height: 94%;
  aspect-ratio: 400/447;
  display: flex;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg));
  transition: transform 0.25s ease-out;
}
.aa-cover .h {
  flex: 1;
  background: url(/aceh/motif-garis.webp) no-repeat;
  background-size: 200% 100%;
  transition:
    transform 1.4s cubic-bezier(0.77, 0, 0.18, 1),
    opacity 1.2s;
  animation: aa3-glow 3s ease-in-out infinite;
}
@keyframes aa3-glow {
  50% {
    filter: drop-shadow(0 0 14px rgba(241, 213, 138, 0.85));
  }
}
.aa-cover .h.a {
  background-position: left;
  transform-origin: left center;
}
.aa-cover .h.b {
  background-position: right;
  transform-origin: right center;
}
.aa.is-open .aa-cover .h.a {
  transform: rotateY(-118deg);
  opacity: 0;
}
.aa.is-open .aa-cover .h.b {
  transform: rotateY(118deg);
  opacity: 0;
}
.aa-cover .rc {
  position: absolute;
  height: 80%;
  top: 50%;
  left: 50%;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
}
.aa-cover .rc.l {
  transform: translate(-50%, -50%);
  animation: aa3-swl 5s ease-in-out infinite;
}
.aa-cover .rc.r {
  transform: translate(-50%, -50%) scaleX(-1);
  animation: aa3-swr 5s ease-in-out infinite;
}
.aa.is-open .aa-cover .rc {
  animation: none;
  opacity: 0;
  transition: opacity 0.7s;
}
@keyframes aa3-swl {
  0%,
  100% {
    transform: translate(-50%, -50%) translateZ(-90px) rotate(-2deg);
  }
  50% {
    transform: translate(-50%, -50%) translateZ(-90px) rotate(4deg);
  }
}
@keyframes aa3-swr {
  0%,
  100% {
    transform: translate(-50%, -50%) translateZ(-90px) scaleX(-1) rotate(-2deg);
  }
  50% {
    transform: translate(-50%, -50%) translateZ(-90px) scaleX(-1) rotate(4deg);
  }
}

/* ---- tombol ---- */
.aa .btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 3px;
  border: 1px solid #d4a63a;
  color: #d4a63a;
  background: transparent;
  font: 500 11px "Montserrat";
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: 0.3s;
  box-shadow: 0 4px 0 #7a5410;
}
.aa .btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #7a5410;
}
.aa .btn.fill {
  background: linear-gradient(135deg, #d4a63a, #a47a1c);
  color: #1a120d;
  border: none;
  animation: aa3-pulse 2s infinite;
}
@keyframes aa3-pulse {
  0% {
    box-shadow:
      0 4px 0 #7a5410,
      0 0 0 0 rgba(212, 166, 58, 0.6);
  }
  70% {
    box-shadow:
      0 4px 0 #7a5410,
      0 0 0 14px rgba(212, 166, 58, 0);
  }
  100% {
    box-shadow:
      0 4px 0 #7a5410,
      0 0 0 0 rgba(212, 166, 58, 0);
  }
}
.aa .float {
  animation: aa3-float 5s ease-in-out infinite;
}
@keyframes aa3-float {
  50% {
    transform: translateY(-10px);
  }
}

/* ---- kelopak + bintang ---- */
.aa .petal {
  position: absolute;
  top: -24px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fff6cf, #d4a63a);
  border-radius: 50% 0 50% 0;
  opacity: 0.85;
  animation: aa3-fall linear infinite;
  pointer-events: none;
  z-index: 5;
}
@keyframes aa3-fall {
  to {
    transform: translateY(115vh) rotate(540deg) translateX(40px);
  }
}
.aa .tw {
  position: absolute;
  color: #f1d58a;
  animation: aa3-tw 2.4s ease-in-out infinite;
}
@keyframes aa3-tw {
  50% {
    opacity: 0.2;
    transform: scale(0.6);
  }
}

/* ---- foto mempelai (img + fotoStyle; overflow supaya img ikut radius) ---- */
.aa .pic {
  width: 150px;
  height: 190px;
  border-radius: 75px 75px 6px 6px;
  border: 2px solid #d4a63a;
  background: linear-gradient(160deg, #7a2a2a, #1a120d);
  background-size: cover;
  background-position: center;
  box-shadow:
    0 0 0 5px #000,
    0 0 0 6px #d4a63a,
    0 12px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.aa .pic img {
  display: block;
}

/* ---- countdown ---- */
.aa .cd {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.aa .cd div {
  width: 62px;
  padding: 12px 0;
  border: 1px solid #d4a63a;
  background: rgba(74, 13, 18, 0.6);
  border-radius: 4px;
  box-shadow:
    1px 1px 0 #a47a1c,
    2px 2px 0 #a47a1c,
    3px 3px 0 #8a6414,
    4px 4px 0 #8a6414,
    6px 11px 14px rgba(0, 0, 0, 0.6);
}
.aa .cd b {
  display: block;
  font: 700 20px "Cinzel Decorative";
}
.aa .cd span {
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #f1d58a;
}

/* ---- acara / kartu ---- */
.aa .tli {
  padding: 9px 12px;
  margin-top: 8px;
  background: rgba(74, 13, 18, 0.65);
  border: 1px solid rgba(212, 166, 58, 0.5);
  border-left: 3px solid #d4a63a;
  text-align: left;
  width: 100%;
  box-shadow:
    1px 1px 0 #8a6414,
    2px 2px 0 #8a6414,
    3px 3px 0 #6b4a0e,
    6px 10px 16px rgba(0, 0, 0, 0.6);
}
.aa .card {
  background: rgba(74, 13, 18, 0.65);
  border: 1px solid #d4a63a;
  padding: 14px;
  margin-top: 10px;
  width: 100%;
  box-shadow:
    1px 1px 0 #8a6414,
    2px 2px 0 #8a6414,
    3px 3px 0 #6b4a0e,
    6px 10px 16px rgba(0, 0, 0, 0.6);
}
.aa input,
.aa textarea,
.aa select {
  width: 100%;
  padding: 9px 12px;
  margin-top: 7px;
  background: rgba(246, 236, 214, 0.08);
  border: 1px solid #d4a63a;
  color: #f6ecd6;
  font: 13px "Montserrat";
  border-radius: 3px;
}
.aa select option {
  color: #000;
}

/* ---- navigasi bawah ---- */
.aa .nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #d4a63a;
  border-radius: 999px;
  padding: 8px 16px;
  display: flex;
  gap: 14px;
}
.aa .nav a {
  color: #f1d58a;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---- tilt 3D ---- */
.aa .tilt {
  transform: perspective(700px) rotateX(calc(var(--rx) * 1deg))
    rotateY(calc(var(--ry) * 1deg));
  transition: transform 0.25s ease-out;
}

/* ---- motif 3D berputar ---- */
.aa .m3 {
  position: relative;
  perspective: 700px;
  margin: 12px 0;
}
.aa .m3i {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: aa3-spinY 12s linear infinite;
}
.aa .m3i img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@keyframes aa3-spinY {
  to {
    transform: rotateY(360deg);
  }
}

/* ---- galeri: cincin 3D ---- */
.aa .ring {
  width: 100%;
  height: 175px;
  perspective: 800px;
}
.aa .ringi {
  position: relative;
  width: 96px;
  height: 140px;
  margin: 14px auto 0;
  transform-style: preserve-3d;
  animation: aa3-ring 22s linear infinite;
}
.aa .ringi div {
  position: absolute;
  inset: 0;
  border: 2px solid #d4a63a;
  background: linear-gradient(160deg, #7a2a2a, #1a120d);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
}
@keyframes aa3-ring {
  to {
    transform: rotateY(-360deg);
  }
}

/* ---- galeri marquee (tak terpakai V4, dipertahankan dari aslinya) ---- */
.aa .mq {
  display: flex;
  gap: 8px;
  width: max-content;
  animation: aa3-mq 26s linear infinite;
}
@keyframes aa3-mq {
  to {
    transform: translateX(-50%);
  }
}
.aa .mq div {
  width: 100px;
  height: 140px;
  flex: none;
  border: 2px solid #d4a63a;
  background: linear-gradient(160deg, #7a2a2a, #1a120d);
  background-size: cover;
  background-position: center;
}

/* Hormati prefers-reduced-motion: konten tetap lengkap tanpa animasi. */
@media (prefers-reduced-motion: reduce) {
  .aa * {
    animation: none !important;
    transition: none !important;
  }
  .aa .rv > * {
    opacity: 1;
  }
}

/* ================================================================ Video ===
   Section video (FASE J) — kelas generik `_shared/video` ditata dengan token
   tema. Adaptasi dari barakah (bk.css): emas #c9a227/#f1d58a, latar marun
   gelap. Bingkai `overflow: hidden` supaya video tak keluar batas. */
.aa-video {
  margin-top: 22px;
  /* WAJIB width penuh: `.aa .page` adalah flex column dengan
     `align-items: center`, jadi anak flex menyusut ke lebar konten.
     Tanpa ini, `.video-frame` (width 100% dari wadah yang menciut)
     kolaps ke ~3px dan tombol putar tak terlihat. */
  width: 100%;
}
.aa .video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: #2a0e08;
  border: 1px solid #c9a227;
  box-shadow: 0 18px 38px -22px rgba(0, 0, 0, 0.6);
}
/* Bingkai YouTube tak membawa rasio inline (bingkai berkas membawanya). */
.aa .video-frame--yt {
  aspect-ratio: 16 / 9;
}
.aa .video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}
.aa .video-mute,
.aa .video-play {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1d58a;
  color: #2a0e08;
}
.aa .video-mute {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #c9a227;
  cursor: pointer;
}
.aa .video-lite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  background-color: #2a0e08;
  background-size: cover;
  background-position: center;
}
/* Peredup agar tombol putar terbaca di atas poster terang. */
.aa .video-lite::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(42, 14, 8, 0.3);
}
.aa .video-play {
  position: relative;
  width: 64px;
  height: 64px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
}
.aa .video-play svg {
  margin-left: 3px;
}
.aa .video-mute:focus-visible {
  outline: 2px solid #f1d58a;
  outline-offset: 2px;
}
/* Di dalam bingkai `overflow: hidden` → cincin fokus ke dalam. */
.aa .video-lite:focus-visible {
  outline: 2px solid #f1d58a;
  outline-offset: -5px;
}
