/* ══════════════════════════════════════════════════════════════
   CODINE FELICI — Animazioni morbide e casarecce
   ══════════════════════════════════════════════════════════════ */

/* ─── Fade Up ───────────────────────────────────────────────── */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity .6s ease,
        transform .6s ease;
    transition-delay: var(--delay, 0s);
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Feature cards ─────────────────────────────────────────── */
.feature-card {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .5s ease, transform .5s ease,
                border-color .3s, box-shadow .3s;
}
.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.features-grid .feature-card:nth-child(1) { transition-delay: .08s; }
.features-grid .feature-card:nth-child(2) { transition-delay: .16s; }
.features-grid .feature-card:nth-child(3) { transition-delay: .24s; }

/* ─── Value cards ───────────────────────────────────────────── */
.value-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .45s ease, transform .45s ease,
                border-color .3s, box-shadow .3s;
}
.value-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.values-grid .value-card:nth-child(1) { transition-delay: .05s; }
.values-grid .value-card:nth-child(2) { transition-delay: .1s; }
.values-grid .value-card:nth-child(3) { transition-delay: .15s; }
.values-grid .value-card:nth-child(4) { transition-delay: .2s; }

/* ─── Post cards ────────────────────────────────────────────── */
.post-card {
    opacity: 0;
    transform: translateY(14px);
    animation: postIn .45s ease forwards;
}
@keyframes postIn {
    to { opacity: 1; transform: translateY(0); }
}
.posts-container .post-card:nth-child(1)  { animation-delay: .04s; }
.posts-container .post-card:nth-child(2)  { animation-delay: .08s; }
.posts-container .post-card:nth-child(3)  { animation-delay: .12s; }
.posts-container .post-card:nth-child(4)  { animation-delay: .16s; }
.posts-container .post-card:nth-child(5)  { animation-delay: .2s; }
.posts-container .post-card:nth-child(6)  { animation-delay: .24s; }
.posts-container .post-card:nth-child(7)  { animation-delay: .28s; }
.posts-container .post-card:nth-child(8)  { animation-delay: .32s; }
.posts-container .post-card:nth-child(9)  { animation-delay: .36s; }
.posts-container .post-card:nth-child(10) { animation-delay: .4s; }
.posts-container .post-card:nth-child(11) { animation-delay: .44s; }
.posts-container .post-card:nth-child(12) { animation-delay: .48s; }

/* ─── Donate cards ──────────────────────────────────────────── */
.donate-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .45s ease, transform .45s ease,
                border-color .3s, box-shadow .3s;
}
.donate-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.donate-cards .donate-card:nth-child(1) { transition-delay: .08s; }
.donate-cards .donate-card:nth-child(2) { transition-delay: .16s; }
.donate-cards .donate-card:nth-child(3) { transition-delay: .24s; }

/* ─── Page transitions ──────────────────────────────────────── */
.page {
    animation: pageIn .4s ease forwards;
}
@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }
}
