/* Explain: Contains custom animations for staggered entrances, idle motion, and hover effects. */
/* SAAM Kerk — enriched motion layer.
   Staggered entrances, idle motion and hover feedback layered on top of
   the base animations defined in css/components.css. */

@keyframes childRise {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes kickerGrow {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes dotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0.45rem var(--terracotta-soft);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 0.62rem var(--terracotta-soft);
        transform: scale(1.16);
    }
}

@keyframes frameFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* The kicker line draws in from the left */
.section-kicker::before {
    transform-origin: left center;
}

/* --- Staggered entrances when a section scrolls into view --- */
.reveal-in .class-card,
.reveal-in .amenity-row,
.reveal-in .quiet-detail {
    animation: childRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-in .class-card:nth-of-type(1),
.reveal-in .amenity-row:nth-of-type(1),
.reveal-in .quiet-detail:nth-of-type(1) {
    animation-delay: 0.05s;
}

.reveal-in .class-card:nth-of-type(2),
.reveal-in .amenity-row:nth-of-type(2),
.reveal-in .quiet-detail:nth-of-type(2) {
    animation-delay: 0.18s;
}

.reveal-in .class-card:nth-of-type(3),
.reveal-in .amenity-row:nth-of-type(3) {
    animation-delay: 0.3s;
}

.reveal-in .amenity-row:nth-of-type(4) {
    animation-delay: 0.42s;
}

.reveal-in .section-kicker::before {
    animation: kickerGrow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Idle motion --- */
.arch-frame {
    animation: frameFloat 9s ease-in-out infinite;
}

.amenity-dot {
    animation: dotPulse 3.4s ease-in-out infinite;
}

.amenity-row:nth-of-type(even) .amenity-dot {
    animation-delay: 0.8s;
}

/* --- Hover feedback --- */
.amenity-row,
.quiet-detail {
    transition: transform 320ms ease, border-color 320ms ease, background 320ms ease;
}

.amenity-row:hover,
.quiet-detail:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(26, 26, 26, 0.78);
}

.class-card .fa-solid {
    transition: transform 320ms ease;
}

.class-card:hover .fa-solid {
    transform: translateY(-5px) scale(1.15);
}

/* --- Dynamically added prayer cards --- */
.prayer-card-in {
    animation: childRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Mobile action bar entrance --- */
.mobile-book-bar {
    animation: childRise 0.6s ease 0.6s both;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .reveal-in .class-card,
    .reveal-in .amenity-row,
    .reveal-in .quiet-detail,
    .reveal-in .section-kicker::before,
    .arch-frame,
    .amenity-dot,
    .prayer-card-in,
    .mobile-book-bar {
        animation: none;
    }
}