/* =============================================================================
   Traditional Batak — tier Premium (Wedding26).
   Konsep: Merah marun gelap + hitam + emas; motif ulos/geometris emas di tepi; ilustrasi rumah adat Batak (rumah bolon) di tengah cover; section hitam untuk jadwal; adat megah sakral gelap.
   Palet: aksen #c9a227, kertas #1c1214, tinta #f0e6d2.
   Tipografi: Cinzel + Jost.
   CSS ini SUMBER KEBENARAN; `scripts/build-theme-css.mjs` menyalinnya ke
   `public/themes/traditional-batak.{hash}.css`. JANGAN di-import dari index.tsx
   (DECISIONS #31) — ia dikirim lewat <ThemeStyles slug="traditional-batak" />.
============================================================================= */

.tb {
  --tb-acc: #c9a227;
  --tb-acc-text: #d9b64a;
  --tb-on-acc: #141210;
  --tb-paper: #1c1214;
  --tb-ink: #f0e6d2;
  --tb-muted: rgba(240, 230, 210, 0.68);
  --tb-line: rgba(201, 162, 39, 0.45);
  --tb-card: #2a1a1e;
  --tb-dark: #100a0c;
  --tb-dark-ink: #f0e6d2;
  --tb-dark-muted: rgba(240, 230, 210, 0.7);
  --tb-dark-line: rgba(201, 162, 39, 0.5);
  --tb-disp-stack: var(--tb-disp), "Times New Roman", serif;
  --tb-body-stack: var(--tb-body), system-ui, sans-serif;

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

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

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

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

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

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

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

/* Galeri: gambar langsung anak section → grid 2 kolom. */
.tb-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. */
.tb-section > div > button {
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--tb-acc);
  background: var(--tb-acc);
  color: var(--tb-on-acc);
  font-family: var(--tb-body-stack);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* Motif ULOS: pita belah-ketupat emas di atas & bawah tiap section. */
.tb-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='14'%3E%3Cg fill='none' stroke='%23c9a227' stroke-opacity='0.75'%3E%3Cpath d='M18 1 L35 7 L18 13 L1 7 Z'/%3E%3Ccircle cx='18' cy='7' r='1.6' fill='%23c9a227'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 36px 14px;
  opacity: 0.9;
}
.tb-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='14'%3E%3Cg fill='none' stroke='%23c9a227' stroke-opacity='0.75'%3E%3Cpath d='M18 1 L35 7 L18 13 L1 7 Z'/%3E%3Ccircle cx='18' cy='7' r='1.6' fill='%23c9a227'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 36px 14px;
  opacity: 0.9;
}
/* Rumah BOLON di cover: siluet atap bertanduk di atas judul (SVG). */
.tb-cover::before {
  content: "";
  position: absolute;
  top: 7%;
  left: 50%;
  width: 220px;
  height: 64px;
  transform: translateX(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='64' viewBox='0 0 220 64'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1.8'%3E%3Cpath d='M10 22 L110 4 L210 22'/%3E%3Cpath d='M10 22 C30 12 40 12 52 20 M168 20 C180 12 190 12 210 22'/%3E%3Cpath d='M30 22 V52 M190 22 V52 M30 52 H190'/%3E%3Cpath d='M70 22 V52 M150 22 V52 M110 14 V52'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 220px 64px;
  opacity: 0.95;
}
/* Section jadwal HITAM solid. */
.tb-stage > div[data-section-id="schedule"] > .tb-section {
  background: var(--tb-dark);
  color: var(--tb-darkInk);
}
.tb-stage > div[data-section-id="schedule"] .tb-eyebrow,
.tb-stage > div[data-section-id="schedule"] .tb-title {
  color: var(--tb-darkInk);
}
/* Judul: Cinzel kapital emas, megah. */
.tb-title {
  color: #e3c15c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 26px;
}
.tb-eyebrow {
  color: #d9b64a;
}
/* Countdown: kotak hitam berbingkai emas, angka emas. */
.tb .count-box {
  background: #100a0c;
  border-color: var(--tb-line);
}
.tb .count-num {
  color: #e3c15c;
}
/* Tombol buka: emas solid. */
.tb-open {
  background: var(--tb-acc);
  color: #141210;
  border: 1px solid var(--tb-acc);
}

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

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

/* Hormati prefers-reduced-motion: konten tetap lengkap tanpa animasi. */
@media (prefers-reduced-motion: reduce) {
  .tb * {
    animation: none !important;
    transition: none !important;
  }
  .tb.is-js .tb-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. */
.tb-drift {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 700px;
}
.tb-drift--page {
  position: fixed;
  z-index: 40;
}
.tb-drift__item {
  position: absolute;
  top: 0;
  display: block;
  transform-style: preserve-3d;
}
.tb-drift__move {
  display: block;
  animation: tb-drift-twinkle ease-in-out infinite;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}
.tb-drift__item svg {
  display: block;
  animation: tb-drift-sway 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.25));
}
.tb-drift__item:nth-child(even) svg {
  animation-duration: 3s;
}
.tb-drift--page .tb-drift__item svg {
  opacity: 0.55;
}
@keyframes tb-drift-twinkle {
  0%,
  100% {
    transform: scale(0.55) rotate(0deg);
    opacity: 0.15;
  }
  50% {
    transform: scale(1.15) rotate(20deg);
    opacity: 0.95;
  }
}
@keyframes tb-drift-sway {
  from {
    transform: translateX(-16px) rotate(-12deg) rotateY(-10deg);
  }
  to {
    transform: translateX(16px) rotate(12deg) rotateY(10deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tb-drift {
    display: none;
  }
}

/* Lapisan sampul 3D halus: judul paling depan, eyebrow & tombol di belakangnya. */
.tb-cover {
  perspective: 1100px;
}
.tb-cover-inner,
.tb-cover-inner > div {
  transform-style: preserve-3d;
}
.tb-cover-inner .tb-eyebrow {
  transform: translateZ(14px);
}
.tb-cover-inner .tb-title {
  transform: translateZ(30px);
}
.tb-cover-inner .tb-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. */
.tb.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;
}
.tb.is-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Foto & kartu di dalam section: muncul menyusul (stagger) setelah section. */
.tb.is-js .reveal img,
.tb.is-js .reveal .tb-card,
.tb.is-js .reveal .tb-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;
}
.tb.is-js .reveal.is-visible img,
.tb.is-js .reveal.is-visible .tb-card,
.tb.is-js .reveal.is-visible .tb-foto {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .tb.is-js .reveal,
  .tb.is-js .reveal img,
  .tb.is-js .reveal .tb-card,
  .tb.is-js .reveal .tb-foto {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* Latar berlapis tiap section: semburat aksen di atas + gradien kertas ke aksen. */
.tb-section {
  background:
    radial-gradient(
      120% 55% at 50% 0%,
      color-mix(in srgb, var(--tb-acc) 12%, transparent),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      var(--tb-paper),
      color-mix(in srgb, var(--tb-paper) 84%, var(--tb-acc))
    );
  padding: clamp(84px, 14vw, 128px) 20px;
}
/* Preview lebih panjang: foto mempelai & galeri lebih besar. */
.tb-foto {
  width: min(82%, 320px);
}
.tb-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) .tb-section {
  background:
    radial-gradient(
      110% 50% at 50% 0%,
      color-mix(in srgb, var(--tb-acc) 30%, transparent),
      transparent 65%
    ),
    repeating-linear-gradient(
      45deg,
      color-mix(in srgb, var(--tb-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--tb-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--tb-acc) 28%, var(--tb-paper)),
      color-mix(in srgb, var(--tb-acc) 20%, var(--tb-paper))
    );
}
/* Bingkai ornamen ganda di tiap section (kartu berbingkai emas/aksen). */
.tb-section {
  border: 2px solid color-mix(in srgb, var(--tb-acc) 60%, transparent);
  outline: 1px solid color-mix(in srgb, var(--tb-acc) 40%, transparent);
  outline-offset: 6px;
  border-radius: 24px;
  margin: 20px 14px;
}
/* Foto mempelai bentuk arch (lengkung atas) + bingkai emas + bayangan. */
.tb-foto {
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--tb-acc) 45%, transparent);
}
/* Drift lebih kentara: opacity naik (page variant). */
.tb-drift--page .tb-drift__item svg {
  opacity: 0.4;
}

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