/* =========================================================
   BNHS PUBLIC SITE - ANIMATION ONLY
   Adds motion to the existing design; changes no colours, fonts or layout.
   The "hidden until animated" states apply only after assets/js/motion.js has
   added .bnhs-motion to <html>, so without the script every page looks as before.
   To remove: delete this file's <link> in includes/header.php and the
   motion.js <script> in includes/footer.php.
   ========================================================= */

:root {
    --m-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- page titles rise in on load ---------- */

.bnhs-motion .hero-bnhs h1,
.bnhs-motion .hero-bnhs-photo h1,
.bnhs-motion .hero-bnhs p,
.bnhs-motion .hero-bnhs-photo p,
.bnhs-motion .hero-bnhs-photo .hero-actions {
    animation: m-rise 0.9s var(--m-ease) both;
}

.bnhs-motion .hero-bnhs h1,
.bnhs-motion .hero-bnhs-photo h1 { animation-delay: 0.08s; }

.bnhs-motion .hero-bnhs p:not(.section-label),
.bnhs-motion .hero-bnhs-photo p:not(.section-label) { animation-delay: 0.22s; }

.bnhs-motion .hero-bnhs-photo .hero-actions { animation-delay: 0.36s; }

/* the home hero photo eases in slowly */
.bnhs-motion .hero-bnhs-photo {
    animation: m-photo 1.6s ease-out both;
}

/* the three cards under the home hero follow each other in */
.bnhs-motion .identity-cards-overlap > div {
    animation: m-rise 0.8s var(--m-ease) both;
}

.bnhs-motion .identity-cards-overlap > div:nth-child(1) { animation-delay: 0.45s; }
.bnhs-motion .identity-cards-overlap > div:nth-child(2) { animation-delay: 0.55s; }
.bnhs-motion .identity-cards-overlap > div:nth-child(3) { animation-delay: 0.65s; }

/* ---------- content rises in as you scroll to it ---------- */

.bnhs-motion [data-m-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s var(--m-ease), transform 0.9s var(--m-ease);
    transition-delay: var(--m-delay, 0ms);
}

.bnhs-motion [data-m-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* ---------- gentle responses to the pointer ---------- */

.program-card,
.identity-card,
.campus-photo,
.explore-card,
section .card:has(.news-card-media) {
    transition: transform 0.35s var(--m-ease), box-shadow 0.35s var(--m-ease);
}

.program-card:hover,
.identity-card:hover,
section .card:has(.news-card-media):hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(11, 42, 74, 0.14) !important;
}

.program-card-icon,
.identity-icon-flat {
    display: inline-block;
    transition: transform 0.4s var(--m-ease);
}

.program-card:hover .program-card-icon,
.identity-card:hover .identity-icon-flat {
    transform: scale(1.15) rotate(-6deg);
}

/* news pictures zoom slightly inside their frame */
section .card:has(.news-card-media) > a {
    display: block;
    overflow: hidden;
}

.news-card-media {
    transition: transform 0.7s var(--m-ease);
}

section .card:has(.news-card-media):hover .news-card-media {
    transform: scale(1.06);
}

.campus-photo {
    overflow: hidden;
}

.campus-photo img {
    transition: transform 0.8s var(--m-ease);
}

.campus-photo:hover img {
    transform: scale(1.05);
}

/* the navigation bar gains a soft shadow once the page scrolls */
.navbar-bnhs {
    transition: box-shadow 0.3s ease;
}

.navbar-bnhs.is-scrolled {
    box-shadow: 0 6px 20px rgba(7, 29, 51, 0.35);
}

/* ---------- keyframes ---------- */

@keyframes m-rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}

/* the gate photo settles slowly into its usual position */
@keyframes m-photo {
    from { background-position: center, center 55%; }
    to { background-position: center, center 35%; }
}

/* ---------- visitors who prefer less motion get the page still ---------- */

@media (prefers-reduced-motion: reduce) {

    .program-card,
    .identity-card,
    .news-card-media,
    .campus-photo img,
    section .card:has(.news-card-media) {
        transition: none !important;
    }

    .program-card:hover,
    .identity-card:hover,
    section .card:has(.news-card-media):hover {
        transform: none;
    }

    .news-card-media,
    .campus-photo img,
    .program-card-icon,
    .identity-icon-flat {
        transform: none !important;
    }
}
