/**
 * Animasi masuk / keluar — kartu, teks, section (per template beda timing)
 */

@media (prefers-reduced-motion: reduce) {
    .inv-reveal,
    .inv-reveal.is-visible,
    .inv-section-enter,
    .inv-section-enter.is-visible {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
}

/* Animasi section dinonaktifkan — jangan sembunyikan konten */
.inv-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    will-change: auto;
}

.inv-reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

.inv-reveal-up,
.inv-reveal-down,
.inv-reveal-left,
.inv-reveal-right,
.inv-reveal-scale,
.inv-reveal-blur {
    transform: none;
}

.inv-reveal-down {
    transform: translate3d(0, -28px, 0);
}

.inv-reveal-left {
    transform: translate3d(-32px, 0, 0);
}

.inv-reveal-right {
    transform: translate3d(32px, 0, 0);
}

.inv-reveal-scale {
    transform: scale(0.92);
}

.inv-reveal-blur {
    filter: blur(8px);
    transform: translate3d(0, 20px, 0);
}

.inv-reveal.is-exiting {
    opacity: 0;
    transform: translate3d(0, 24px, 0) scale(0.98);
    transition-duration: 0.55s;
}

/* Stagger anak */
.inv-stagger > .inv-reveal:nth-child(1) { transition-delay: 0ms; }
.inv-stagger > .inv-reveal:nth-child(2) { transition-delay: 80ms; }
.inv-stagger > .inv-reveal:nth-child(3) { transition-delay: 160ms; }
.inv-stagger > .inv-reveal:nth-child(4) { transition-delay: 240ms; }
.inv-stagger > .inv-reveal:nth-child(5) { transition-delay: 320ms; }
.inv-stagger > .inv-reveal:nth-child(6) { transition-delay: 400ms; }

body.tpl-anim-fade-right .inv-reveal-up {
    transform: translate3d(40px, 12px, 0);
}

body.tpl-anim-fade-left .inv-reveal-up {
    transform: translate3d(-40px, 12px, 0);
}

body.tpl-anim-zoom-in .inv-reveal-up {
    transform: scale(0.88) translate3d(0, 20px, 0);
}

body.tpl-anim-flip-up .inv-reveal-up {
    transform: perspective(800px) rotateX(12deg) translate3d(0, 30px, 0);
}

/* Judul section — jangan miring (tanpa rotateX / skew) */
.section-heading-block.inv-reveal-up,
.section-heading.inv-reveal-up,
.inv-band-heading-stack.inv-reveal-up,
.inv-footer-thanks__title.inv-reveal-up,
.inv-footer-thanks__desc.inv-reveal-up,
.guestbook-wall-title.inv-reveal-up,
.guestbook-compose.inv-reveal-up,
.guestbook-entry.inv-reveal-up {
    transform: translate3d(0, 28px, 0) !important;
}

body.tpl-anim-flip-up .section-heading-block.inv-reveal-up,
body.tpl-anim-flip-up .section-heading.inv-reveal-up,
body.tpl-anim-flip-up .inv-band-heading-stack.inv-reveal-up,
body.tpl-anim-flip-up .inv-footer-thanks__title.inv-reveal-up,
body.tpl-anim-flip-up .inv-footer-thanks__desc.inv-reveal-up,
body.tpl-anim-flip-up .guestbook-compose.inv-reveal-up,
body.tpl-anim-flip-up .guestbook-entry.inv-reveal-up {
    transform: translate3d(0, 28px, 0) !important;
}

.section-heading-block.is-visible,
.section-heading.is-visible,
.inv-band-heading-stack.is-visible,
.inv-footer-thanks__title.is-visible,
.inv-footer-thanks__desc.is-visible {
    transform: none !important;
}

body.tpl-anim-slide-up .inv-reveal-up {
    transform: translate3d(0, 50px, 0);
}

/* Hover micro-interaction setelah visible */
.inv-reveal.is-visible.event-card:hover,
.inv-reveal.is-visible.readable-card:not(.guestbook-compose):hover,
.inv-reveal.is-visible.fluid-glass:hover {
    transform: translateY(-4px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.section-heading.inv-reveal.is-visible .section-title::after {
    animation: titleLineGrow 0.9s cubic-bezier(0.22, 1, 0.28, 1) 0.2s both;
}

@keyframes titleLineGrow {
    from { width: 0; opacity: 0; }
    to { width: min(4.5rem, 42%); opacity: 1; }
}

#gallery .gallery-item.inv-reveal.is-visible {
    transition-delay: calc(var(--inv-delay, 0) * 1ms);
}

/* ——— Profil animasi tambahan (per template / tpl-anim-*) ——— */
body.tpl-anim-rise-soft .inv-reveal-up,
body.tpl-anim-rise-soft .inv-section-enter {
    transform: translate3d(0, 28px, 0) scale(0.98);
}

body.tpl-anim-drift-in .inv-reveal-up,
body.tpl-anim-drift-in .inv-section-enter {
    transform: translate3d(36px, 16px, 0);
}

body.tpl-anim-tilt-up .inv-reveal-up {
    transform: perspective(900px) rotateX(10deg) translate3d(0, 26px, 0);
}

body.tpl-anim-tilt-up .inv-section-enter {
    transform: translate3d(0, 30px, 0);
}

body.tpl-anim-unfold .inv-reveal-up,
body.tpl-anim-unfold .inv-section-enter {
    transform: translate3d(0, 22px, 0) scale(0.96);
}

body.tpl-anim-rise-soft .inv-reveal-left { transform: translate3d(-24px, 14px, 0); }
body.tpl-anim-rise-soft .inv-reveal-right { transform: translate3d(24px, 14px, 0); }
body.tpl-anim-drift-in .inv-reveal-left { transform: translate3d(-40px, 10px, 0); }
body.tpl-anim-drift-in .inv-reveal-right { transform: translate3d(40px, 10px, 0); }
body.tpl-anim-unfold .inv-reveal-scale { transform: scale(0.94); }

/* Animasi masuk seluruh section (halus, tidak geser layout) */
.inv-section-enter.is-visible {
    opacity: 1;
}

.inv-section-enter.is-visible {
    opacity: 1;
    transform: none;
}

body.tpl-anim-fade-right .inv-section-enter {
    transform: translate3d(42px, 0, 0);
}

body.tpl-anim-fade-left .inv-section-enter {
    transform: translate3d(-42px, 0, 0);
}

body.tpl-anim-zoom-in .inv-section-enter {
    transform: scale(0.97) translate3d(0, 18px, 0);
}

body.tpl-anim-flip-up .inv-section-enter,
body.tpl-anim-slide-up .inv-section-enter {
    transform: translate3d(0, 40px, 0);
}

#hero.inv-section-enter.is-visible .hero-pattern__content > .inv-reveal {
    transition-delay: calc(80ms + var(--inv-delay, 0) * 1ms);
}

.inv-stagger > .inv-reveal:nth-child(7) { transition-delay: 480ms; }
.inv-stagger > .inv-reveal:nth-child(8) { transition-delay: 560ms; }

.invitation-gallery-grid.inv-stagger {
    display: grid;
}

