/* =============================================================================
   Traditional Bali — tier Premium (Wedding26).
   Konsep: Krem/kertas tua + emas + hijau; burung jalak + cabang frangipani kuning; monogram script; foto adat Bali (merah-emas); ornamen ukir Bali emas di sudut; teks Inggris.
   Palet: aksen #b08d2e, kertas #f6eedc, tinta #3a2e1c.
   Tipografi: Great Vibes (script) + Cormorant Garamond + Jost.
   CSS ini SUMBER KEBENARAN; `scripts/build-theme-css.mjs` menyalinnya ke
   `public/themes/adat-balinese.{hash}.css`. JANGAN di-import dari index.tsx
   (DECISIONS #31) — ia dikirim lewat <ThemeStyles slug="adat-balinese" />.
============================================================================= */

.ab {
  --ab-acc: #b08d2e;
  --ab-acc-text: #8a6d1a;
  --ab-on-acc: #ffffff;
  --ab-paper: #f6eedc;
  --ab-ink: #3a2e1c;
  --ab-muted: rgba(58, 46, 28, 0.68);
  --ab-line: rgba(176, 141, 46, 0.45);
  --ab-card: #fdf8ea;
  --ab-dark: #3a2e1c;
  --ab-dark-ink: #f6e9c8;
  --ab-dark-muted: rgba(246, 233, 200, 0.78);
  --ab-dark-line: rgba(176, 141, 46, 0.5);
  --ab-disp-stack: var(--ab-disp), Georgia, "Times New Roman", serif;
  --ab-body-stack: var(--ab-body), system-ui, sans-serif;
  --ab-script-stack: var(--ab-script), "Great Vibes", cursive;

  background: var(--ab-paper);
  color: var(--ab-ink);
  font-family: var(--ab-body-stack);
  overflow-x: clip;
}
.ab *,
.ab *::before,
.ab *::after {
  box-sizing: border-box;
}
.ab ::selection {
  background: var(--ab-acc);
  color: var(--ab-on-acc);
}

.ab-stage {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.ab-section {
  position: relative;
  padding: 56px 24px;
}

.ab-eyebrow {
  font-family: var(--ab-body-stack);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ab-acc-text);
  text-align: center;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ab-title {
  font-family: var(--ab-script-stack);
  font-size: 40px;
  line-height: 1.2;
  text-align: center;
  margin: 8px 0 0;
  color: var(--ab-ink);
}

.ab-foto {
  width: min(62%, 240px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px 999px 8px 8px;
  border: 2px solid #b08d2e;
  background: color-mix(in srgb, var(--ab-acc) 18%, transparent);
  display: grid;
  place-items: center;
}
.ab-foto span {
  font-family: var(--ab-disp-stack);
  font-size: 56px;
  color: var(--ab-acc-text);
}
.ab-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Countdown bersama (kelas generik dari `@/themes/_shared/motion`). */
.ab .countdown {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
}
.ab .count-box {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 16px 4px 14px;
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 14px;
}
.ab .count-num {
  font-family: var(--ab-disp-stack);
  font-size: clamp(26px, 8vw, 36px);
  font-variant-numeric: tabular-nums;
  display: block;
  color: var(--ab-ink);
}
.ab .count-label {
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ab-muted);
  margin-top: 6px;
  display: block;
}
.ab .countdown-done {
  font-family: var(--ab-disp-stack);
  font-size: 22px;
  text-align: center;
  margin-top: 28px;
}

/* Galeri: gambar langsung anak section → grid 2 kolom. */
.ab-section > img {
  width: calc(50% - 6px);
  margin: 3px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  vertical-align: top;
}

/* Tombol salin (amplop): satu-satunya <button> anak langsung kartu bank. */
.ab-section > div > button {
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--ab-acc);
  background: var(--ab-acc);
  color: var(--ab-on-acc);
  font-family: var(--ab-body-stack);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* Bingkai UKIR Bali: garis ganda emas di sekeliling stage + sudut melengkung. */
.ab-stage {
  border-inline: 1px solid rgba(176, 141, 46, 0.6);
  outline: 1px solid rgba(176, 141, 46, 0.3);
  outline-offset: -9px;
}
/* Frangipani kuning di sudut cover (blob kuning + putih). */
.ab-cover {
  background-image:
    radial-gradient(
      70px 54px at 6% 10%,
      rgba(240, 200, 90, 0.55),
      transparent 70%
    ),
    radial-gradient(
      56px 44px at 16% 20%,
      rgba(255, 255, 255, 0.75),
      transparent 70%
    ),
    radial-gradient(
      70px 54px at 94% 88%,
      rgba(240, 200, 90, 0.5),
      transparent 70%
    ),
    radial-gradient(
      48px 38px at 84% 78%,
      rgba(255, 255, 255, 0.7),
      transparent 70%
    );
}
/* Burung jalak: siluet burung kecil di atas judul cover (SVG). */
.ab-cover::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  width: 120px;
  height: 30px;
  transform: translateX(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='30'%3E%3Cg fill='%233a2e1c'%3E%3Cpath d='M14 18 C20 8 30 6 36 12 C30 18 20 20 14 18 Z'/%3E%3Cpath d='M52 20 C58 10 68 8 74 14 C68 20 58 22 52 20 Z'/%3E%3Cpath d='M88 16 C94 8 102 8 106 14 C101 19 92 20 88 16 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 120px 30px;
  opacity: 0.75;
}
/* Monogram script emas untuk judul. */
.ab-title {
  color: #8a6d1a;
}
/* Section jadwal: latar krem hangat berbingkai ukir emas. */
.ab-stage > div[data-section-id="schedule"] > .ab-section {
  background: var(--ab-card);
  border-top: 3px double var(--ab-acc);
  border-bottom: 3px double var(--ab-acc);
}
/* Foto arch (candi) berbingkai emas. */
.ab-foto {
  outline: 1px solid rgba(176, 141, 46, 0.5);
  outline-offset: 5px;
  box-shadow: 0 10px 26px rgba(58, 46, 28, 0.25);
}
/* Countdown: angka cokelat-emas di kotak krem. */
.ab .count-box {
  border-color: var(--ab-acc);
  background: var(--ab-card);
}
.ab .count-num {
  color: var(--ab-acc-text);
}

/* Cover — layar penuh saat JS jalan; wipe ke atas saat dibuka. */
.ab-cover {
  display: none;
}
.ab.is-js .ab-cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #f6eedc 0%, #efe0b8 100%);
  color: #3a2e1c;
  transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
}
.ab.is-js.is-open .ab-cover {
  transform: translateY(-100%);
}
.ab-cover-inner {
  position: relative;
  text-align: center;
  max-width: 420px;
  width: calc(100% - 48px);
  padding: 40px 24px;
  margin: 0 auto;
}
.ab-open {
  margin-top: 28px;
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid var(--ab-acc);
  background: var(--ab-acc);
  color: var(--ab-on-acc);
  font-family: var(--ab-body-stack);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Tombol musik mengambang (muncul setelah cover dibuka). */
.ab-music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 55;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--ab-acc);
  background: var(--ab-paper);
  color: var(--ab-acc-text);
  display: none;
  place-items: center;
  cursor: pointer;
}
.ab.is-open .ab-music {
  display: grid;
}

/* Hormati prefers-reduced-motion: konten tetap lengkap tanpa animasi. */
@media (prefers-reduced-motion: reduce) {
  .ab * {
    animation: none !important;
    transition: none !important;
  }
  .ab.is-js .ab-cover {
    transition: none;
  }
}

/* Elemen melayang 3D (drift.tsx): container pakai perspective, tiap item
   translateZ berbeda (-70px s.d. +75px) untuk kedalaman/parallax; hanya
   transform/opacity yang dianimasikan. Sampul juga berlapis 3D halus:
   judul/eyebrow/tombol di translateZ berbeda di atas perspective sampul. */
.ab-drift {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 700px;
}
.ab-drift--page {
  position: fixed;
  z-index: 40;
}
.ab-drift__item {
  position: absolute;
  top: 0;
  display: block;
  transform-style: preserve-3d;
}
.ab-drift__move {
  display: block;
  animation: ab-drift-fall linear infinite;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}
.ab-drift__item svg {
  display: block;
  animation: ab-drift-sway 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.25));
}
.ab-drift__item:nth-child(even) svg {
  animation-duration: 3s;
}
.ab-drift--page .ab-drift__item svg {
  opacity: 0.55;
}
@keyframes ab-drift-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(0, 112vh, 0) rotate(300deg);
    opacity: 0;
  }
}
@keyframes ab-drift-sway {
  from {
    transform: translateX(-16px) rotate(-12deg) rotateY(-10deg);
  }
  to {
    transform: translateX(16px) rotate(12deg) rotateY(10deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ab-drift {
    display: none;
  }
}

/* Lapisan sampul 3D halus: judul paling depan, eyebrow & tombol di belakangnya. */
.ab-cover {
  perspective: 1100px;
}
.ab-cover-inner,
.ab-cover-inner > div {
  transform-style: preserve-3d;
}
.ab-cover-inner .ab-eyebrow {
  transform: translateZ(14px);
}
.ab-cover-inner .ab-title {
  transform: translateZ(30px);
}
.ab-cover-inner .ab-open {
  transform: translateZ(20px);
}

/* === Motion Bali (dedup+motion 12 Nov 2026): reveal-on-scroll, latar, panjang === */
/* Reveal: konten section muncul saat di-scroll (zoom-in halus ala referensi).
   `.is-js` hanya ada setelah JS jalan -> tanpa JS konten tetap terlihat. */
.ab.is-js .reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.965);
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.ab.is-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Foto & kartu di dalam section: muncul menyusul (stagger) setelah section. */
.ab.is-js .reveal img,
.ab.is-js .reveal .ab-card,
.ab.is-js .reveal .ab-foto {
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 0.9s ease 0.18s,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.18s;
}
.ab.is-js .reveal.is-visible img,
.ab.is-js .reveal.is-visible .ab-card,
.ab.is-js .reveal.is-visible .ab-foto {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .ab.is-js .reveal,
  .ab.is-js .reveal img,
  .ab.is-js .reveal .ab-card,
  .ab.is-js .reveal .ab-foto {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* Latar berlapis tiap section: semburat aksen di atas + gradien kertas ke aksen. */
.ab-section {
  background:
    radial-gradient(
      120% 55% at 50% 0%,
      color-mix(in srgb, var(--ab-acc) 12%, transparent),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      var(--ab-paper),
      color-mix(in srgb, var(--ab-paper) 84%, var(--ab-acc))
    );
  padding: clamp(84px, 14vw, 128px) 20px;
}
/* Preview lebih panjang: foto mempelai & galeri lebih besar. */
.ab-foto {
  width: min(82%, 320px);
}
.ab-section > img {
  border-radius: 16px;
  margin-bottom: 18px;
}

/* === Motion Bali v2 (12 Nov 2026): ritme latar selang-seling + bingkai === */
/* Section genap: latar aksen pekat + pola wajik samar (ritme terang-gelap). */
div[data-section-id]:nth-child(even) .ab-section {
  background:
    radial-gradient(
      110% 50% at 50% 0%,
      color-mix(in srgb, var(--ab-acc) 30%, transparent),
      transparent 65%
    ),
    repeating-linear-gradient(
      45deg,
      color-mix(in srgb, var(--ab-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--ab-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--ab-acc) 28%, var(--ab-paper)),
      color-mix(in srgb, var(--ab-acc) 20%, var(--ab-paper))
    );
}
/* Bingkai ornamen ganda di tiap section (kartu berbingkai emas/aksen). */
.ab-section {
  border: 2px solid color-mix(in srgb, var(--ab-acc) 60%, transparent);
  outline: 1px solid color-mix(in srgb, var(--ab-acc) 40%, transparent);
  outline-offset: 6px;
  border-radius: 24px;
  margin: 20px 14px;
}
/* Foto mempelai bentuk arch (lengkung atas) + bingkai emas + bayangan. */
.ab-foto {
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--ab-acc) 45%, transparent);
}
/* Drift lebih kentara: opacity naik (page variant). */
.ab-drift--page .ab-drift__item svg {
  opacity: 0.4;
}

/* === Tombol Lihat Lokasi (12 Nov 2026): lengkapi data preview === */
.ab-maps {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ab-acc);
  color: var(--ab-on-acc, #fff);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
