/* assets/css/template-cinematic.css - tema "Cinematic" (Full Animasi)
   Palet hitam premium + emas, tipografi serif elegan (Cormorant Garamond) + sans ringan (Jost).
   BEDA dari tema lain: seluruh halaman (bukan cuma cover) bernuansa gelap - lihat catatan lengkap
   ttg lapisan animasi (preloader/partikel/parallax/scroll-reveal) di templates/cinematic/template.php. */

:root {
    --accent: #d4af37;
    --accent-soft: #a8925f;
    --bg: #0d0d0d;
    --text: #f2ead9;
    --line: #333029;
    --card: #171512;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1, h2, .mempelai-nama { font-family: 'Cormorant Garamond', Georgia, serif; }

.invite-wrap {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ---------- Preloader ---------- */
.cinematic-preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
.cinematic-preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.cinematic-preloader-monogram {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 50%;
    width: 92px; height: 92px;
    display: flex; align-items: center; justify-content: center;
    animation: cinematicPreloaderPulse 1.8s ease-in-out infinite;
}
@keyframes cinematicPreloaderPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}
/* Jaring pengaman CSS murni (tanpa JS) - kalau utk suatu alasan script gagal jalan sama sekali,
   preloader tetap otomatis hilang sendiri setelah ~4.5 detik lewat animasi ini. */
@keyframes cinematicPreloaderFallbackHide {
    0%, 95% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}
.cinematic-preloader { animation: cinematicPreloaderFallbackHide 4.5s forwards; }

/* ---------- Partikel melayang ---------- */
.cinematic-particles {
    position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden;
}
.cinematic-particle {
    position: absolute;
    top: -5%;
    border-radius: 50%;
    opacity: 0;
    animation-name: cinematicFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
.cinematic-particle.is-petal {
    background: linear-gradient(135deg, var(--accent), #f6e6b4);
    border-radius: 60% 0 60% 0;
}
.cinematic-particle.is-spark {
    background: var(--accent);
    box-shadow: 0 0 6px 1px rgba(212,175,55,0.7);
}
@keyframes cinematicFall {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    8% { opacity: 0.85; }
    92% { opacity: 0.6; }
    100% { transform: translate(var(--drift), 115vh) rotate(280deg); opacity: 0; }
}

/* ---------- Cover ---------- */
.cover-screen {
    height: 100vh;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 48px 32px;
    position: relative;
    will-change: background-position;
}
.cover-screen::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.8));
}
.cover-screen > * { position: relative; z-index: 1; }
.cover-screen .kepada { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; opacity: 0.85; }

/* Animasi intro: tiap elemen ber-class cinematic-intro / cinematic-word muncul fade+slide-up
   berurutan (delay dikontrol var CSS --d, diisi inline per elemen di template.php) - jalan OTOMATIS
   begitu halaman dimuat (BUKAN dipicu scroll, beda dari .cinematic-reveal section di bawah). */
.cinematic-intro, .cinematic-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(18px);
    animation: cinematicIntroIn 0.9s cubic-bezier(.2,.7,.3,1) forwards;
    animation-delay: calc(var(--d, 0) * 0.22s + 0.3s);
}
div.cinematic-intro { display: block; }
@keyframes cinematicIntroIn {
    to { opacity: 1; transform: translateY(0); }
}
.cinematic-cover-name {
    font-size: 44px;
    margin: 8px 0 14px;
    font-weight: 600;
    line-height: 1.2;
}
.cinematic-word { margin: 0 6px; }
.cinematic-amp { color: var(--accent); font-style: italic; }

.btn-open {
    margin-top: 18px;
    padding: 13px 34px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 500;
    text-transform: uppercase;
    font-family: 'Jost', sans-serif;
    transition: background 0.3s ease, color 0.3s ease;
}
.btn-open:hover { background: var(--accent); color: #171512; }

/* ---------- Content ---------- */
.content-section { display: none; }
.content-section.show { display: block; }

section { padding: 56px 28px; text-align: center; border-bottom: 1px solid var(--line); }
section h2 {
    font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent);
    margin: 0 0 20px; font-weight: 500;
}
.mempelai-nama { font-size: 34px; font-weight: 600; margin: 6px 0; color: #fff; }
.mempelai-anak { font-size: 13px; color: var(--accent-soft); margin-bottom: 8px; }
.cinematic-divider { color: var(--accent); font-size: 18px; margin: 16px 0; }

/* Scroll-reveal: dimulai tersembunyi (opacity 0, sedikit turun), JS menambah class "is-visible"
   begitu section masuk viewport (lihat IntersectionObserver di template.php) - transisi CSS di
   sini yang bikin efek fade+slide-nya, JS cuma toggle class. */
.cinematic-reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.cinematic-reveal.is-visible { opacity: 1; transform: translateY(0); }

#countdown { display: flex; gap: 8px; margin: 24px 0; justify-content: center; }
#countdown div { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px 8px; min-width: 58px; text-align: center; }
#countdown span { display: block; font-size: 22px; font-weight: 700; color: var(--accent); font-family: 'Cormorant Garamond', serif; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery-grid img { width: 100%; height: 110px; object-fit: cover; transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; }
.gallery-grid img:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(212,175,55,0.35); position: relative; z-index: 1; }

.map-frame iframe { width: 100%; height: 260px; border: 0; filter: grayscale(0.3) invert(0.92) contrast(0.9); }

.rsvp-form input, .rsvp-form select, .rsvp-form textarea {
    width: 100%; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line);
    border-radius: 2px; font-family: inherit; background: var(--card); color: var(--text);
}
.rsvp-form input::placeholder, .rsvp-form textarea::placeholder { color: #7a7365; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus {
    outline: none; border-color: var(--accent);
}
.btn-primary {
    background: var(--accent); color: #171512; border: none; padding: 13px 30px; border-radius: 2px; cursor: pointer;
    font-weight: 600; letter-spacing: 1px; text-transform: uppercase; font-size: 12px; font-family: 'Jost', sans-serif;
}

.guestbook-list { text-align: left; max-height: 300px; overflow-y: auto; margin-top: 16px; }
.guestbook-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.guestbook-item .nama { font-weight: 700; color: var(--accent); }
.guestbook-item .waktu { font-size: 11px; color: var(--accent-soft); }

.gift-box { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin-bottom: 12px; text-align: left; }
.gift-box img { max-width: 180px; display: block; margin: 10px auto; }

.flash-msg { padding: 12px; border-radius: 4px; margin: 16px 0; font-size: 14px; }
.flash-msg.success { background: #1c2a1c; color: #b7e0b7; }
.flash-msg.error { background: #2c1c1c; color: #e0b7b7; }

.rsvp-success-card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px 18px; text-align: center; }
.rsvp-success-icon { color: var(--accent); width: 40px; height: 40px; margin: 0 auto 10px; }
.rsvp-success-icon svg { width: 100%; height: 100%; }

.music-toggle {
    position: fixed; bottom: 16px; right: calc(50% - 240px + 16px);
    background: var(--accent); color: #171512; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; z-index: 10;
}

footer.credit { text-align: center; padding: 28px; font-size: 11px; color: var(--accent-soft); }

.vip-badge {
    display: inline-block; background: var(--accent); color: #171512; font-size: 10px; font-weight: 700;
    letter-spacing: 1.5px; padding: 5px 14px; border-radius: 2px; margin-top: 10px; text-transform: uppercase;
}
.qr-box { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin: 0 0 12px; text-align: center; }
.qr-box img { max-width: 220px; width: 100%; display: block; margin: 12px auto 0; background: #fff; padding: 8px; border-radius: 4px; }
.qr-box p { font-size: 13px; color: var(--accent-soft); margin: 0; }
.rsvp-form input[readonly] { background: #111; color: var(--accent-soft); cursor: not-allowed; }

/* ---------- Aksesibilitas: hormati prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .cinematic-particles { display: none; }
    .cinematic-intro, .cinematic-word { animation: none; opacity: 1; transform: none; }
    .cinematic-reveal { opacity: 1; transform: none; transition: none; }
    .cinematic-preloader { animation: none; }
    .cinematic-preloader-monogram { animation: none; }
}
