/* [DIHAPUS] Trik "body{visibility:visible}" di baris pertama file ini SUDAH TIDAK DIPAKAI LAGI --
   ternyata inilah sumber bug "isi undangan sekilas kelihatan tanpa gaya" di koneksi lambat: browser
   bisa menerapkan baris PALING ATAS file CSS eksternal ini sebelum SISA file (ukuran font, dst) selesai
   diproses. Kunci FOUC sekarang HANYA dibuka lewat event "load" pada tag <link> stylesheet ini di
   functions.php (digitaluxs_render_template_by_slug) -- lihat komentar di sana. */

/* Font Google dimuat lewat <link> di functions.php (lebih cepat), bukan @import di sini */
:root {
    --kl-langit: #6EC1E4;
    --kl-langit-deep: #4FA8D1;
    --kl-kuning: #FFD34E;
    --kl-merah: #E85D5D;
    --kl-merah-deep: #B94444;
    --kl-hijau: #68D391;
    --kl-teal: #2C7A7B;
    --kl-jalan: #4A5568;
    --kl-ink: #2D3748;
    --kl-cream: #F7FBFE;
    --kl-line: rgba(45,55,72,0.12);
}

.kl-undangan { font-family: 'Quicksand', sans-serif; color: var(--kl-ink); background: var(--kl-cream); overflow-x: hidden; }
.kl-undangan * { box-sizing: border-box; }

/* ============ SAMPUL ============ */
.kl-cover {
    position: fixed;
    inset: 0;
    z-index: 999;
    overflow: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.kl-cover.kl-cover-tertutup { opacity: 0; visibility: hidden; pointer-events: none; }

.kl-cover-langit {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--kl-langit) 0%, #A8DDF0 55%, #C8ECD9 100%);
}

.kl-matahari { position: absolute; top: 8%; right: 10%; width: 68px; height: 68px; background: var(--kl-kuning); border-radius: 50%; animation: klDenyut 3s ease-in-out infinite; }
@keyframes klDenyut { 0%, 100% { box-shadow: 0 0 0 8px rgba(255,211,78,0.35); } 50% { box-shadow: 0 0 0 14px rgba(255,211,78,0.2); } }
.kl-sinar { position: absolute; top: 8%; right: 10%; width: 68px; height: 68px; }

.kl-bintang { position: absolute; font-size: 13px; color: #fff; animation: klKelip 1.6s ease-in-out infinite; }
@keyframes klKelip { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.1); } }

.kl-awan { position: absolute; opacity: 0.95; }
.kl-awan svg { width: 100%; height: 100%; display: block; }
.kl-awan-1 { top: 14%; width: 85px; height: 38px; animation: klGeserKanan 26s linear infinite; }
.kl-awan-2 { top: 24%; width: 60px; height: 28px; animation: klGeserKanan 34s linear infinite; animation-delay: -10s; }
.kl-awan-3 { top: 33%; width: 50px; height: 24px; animation: klGeserKanan 20s linear infinite; animation-delay: -5s; }
.kl-burung { position: absolute; top: 18%; animation: klGeserKanan 14s linear infinite; animation-delay: -3s; }
@keyframes klGeserKanan { from { left: -100px; } to { left: 110%; } }

.kl-rumput { position: absolute; bottom: 130px; left: 0; right: 0; height: 18px; background: var(--kl-hijau); z-index: 2; }
.kl-jalan { position: absolute; bottom: 0; left: 0; right: 0; height: 130px; background: var(--kl-jalan); z-index: 2; }
.kl-jalan::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: #F6AD55; }
.kl-garis-jalan {
    position: absolute; bottom: 65px; left: 0; right: -200%; height: 6px; z-index: 3;
    background-image: repeating-linear-gradient(90deg, var(--kl-kuning) 0 24px, transparent 24px 44px);
    animation: klGarisGeser 1.4s linear infinite;
}
@keyframes klGarisGeser { from { transform: translateX(0); } to { transform: translateX(68px); } }

.kl-pohon { position: absolute; bottom: 148px; z-index: 2; width: 30px; }
.kl-pohon-1 { left: 4px; }
.kl-pohon-2 { right: 6px; }
.kl-rambu { position: absolute; bottom: 148px; left: 42%; width: 30px; z-index: 2; }

.kl-roda { animation: klRoda 0.6s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes klRoda { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.kl-bus-wrap { position: absolute; bottom: 148px; width: 128px; z-index: 4; animation: klMajuKanan 9s linear infinite, klGoyang 0.5s ease-in-out infinite alternate; }
.kl-mobil-wrap { position: absolute; bottom: 144px; width: 76px; z-index: 4; animation: klMajuKiri 7s linear infinite, klGoyangKiri 0.4s ease-in-out infinite alternate; animation-delay: -2.5s, -0.2s; }
.kl-motor-wrap { position: absolute; bottom: 148px; width: 46px; z-index: 4; animation: klMajuKanan 5.5s linear infinite, klGoyang 0.35s ease-in-out infinite alternate; animation-delay: -1.2s, -0.1s; }
@keyframes klMajuKanan { from { left: -160px; } to { left: 400px; } }
@keyframes klMajuKiri { from { left: 400px; } to { left: -110px; } }
@keyframes klGoyang { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
@keyframes klGoyangKiri { from { transform: scaleX(-1) translateY(0); } to { transform: scaleX(-1) translateY(-2.5px); } }

.kl-cover-frame {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 55px 30px 0 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.kl-eyebrow {
    display: inline-block;
    background: #fff;
    color: var(--kl-teal);
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 18px;
    border-radius: 30px;
    margin-bottom: 18px;
}
.kl-cover-nama {
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    font-size: 50px;
    color: #fff;
    text-shadow: 0 4px 0 var(--kl-merah), 0 4px 12px rgba(0,0,0,0.15);
    line-height: 1;
    margin: 0 0 14px 0;
}
.kl-cover-usia-badge {
    display: inline-block;
    background: var(--kl-merah);
    color: #fff;
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: 16px;
    padding: 7px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 0 var(--kl-merah-deep);
    margin-bottom: 18px;
}

.kl-cover-countdown { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.kl-cover-cd-box { background: rgba(255,255,255,0.85); border-radius: 10px; padding: 8px 6px; text-align: center; min-width: 42px; }
.kl-cover-cd-angka { display: block; font-family: 'Baloo 2', cursive; font-size: 20px; font-weight: 700; color: var(--kl-merah); line-height: 1.2; }
.kl-cover-cd-label { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--kl-ink); opacity: 0.7; }

.kl-cover-tamu-kartu { margin-bottom: 16px; }
.kl-cover-tamu-label { margin: 0 0 8px 0; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.kl-cover-tamu-nama-kotak {
    background: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    min-height: 24px;
    margin: 0 0 8px 0;
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: 16px;
    color: var(--kl-ink);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.kl-cover-tamu-catatan { margin: 0; font-size: 10px; font-style: italic; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }

.kl-btn-buka {
    font-family: 'Baloo 2', cursive;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 34px;
    border-radius: 30px;
    border: none;
    background: var(--kl-merah);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--kl-merah-deep);
    transition: transform 0.1s;
    margin-top: auto;
    margin-bottom: 24px;
}
.kl-btn-buka:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--kl-merah-deep); }

/* ============ TAB NAVIGASI MELAYANG ============ */
.kl-nav-melayang {
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) translateX(70px);
    z-index: 900000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,0.9);
    padding: 8px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.kl-nav-melayang.kl-nav-tampil { opacity: 1; transform: translateY(-50%) translateX(0); pointer-events: auto; }
.kl-nav-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--kl-cream);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
.kl-nav-btn:hover { transform: scale(1.08); }
.kl-nav-btn.aktif { background: var(--kl-kuning); }

/* ============ ISI ============ */
.kl-isi { position: relative; }
.kl-section { text-align: center; padding: 28px 24px; border-top: 2px dashed var(--kl-line); }
.kl-divider { font-size: 26px; display: block; margin-bottom: 14px; }
.kl-judul { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 24px; margin: 0 0 20px 0; color: var(--kl-ink); }

.kl-hero { text-align: center; padding: 50px 24px 25px 24px; }
.kl-hero-nama { font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 40px; margin: 0 0 8px 0; color: var(--kl-merah); }
.kl-hero-usia { font-family: 'Quicksand', sans-serif; font-size: 14px; font-weight: 700; color: var(--kl-teal); margin: 0 0 10px 0; }
.kl-hero-ortu { font-size: 14px; color: var(--kl-ink); opacity: 0.75; margin: 0 0 14px 0; }
.kl-hero-tanggal { font-size: 13px; letter-spacing: 0.5px; color: var(--kl-teal); font-weight: 700; }

.kl-foto-unggulan { padding: 0 24px 28px 24px; max-width: 640px; margin: 0 auto; }
.kl-foto-unggulan img { width: 100%; border-radius: 20px; display: block; box-shadow: 0 16px 40px rgba(45,55,72,0.15); border: 4px solid #fff; }

.kl-acara-blok { margin-bottom: 22px; }
.kl-acara-blok:last-of-type { margin-bottom: 0; }
.kl-acara-label { font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--kl-merah); margin-bottom: 8px; }
.kl-acara-waktu { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--kl-teal); }
.kl-lokasi-nama { font-size: 14px; margin-bottom: 10px; }
.kl-acara-pemisah { border: none; border-top: 2px dashed var(--kl-line); margin: 22px 0; }
.kl-dresscode { font-size: 13px; margin-top: 12px; opacity: 0.85; }

.kl-btn-outline {
    display: inline-block;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 30px;
    border: 2px solid var(--kl-teal);
    color: var(--kl-teal);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.kl-btn-outline:hover { background: var(--kl-teal); color: #fff; }

.kl-kado-list { text-align: left; }
.kl-kado-baris { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 4px; border-bottom: 2px dashed var(--kl-line); }
.kl-kado-baris:last-child { border-bottom: none; }
.kl-kado-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.kl-kado-bank { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 16px; color: var(--kl-teal); }
.kl-kado-nomor { font-size: 14px; font-weight: 700; letter-spacing: 0.3px; }
.kl-kado-pemilik { font-size: 12px; opacity: 0.65; }
.kl-kado-salin { font-size: 11px; padding: 8px 16px; flex-shrink: 0; }

.kl-galeri-grid { column-count: 2; column-gap: 10px; }
.kl-galeri-item { break-inside: avoid; margin-bottom: 10px; border-radius: 14px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(45,55,72,0.1); }
.kl-galeri-item img { width: 100%; height: auto; display: block; transition: transform 0.4s; }
.kl-galeri-item:hover img { transform: scale(1.05); }

.kl-form-rsvp { max-width: 420px; margin: 0 auto; text-align: left; }
.kl-form-group { margin-bottom: 16px; }
.kl-form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--kl-ink); }
.kl-form-group input, .kl-form-group select, .kl-form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--kl-line);
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    background: #fff;
    color: var(--kl-ink);
}
.kl-form-group input:focus, .kl-form-group select:focus, .kl-form-group textarea:focus { outline: none; border-color: var(--kl-teal); }
.kl-btn-submit { width: 100%; margin-bottom: 0; }
.kl-rsvp-pesan { margin-top: 12px; font-size: 13px; text-align: center; }

.kl-kutipan-ayat-teks { font-family: 'Baloo 2', cursive; font-size: 16px; line-height: 1.7; max-width: 480px; margin: 0 auto; color: var(--kl-teal); }
.kl-pengantar-teks { font-size: 15px; line-height: 1.8; max-width: 520px; margin: 0 auto; color: var(--kl-ink); }

.kl-penutup { text-align: center; padding: 30px 24px 50px 24px; }
.kl-penutup-teks { font-size: 14px; line-height: 1.8; max-width: 460px; margin: 0 auto 20px auto; color: var(--kl-ink); }
.kl-penutup-nama { font-family: 'Baloo 2', cursive; font-weight: 700; font-size: 28px; color: var(--kl-merah); }

.kl-riwayat-scroll { max-height: 480px; overflow-y: auto; text-align: left; padding-right: 6px; }
.kl-riwayat-baris { padding: 14px 4px; border-bottom: 2px dashed var(--kl-line); }
.kl-riwayat-baris:last-child { border-bottom: none; }
.kl-riwayat-atas { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.kl-riwayat-nama { font-size: 14px; color: var(--kl-ink); }
.kl-riwayat-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.kl-riwayat-hadir { background: rgba(104,211,145,0.25); color: #1f6b3f; }
.kl-riwayat-ragu { background: rgba(255,211,78,0.3); color: #8a5f16; }
.kl-riwayat-tidak { background: rgba(232,93,93,0.15); color: #a13a3a; }
.kl-riwayat-ucapan { margin: 0; font-size: 13px; color: var(--kl-ink); opacity: 0.85; line-height: 1.6; }
.kl-riwayat-kosong { font-size: 13px; opacity: 0.6; text-align: center; }

.kl-musik-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--kl-teal);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 9999999;
    box-shadow: 0 8px 20px rgba(44,122,123,0.4);
}

@media (max-width: 480px) {
    .kl-cover-nama { font-size: 40px; }
    .kl-hero-nama { font-size: 32px; }
    .kl-cover-cd-box { min-width: 36px; padding: 6px 4px; }
    .kl-nav-melayang { right: 8px; padding: 6px; gap: 8px; }
    .kl-nav-btn { width: 36px; height: 36px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .kl-cover, .kl-galeri-item img, .kl-bus-wrap, .kl-mobil-wrap, .kl-motor-wrap, .kl-roda, .kl-awan, .kl-burung, .kl-garis-jalan, .kl-matahari, .kl-bintang { animation: none; transition: none; }
}
