/* ==========================================================================
   1. RESET & GLOBAL BASE STYLES
   ========================================================================== */
*,
html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

html::-webkit-scrollbar body::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
}

/* Base element fonts & defaults */
h1 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: normal;
  margin: 0;
  padding: 0;
  font-size: 3rem;
}

p,
button:not(.control-btn) {
  font-family: "Metropolis", sans-serif;
  font-weight: 400;
  font-style: normal;
  margin: 0;
  padding: 0;
  font-size: small;
}

button:not(.control-btn) {
  border-radius: 0 !important;
}

small {
  font-family: "Metropolis", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: xx-small;
  margin: 0;
  padding: 0;
}

span {
  font-family: "Mea Culpa", cursive;
  font-weight: 400;
  font-style: normal;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   2. FONT DEFINITIONS (@font-face) & UTILITY FONT CLASSES
   ========================================================================== */
@font-face {
  font-family: "Metropolis";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src:
    url("https://cdn.jsdelivr.net/fontsource/fonts/metropolis@latest/latin-400-normal.woff2")
      format("woff2"),
    url("https://cdn.jsdelivr.net/fontsource/fonts/metropolis@latest/latin-400-normal.woff")
      format("woff");
}

.font1 {
  font-family: "Metropolis", sans-serif;
}

.font2 {
  font-family: "Instrument Serif", serif;
}

.font3 {
  font-family: "Mea Culpa", cursive;
}

/* ==========================================================================
   3. LAYOUT & STRUCTURE (Main Framework)
   ========================================================================== */
main {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

main section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.container,
.row {
  margin: 0 !important;
  padding: 0 !important;
}

#cover-undangan .container-fluid,
#home .container-fluid {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* ==========================================================================
   4. COVER UNDANGAN DECORATION & ANIMATION
   ========================================================================== */
#cover-undangan {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 9999;
  overflow: hidden;
  /* Kunci: Efek transisi dipasang di sini dengan presisi */
  transition:
    opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1),
    filter 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, filter;
}

/* Fade Out Blur State (Ketika Undangan Dibuka) */
#cover-undangan.hidden-animation {
  opacity: 0 !important;
  filter: blur(25px);
  pointer-events: none;
}

/* Pure CSS Fade In (Saat Load Awal) */
.animate-fade {
  opacity: 0;
  animation: fadeInEnter 0.8s ease-out forwards;
}

@keyframes fadeInEnter {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Timing Sequence Load Awal */
.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.6s;
}
.delay-3 {
  animation-delay: 1s;
}
.delay-4 {
  animation-delay: 1.4s;
}

/* ==========================================================================
   5. AOS (ANIMATION ON SCROLL) CONFIGURATION
   ========================================================================== */
/* Animation Base States */
[class*="aos-delay"] {
  opacity: 0;
  transition-property: opacity, transform, filter;
  transition-timing-function: ease-out;
}

.aos-delay1,
.aos-delay2,
.aos-delayimg1,
.aos-delayimg2,
.aos-delaytximg,
.aos-delayvert {
  transform: translateY(20px);
  filter: blur(10px);
}

.aos-delay3 {
  transform: translateY(20px);
}

/* Duration & Delay Timing */
.aos-delay1 {
  transition-duration: 800ms;
  transition-delay: 0ms;
}
.aos-delay2 {
  transition-duration: 800ms;
  transition-delay: 250ms;
}
.aos-delay3 {
  transition-duration: 800ms;
  transition-delay: 500ms;
}
.aos-delayvert {
  transition-duration: 1200ms;
  transition-delay: 500ms;
}
.aos-delayimg1 {
  transition-duration: 1200ms;
  transition-delay: 800ms;
}
.aos-delayimg2 {
  transition-duration: 1200ms;
  transition-delay: 1100ms;
}
.aos-delaytximg {
  transition-duration: 1000ms;
  transition-delay: 1500ms;
}

/* Animation Trigger */
section.aktif [class*="aos-delay"] {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ==========================================================================
   6. AUDIO CONTROLS (MUSIC BUTTONS)
   ========================================================================== */
.audio-controls-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

/* Menampilkan tombol kontrol setelah cover terbuka */
.audio-controls-wrapper.show {
  opacity: 1;
  visibility: visible;
}

/* Desain Tombol Lingkaran Minimalis */
.control-btn {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  background-color: rgba(26, 26, 26, 0.75);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

.control-btn:active {
  transform: scale(0.92);
}

/* Animasi Putar Piringan Musik (Spin) */
.spin-animation {
  animation: spin 4s linear infinite;
}

.spin-paused {
  animation-play-state: paused !important;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   7. COMPONENT SPECIFIC STYLES (Countdown, Gallery, General)
   ========================================================================== */
/* --- 7.1. Countdown Styling (Horizontal) --- */
.countdown-container {
  z-index: 2;
  width: 100%;
  padding: 0 15px;
}

.countdown-flex {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.countdown-item {
  text-align: center;
  flex: 1;
  max-width: 70px;
  color: #ffffff;
}

.countdown-number {
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.1;
}

.countdown-label {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-top: 4px;
}

/* --- 7.2. Gallery Grid Styling --- */
.gallery-img {
  max-height: 16vh;
  width: 100%;
  object-fit: cover;
  object-position: center;
  padding: 2px;
}

/* --- 7.3. Miscellaneous & Micro-Animations --- */
.animasi-icon {
  animation: panah-perintah 1.8s ease-in-out infinite;
}

@keyframes panah-perintah {
  0% {
    transform: translateY(-10px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(15px);
    opacity: 0;
  }
}

.transisiTeks {
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.foto-special {
  animation: smoothFadeZoomTwo 12s infinite ease-in-out;
  opacity: 0;
  z-index: 1;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.foto-close {
  animation: smoothFadeZoomOne 12s infinite ease-in-out;
  opacity: 1;
  z-index: 2;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
@keyframes smoothFadeZoomOne {
  0% {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
  }

  45% {
    opacity: 1;
    transform: scale(1.1);
    /* Zoom in maksimal gambar 1 */
    z-index: 2;
  }

  55% {
    opacity: 0;
    transform: scale(1.15);
    /* Gambar 1 terus membesar sedikit saat memudar keluar */
    z-index: 1;
  }

  95% {
    opacity: 0;
    transform: scale(1);
    /* Kembali ke ukuran awal saat tidak terlihat */
    z-index: 1;
  }

  100% {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
  }
}

@keyframes smoothFadeZoomTwo {
  0% {
    opacity: 0;
    transform: scale(1);
    /* Bersiap di ukuran awal */
    z-index: 1;
  }

  45% {
    opacity: 0;
    transform: scale(1.1);
    /* MENYAMAKAN SKALA: Gambar 2 dipaksa ke 1.1 sebelum muncul */
    z-index: 1;
  }

  55% {
    opacity: 1;
    transform: scale(1.15);
    /* MENYAMAKAN SKALA: Gambar 2 muncul di skala 1.15 (meneruskan Gambar 1) */
    z-index: 2;
  }

  95% {
    opacity: 1;
    transform: scale(1);
    /* Gambar 2 melakukan Zoom Out secara perlahan ke ukuran normal */
    z-index: 2;
  }

  100% {
    opacity: 0;
    transform: scale(1);
    /* Memudar keluar */
    z-index: 1;
  }
}

.image-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  opacity: 0;
  animation: bgSlideshow 12s infinite linear;
}

.img-1 {
  animation-delay: 0s;
}

.img-2 {
  animation-delay: 4s;
}

.img-3 {
  animation-delay: 8s;
}

@keyframes bgSlideshow {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  8.33% {
    opacity: 1;
  }
  33.33% {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: scale(1.12);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* ==========================================================================
   8. RESPONSIVE LAYOUT FOR WIDE SCREENS (DESKTOP & TABLET)
   ========================================================================== */
@media (min-width: 992px) {
  /* 1. KONDISI AWAL COVER (Desktop): Penuh 100% di depan */
  #cover-undangan {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100vh !important;
    z-index: 9999;
    opacity: 1 !important;
    filter: blur(0) !important;
    pointer-events: auto !important;
    /* Efek transisi smooth saat menyusut dari 100% ke 70% */
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
  }

  /* 2. LOGIKA DESKTOP: Saat diklik, menyusut ke 70%, TIDAK HILANG, TIDAK BLUR */
  #cover-undangan.hidden-animation {
    width: 70% !important;
    opacity: 1 !important;
    filter: blur(0) !important;
    pointer-events: none; /* Klik bisa menembus jika ada elemen di bawahnya */
  }

  /* 3. KHUSUS DESKTOP: Sembunyikan hanya tombol buka undangan di dalam cover */
  #cover-undangan.hidden-animation #btnBuka {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.5s ease;
  }

  /* 4. MAIN CONTAINER: Izinkan scroll halaman secara normal */
  main {
    height: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: none !important;
    position: relative;
    display: block !important;
  }

  /* 5. SELURUH KONTEN (Home sampai Galeri): Otomatis berbaris di lajur kanan (30%) */
  main section {
    margin-left: 70% !important; /* Ruang kosong untuk cover yang menyusut */
    width: 30% !important; /* Lebar konten hanya 30% */
    height: auto !important;
    min-height: 100vh;
    scroll-snap-align: none !important;
    position: relative;
    display: block !important;
    box-sizing: border-box;
  }

  /* 6. Penyesuaian Komponen Lajur Kanan */
  .countdown-flex {
    gap: 6px !important;
  }
  .countdown-item {
    max-width: 55px !important;
  }
  .countdown-number {
    font-size: 1.2rem !important;
  }
  .gallery-img {
    max-height: 20vh !important;
  }
  .video-bg {
    left: 70% !important;
    width: 30% !important;
  }
  .image-bg {
    left: 70% !important;
    width: 30% !important;
  }
}
