/* ==========================================================================
   Global Overflow Guard - Prevents sideways scrolling on mobile
   Scroll-reveal animations translate elements off-screen (e.g. -translate-x-20)
   before they animate into place; without this, browsers treat that painted
   area as scrollable content and add horizontal scroll/pan on small screens.
   ========================================================================== */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ==========================================================================
   Carousel Styling - Polished Responsive Design
   ========================================================================== */
.carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    height: min(88vh, 720px);
    z-index: 1;
}

/* Mobile Responsive Container */
@media screen and (max-width: 768px) {
    .carousel {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
        min-height: 520px;
        max-height: 82vh;
        margin-top: 0;
    }
}

.carousel .list {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Individual Slide Item: strictly hide inactive slides */
.carousel .list .item {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    isolation: isolate;
}

/* Inactive slides never display their content */
.carousel .list .item .content {
    display: none !important;
}

/* Active Slide (always first in the list) is visible & interactive */
.carousel .list .item:nth-child(1) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

.carousel .list .item:nth-child(1) .content {
    display: flex !important;
}

/* Previous slide animating out */
.carousel.prev .list .item:nth-child(2) {
    opacity: 1;
    visibility: visible;
    z-index: 3;
}

.carousel.prev .list .item:nth-child(2) .content {
    display: flex !important;
}

/* Base Image Styling */
.carousel .list .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Slide-specific focal points so faces and key subjects are preserved */
.carousel .list .item.slide-welcome img,
.carousel .list .item img[src*="hero1"] {
    object-position: center 58%;
}

.carousel .list .item.slide-academics img,
.carousel .list .item img[src*="hero2"] {
    object-position: 50% 32%;
}

.carousel .list .item.slide-compound img,
.carousel .list .item img[src*="hero3"] {
    object-position: 40% 50%;
}

.carousel .list .item.slide-activities img,
.carousel .list .item img[src*="farming"] {
    object-position: 50% 38%;
}

/* Gradient Scrim Overlay for High Contrast & Text Legibility */
.carousel .list .item::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    /* Bottom-anchored gradient for mobile: covers bottom 45%, leaving upper 55% clear */
    background: linear-gradient(
        to top,
        rgba(8, 21, 52, 0.96) 0%,
        rgba(8, 21, 52, 0.84) 28%,
        rgba(8, 21, 52, 0.42) 46%,
        rgba(8, 21, 52, 0.1) 62%,
        transparent 72%
    );
}

@media screen and (min-width: 769px) {
    .carousel .list .item::after {
        background: linear-gradient(
            to right,
            rgba(8, 21, 52, 0.92) 0%,
            rgba(8, 21, 52, 0.7) 42%,
            rgba(8, 21, 52, 0.2) 68%,
            transparent 100%
        ),
        linear-gradient(
            to top,
            rgba(8, 21, 52, 0.75) 0%,
            transparent 45%
        );
    }
}

/* Deliberate Content Zone */
.carousel .list .item .content {
    position: absolute;
    z-index: 10;
    box-sizing: border-box;
    color: #ffffff;
    flex-direction: column;
}

/* Mobile Content Zone Layout: bottom-anchored, disciplined max-width */
@media screen and (max-width: 768px) {
    .carousel .list .item .content {
        /* Lifted clear of both the .arrows nav (bottom-left) and the single
           "next slide" .thumbnail preview (bottom-right, top edge at 8rem),
           then nudged up further for a more balanced vertical composition */
        bottom: 9rem;
        top: auto;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        padding: 1.5rem 1rem 0.75rem 1rem;
        justify-content: flex-end;
    }

    .carousel .list .item .content .buttons {
        max-width: 100%;
    }
}

/* Mobile S (~320px) and other very narrow phones: trim the CTA button's
   horizontal padding so labels like "Co-curricular Activities" have enough
   room to stay on one line instead of wrapping */
@media screen and (max-width: 374px) {
    .carousel .list .item .content .buttons a,
    .carousel .list .item .content .buttons button {
        padding: 0.7rem 1.15rem;
    }
}

/* Desktop Content Zone Layout */
@media screen and (min-width: 769px) {
    .carousel .list .item .content {
        /* Slightly above center for a more balanced composition */
        top: 44%;
        transform: translateY(-50%);
        /* Mirror the navbar's max-w-[1400px] mx-auto px-8 container (2rem)
           plus the school badge's m-20 margin (5rem) = 7rem total left offset */
        left: max(calc((100vw - 1400px) / 2 + 7rem), 7rem);
        max-width: min(85%, 680px);
        padding: 0;
    }
}

/* Typography with Clamp & Comfortable Rhythm */
.carousel .list .item .title {
    font-size: clamp(1.4rem, 4.5vw + 0.35rem, 2.85rem);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
    max-width: min(100%, 540px);
}

.carousel .list .item .title h1 {
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    margin: 0;
}

.carousel .list .item .des {
    font-size: clamp(0.875rem, 1.8vw + 0.35rem, 1.05rem);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.94);
    margin-top: 0.65rem;
    margin-bottom: 0;
    max-width: min(92%, 520px);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* CTA Buttons */
.carousel .list .item .content .buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.15rem;
    position: relative;
    z-index: 10;
}

.carousel .list .item .content .buttons a,
.carousel .list .item .content .buttons button {
    min-height: 48px;
    min-width: 44px;
    padding: 0.75rem 1.75rem;
    font-size: clamp(0.875rem, 1.5vw + 0.35rem, 1rem);
    font-weight: 600;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    background-color: #d93633;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(217, 54, 51, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.carousel .list .item .content .buttons a:hover,
.carousel .list .item .content .buttons button:hover {
    background-color: #b51a1e;
    box-shadow: 0 6px 18px rgba(181, 26, 30, 0.45);
    transform: translateY(-1px);
}

.carousel .list .item .content .buttons a:active,
.carousel .list .item .content .buttons button:active {
    transform: scale(0.97);
}

/* Active Slide Stacking */
.carousel .list .item:nth-child(1) {
    z-index: 1;
}

/* Content Entrance Animations for Active Slide */
.carousel .list .item:nth-child(1) .content .title,
.carousel .list .item:nth-child(1) .content .des,
.carousel .list .item:nth-child(1) .content .buttons {
    transform: translateY(20px);
    opacity: 0;
    animation: showContent 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.carousel .list .item:nth-child(1) .content .title {
    animation-delay: 0.25s;
}

.carousel .list .item:nth-child(1) .content .des {
    animation-delay: 0.4s;
}

.carousel .list .item:nth-child(1) .content .buttons {
    animation-delay: 0.55s;
}

@keyframes showContent {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Desktop Thumbnail Strip */
.thumbnail {
    position: absolute;
    bottom: 40px;
    left: 52%;
    z-index: 20;
    display: flex;
    gap: 16px;
}

.thumbnail .item {
    width: 140px;
    height: 200px;
    flex-shrink: 0;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.thumbnail .item:hover {
    transform: translateY(-4px);
    border-color: #d93633;
}

.thumbnail .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Thumbnail Treatment: show only a single "next slide" preview,
   pinned to the bottom-right corner so it never crowds the active slide */
@media screen and (max-width: 768px) {
    .thumbnail {
        bottom: 1.75rem;
        left: auto;
        right: 1rem;
        gap: 0;
    }

    /* Only the first thumbnail (the upcoming/next slide) is shown */
    .thumbnail .item:not(:first-child) {
        display: none !important;
    }

    .thumbnail .item {
        width: 4.5rem;
        height: 6.25rem;
        border-radius: 10px;
    }
}

/* Arrows Navigation */
.arrows {
    position: absolute;
    bottom: 1.75rem;
    /* Mobile: same 1rem left as the carousel text */
    left: 1rem;
    right: auto;
    z-index: 25;
    display: flex;
    gap: 10px;
    align-items: center;
}

@media screen and (min-width: 769px) {
    .arrows {
        bottom: 40px;
        /* Desktop: mirror the carousel text left — px-8 (2rem) + badge m-20 (5rem) = 7rem */
        left: max(calc((100vw - 1400px) / 2 + 7rem), 7rem);
        right: auto;
        gap: 12px;
    }
}

.arrows button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(8, 21, 52, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.arrows button:hover,
.arrows button:focus-visible {
    background-color: #d93633;
    border-color: #d93633;
    color: #ffffff;
    transform: scale(1.06);
}

.arrows button:active {
    transform: scale(0.94);
}

/* Slide Transition Animations (Desktop) */
@media screen and (min-width: 769px) {
    .carousel.next .list .item:nth-child(1) img {
        width: 140px;
        height: 200px;
        position: absolute;
        bottom: 40px;
        left: 52%;
        border-radius: 16px;
        animation: showImageDesktop 0.5s ease-in-out 1 forwards;
    }

    @keyframes showImageDesktop {
        to {
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 0;
        }
    }

    .carousel.next .thumbnail .item:nth-last-child(1) {
        overflow: hidden;
        animation: showThumbnail 0.5s linear 1 forwards;
    }

    .carousel.next .thumbnail {
        animation: effectNext 0.5s linear 1 forwards;
    }

    @keyframes effectNext {
        from {
            transform: translateX(150px);
        }
    }

    .carousel.prev .list .item:nth-child(2) img {
        animation: outFrameDesktop 0.5s linear 1 forwards;
        position: absolute;
        bottom: 0;
        left: 0;
    }

    @keyframes outFrameDesktop {
        to {
            width: 140px;
            height: 200px;
            bottom: 40px;
            left: 52%;
            border-radius: 16px;
        }
    }
}

/* Slide Transition Animations (Mobile)
   The incoming image grows out from the bottom-right thumbnail "pocket"
   until it fills the screen - so the thumbnail visually *becomes* the new
   background, mirroring the desktop showImageDesktop/outFrameDesktop effect
   but anchored to the mobile thumbnail's position (bottom: 1.75rem; right: 1rem). */
@media screen and (max-width: 768px) {
    .carousel.next .list .item:nth-child(1) img {
        width: 4.5rem;
        height: 6.25rem;
        position: absolute;
        bottom: 1.75rem;
        right: 1rem;
        left: auto;
        border-radius: 10px;
        animation: showImageMobile 0.6s cubic-bezier(0.65, 0, 0.35, 1) 1 forwards;
    }

    @keyframes showImageMobile {
        to {
            bottom: 0;
            right: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 0;
        }
    }

    .carousel.prev .list .item:nth-child(2) img {
        animation: outFrameMobile 0.6s cubic-bezier(0.65, 0, 0.35, 1) 1 forwards;
        position: absolute;
        bottom: 0;
        left: 0;
    }

    @keyframes outFrameMobile {
        to {
            width: 4.5rem;
            height: 6.25rem;
            bottom: 1.75rem;
            right: 1rem;
            left: auto;
            border-radius: 10px;
        }
    }

    /* The newly-promoted thumbnail (the slide after next) eases into the
       pocket just after the outgoing thumbnail has expanded away.
       (The .prev direction already gets an equivalent fade-in from the
       global .carousel.prev .thumbnail .item:nth-child(1) rule below.) */
    .carousel.next .thumbnail .item:first-child {
        animation: showThumbnailMobile 0.4s ease-out 0.2s both;
    }

    @keyframes showThumbnailMobile {
        from {
            opacity: 0;
            transform: scale(0.8);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
}

.carousel.prev .list .item img {
    z-index: 100;
}

@keyframes showThumbnail {
    from {
        width: 0;
        opacity: 0;
    }
}

/* Running Time Indicator */
.carousel .time {
    position: absolute;
    z-index: 1000;
    width: 0%;
    height: 3px;
    background-color: #d93633;
    left: 0;
    top: 0;
}

.carousel.next .time,
.carousel.prev .time {
    animation: runningTime 3s linear 1 forwards;
}

@keyframes runningTime {
    from {
        width: 100%;
    }
    to {
        width: 0;
    }
}

.carousel.prev .list .item:nth-child(2) {
    z-index: 2;
}

.carousel.prev .thumbnail .item:nth-child(1) {
    overflow: hidden;
    opacity: 0;
    animation: showThumbnail 0.5s linear 1 forwards;
}

.carousel.next .arrows button,
.carousel.prev .arrows button {
    pointer-events: none;
}

.carousel.prev .list .item:nth-child(2) .content .title,
.carousel.prev .list .item:nth-child(2) .content .des,
.carousel.prev .list .item:nth-child(2) .content .buttons {
    animation: contentOut 0.5s ease-in 1 forwards !important;
}

@keyframes contentOut {
    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

/* Headteacher image positioning */
.headteacher-img {
    object-position: center 24% !important;
}

/* Counter Animation Styles */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.counter-item {
    transition: all 0.8s ease-out;
}

.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.animate-icon {
    transition: all 0.3s ease;
}

.animate-icon:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Testimonial Card Hover Effects */
.testimonial-card {
    cursor: pointer;
    transition: all 0.4s ease !important;
}

.testimonial-card:hover {
    background-color: #1e2a4a !important;
}

.testimonial-card p {
    transition: color 0.3s ease;
}

.testimonial-card:hover p {
    color: #ffffff !important;
}

/* Initial circle (avatar) hover effect */
.testimonial-card .flex.items-center.gap-4>div:first-child {
    transition: all 0.3s ease;
}

.testimonial-card:hover .flex.items-center.gap-4>div:first-child {
    background-color: #ffffff !important;
    color: #1e2a4a !important;
}

/* Quote icon hover effect */
.testimonial-card>div:first-child {
    transition: opacity 0.3s ease;
}

.testimonial-card:hover>div:first-child {
    opacity: 0.4 !important;
    color: #ffffff !important;
}

/* Director Section Animations */
.director-image,
.director-text {
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.director-image.opacity-100,
.director-text.opacity-100 {
    opacity: 1 !important;
}

.director-image.translate-x-0 {
    transform: translateX(0) !important;
}

.director-text.translate-x-0 {
    transform: translateX(0) !important;
}

/* Director Image Hover Effect */
.director-image {
    cursor: pointer;
    overflow: hidden;
}

.director-image img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.director-image:hover img {
    transform: scale(1.1) rotate(2deg);
    filter: brightness(1.1);
}

.director-image .absolute {
    transition: all 0.4s ease;
}

.director-image:hover .absolute {
    background: linear-gradient(to top, rgba(30, 42, 74, 0.95), transparent);
}

/* Why Choose Section Animations */
.why-choose-text,
.why-choose-image {
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.why-choose-text.opacity-100,
.why-choose-image.opacity-100 {
    opacity: 1 !important;
}

.why-choose-text.translate-x-0 {
    transform: translateX(0) !important;
}

.why-choose-image.translate-x-0 {
    transform: translateX(0) !important;
}

/* Why Choose Image Hover Effect */
.why-choose-image {
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.why-choose-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 42, 74, 0.3), rgba(217, 54, 51, 0.3));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.why-choose-image:hover::before {
    opacity: 1;
}

.why-choose-image img {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.why-choose-image:hover img {
    transform: scale(1.15) rotate(-2deg);
}

/* Why Items Staggered Animation */
.why-item {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.why-item.opacity-100 {
    opacity: 1 !important;
}

.why-item.translate-x-0 {
    transform: translateX(0) !important;
}

/* Visit Us Section Animations */
.visit-header {
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.visit-card {
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.visit-card.opacity-100 {
    opacity: 1 !important;
}

.visit-card.translate-x-0 {
    transform: translateX(0) !important;
}

.visit-map {
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.visit-map.opacity-100 {
    opacity: 1 !important;
}

.visit-map.translate-x-0 {
    transform: translateX(0) !important;
}

/* Visit Card Icon Animation */
.visit-icon {
    transition: all 0.4s ease;
}

.visit-card:hover .visit-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Visit Map Hover Effect */
.visit-map {
    position: relative;
}

.visit-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-radius: 0.75rem;
    transition: border-color 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.visit-map:hover::before {
    border-color: #1e2a4a;
}

/* Footer Animations */
.footer-col {
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-col.opacity-100 {
    opacity: 1 !important;
}

.footer-col.translate-y-0 {
    transform: translateY(0) !important;
}

.footer-contact-item {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-contact-item.opacity-100 {
    opacity: 1 !important;
}

.footer-contact-item.translate-x-0 {
    transform: translateX(0) !important;
}

.footer-bottom {
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-bottom.opacity-100 {
    opacity: 1 !important;
}

.footer-bottom.translate-y-0 {
    transform: translateY(0) !important;
}

/* Footer Logo Animation */
.footer-logo {
    transition: transform 0.4s ease;
}

.footer-col:hover .footer-logo {
    transform: scale(1.1) rotate(5deg);
}

/* Footer Link Hover Effect */
.footer-link {
    position: relative;
    transition: all 0.3s ease;
}

.footer-link::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: #d93633;
    transition: width 0.3s ease;
}

.footer-link:hover::before {
    width: 100%;
}

.footer-link:hover {
    transform: translateX(5px);
}

/* About Hero Entrance Animations */
@keyframes heroFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(35px) scale(0.97);
        filter: blur(6px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes heroPatternPulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.35;
        transform: scale(1.04);
    }
}

.animate-hero-title {
    animation: heroFadeInUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-hero-sub {
    opacity: 0;
    animation: heroFadeInUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.animate-hero-pattern {
    animation: heroPatternPulse 9s ease-in-out infinite;
}

/* History Section Page Load Animation */
@keyframes historyTextFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.animate-history-title {
    opacity: 0;
    animation: historyTextFade 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.animate-history-body {
    opacity: 0;
    animation: historyTextFade 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

/* Our Foundation Entrance Animations */
@keyframes foundationFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(35px);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.animate-foundation-header {
    opacity: 0;
    animation: foundationFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.animate-foundation-card-1 {
    opacity: 0;
    animation: foundationFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

.animate-foundation-card-2 {
    opacity: 0;
    animation: foundationFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.animate-foundation-card-3 {
    opacity: 0;
    animation: foundationFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

/* Global Scroll Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-on-scroll-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-zoom {
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-zoom.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Navbar page-load animation */
@keyframes navDropIn {
    0% {
        opacity: 0;
        transform: translateY(-110%);
    }

    70% {
        opacity: 1;
        transform: translateY(3px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navLogoIn {
    0% {
        opacity: 0;
        transform: scale(0.72) rotate(-8deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes navItemIn {
    0% {
        opacity: 0;
        transform: translateY(-14px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-load {
    animation: navDropIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav-load-logo {
    animation: navLogoIn 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) 0.22s both;
}

.nav-load-item {
    animation: navItemIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav-load-item:nth-child(1) {
    animation-delay: 0.32s;
}

.nav-load-item:nth-child(2) {
    animation-delay: 0.4s;
}

.nav-load-item:nth-child(3) {
    animation-delay: 0.48s;
}

.nav-load-item:nth-child(4) {
    animation-delay: 0.56s;
}

.nav-load-item:nth-child(5) {
    animation-delay: 0.64s;
}

.nav-load-item:nth-child(6) {
    animation-delay: 0.72s;
}

/* Footer scroll reveal */
.footer-scroll .footer-scroll-col {
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-scroll.is-visible .footer-scroll-col {
    opacity: 1;
    transform: translateY(0);
}

.footer-scroll.is-visible .footer-scroll-col:nth-child(1) {
    transition-delay: 0.05s;
}

.footer-scroll.is-visible .footer-scroll-col:nth-child(2) {
    transition-delay: 0.18s;
}

.footer-scroll.is-visible .footer-scroll-col:nth-child(3) {
    transition-delay: 0.31s;
}

.footer-scroll.is-visible .footer-scroll-col:nth-child(4) {
    transition-delay: 0.44s;
}

.footer-scroll .footer-contact-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-scroll.is-visible .footer-contact-item {
    opacity: 1;
    transform: translateX(0);
}

.footer-scroll.is-visible .footer-contact-item:nth-child(1) {
    transition-delay: 0.45s;
}

.footer-scroll.is-visible .footer-contact-item:nth-child(2) {
    transition-delay: 0.55s;
}

.footer-scroll.is-visible .footer-contact-item:nth-child(3) {
    transition-delay: 0.65s;
}

.footer-scroll .footer-bottom {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s;
}

.footer-scroll.is-visible .footer-bottom {
    opacity: 1;
    transform: translateY(0);
}

.footer-scroll .footer-scroll-logo {
    transform: scale(0.88);
    transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s;
}

.footer-scroll.is-visible .footer-scroll-logo {
    transform: scale(1);
}

/* Curriculum Overview Section Cards - Hover & Touch Effects */
.curriculum-overview-card {
    position: relative;
    background-color: #f9f9f9;
    border: 1px solid transparent;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.curriculum-overview-card .card-accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
}

.curriculum-overview-card .card-icon {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover, Active, and Touch-Active states for Desktop & Mobile */
.curriculum-overview-card:hover,
.curriculum-overview-card:active,
.curriculum-overview-card.is-touch-active {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    transform: translateY(-6px) !important;
}

.curriculum-overview-card:hover .card-accent-bar,
.curriculum-overview-card:active .card-accent-bar,
.curriculum-overview-card.is-touch-active .card-accent-bar {
    opacity: 0 !important;
    transform: scaleY(0.7);
}

.curriculum-overview-card:hover .card-icon,
.curriculum-overview-card:active .card-icon,
.curriculum-overview-card.is-touch-active .card-icon {
    transform: scale(1.12) rotate(6deg) !important;
    box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.18) !important;
}

.curriculum-overview-card.card-rotate-alt:hover .card-icon,
.curriculum-overview-card.card-rotate-alt:active .card-icon,
.curriculum-overview-card.card-rotate-alt.is-touch-active .card-icon {
    transform: scale(1.12) rotate(-6deg) !important;
}

/* Core Curriculum Cards - Hover & Touch Effects */
.core-curriculum-card {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.core-curriculum-card .core-icon-box {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.core-curriculum-card:hover,
.core-curriculum-card:active,
.core-curriculum-card.is-touch-active {
    background-color: #1e2a4a !important;
    border-color: #1e2a4a !important;
    box-shadow: 0 20px 25px -5px rgba(30, 42, 74, 0.28), 0 10px 10px -5px rgba(30, 42, 74, 0.18) !important;
    transform: translateY(-6px) !important;
}

.core-curriculum-card:hover h3,
.core-curriculum-card:active h3,
.core-curriculum-card.is-touch-active h3 {
    color: #ffffff !important;
}

.core-curriculum-card:hover p,
.core-curriculum-card:active p,
.core-curriculum-card.is-touch-active p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.core-curriculum-card:hover .core-icon-box,
.core-curriculum-card:active .core-icon-box,
.core-curriculum-card.is-touch-active .core-icon-box {
    background-color: #ffffff !important;
    color: #1e2a4a !important;
    transform: scale(1.12) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

.core-curriculum-card:hover .core-icon-box span,
.core-curriculum-card:active .core-icon-box span,
.core-curriculum-card.is-touch-active .core-icon-box span {
    color: #1e2a4a !important;
}

/* Other Subjects Cards - Hover & Touch Effects */
.other-subject-card {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.other-subject-card .subject-top-bar {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.other-subject-card .subject-icon-box {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.other-subject-card:hover,
.other-subject-card:active,
.other-subject-card.is-touch-active {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    transform: translateY(-8px) !important;
}

.other-subject-card:hover .subject-top-bar,
.other-subject-card:active .subject-top-bar,
.other-subject-card.is-touch-active .subject-top-bar {
    transform: scaleX(1) !important;
}

.other-subject-card:hover .subject-icon-box,
.other-subject-card:active .subject-icon-box,
.other-subject-card.is-touch-active .subject-icon-box {
    transform: scale(1.15) rotate(6deg) !important;
    box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.2) !important;
}

.other-subject-card.card-rotate-alt:hover .subject-icon-box,
.other-subject-card.card-rotate-alt:active .subject-icon-box,
.other-subject-card.card-rotate-alt.is-touch-active .subject-icon-box {
    transform: scale(1.15) rotate(-6deg) !important;
}

/* How to Join Us Step Cards (About) - Hover & Touch Effects */
.join-step-card {
    /* Keeps the scroll-reveal fade at its usual pace while making hover snappy */
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.join-step-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background-color: #d93633;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    transform: scaleX(0);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.join-step-card .join-step-number,
.join-step-card .join-step-icon {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.join-step-card h3 {
    transition: color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.join-step-card:hover,
.join-step-card:active,
.join-step-card.is-touch-active {
    border-color: rgba(217, 54, 51, 0.35) !important;
    box-shadow: 0 20px 25px -5px rgba(30, 42, 74, 0.12), 0 10px 10px -5px rgba(30, 42, 74, 0.06) !important;
    transform: translateY(-8px) !important;
}

.join-step-card:hover::after,
.join-step-card:active::after,
.join-step-card.is-touch-active::after {
    transform: scaleX(1);
}

.join-step-card:hover .join-step-number,
.join-step-card:active .join-step-number,
.join-step-card.is-touch-active .join-step-number {
    background-color: #1e2a4a !important;
    transform: scale(1.12);
}

.join-step-card:hover .join-step-icon,
.join-step-card:active .join-step-icon,
.join-step-card.is-touch-active .join-step-icon {
    background-color: #d93633 !important;
    transform: scale(1.12) rotate(6deg);
    box-shadow: 0 12px 20px -4px rgba(217, 54, 51, 0.35);
}

.join-step-card:hover h3,
.join-step-card:active h3,
.join-step-card.is-touch-active h3 {
    color: #d93633 !important;
}

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

    .join-step-card,
    .join-step-card::after,
    .join-step-card .join-step-number,
    .join-step-card .join-step-icon {
        transition: none !important;
    }

    .join-step-card:hover,
    .join-step-card:active,
    .join-step-card.is-touch-active,
    .join-step-card:hover .join-step-number,
    .join-step-card:hover .join-step-icon,
    .join-step-card.is-touch-active .join-step-number,
    .join-step-card.is-touch-active .join-step-icon {
        transform: none !important;
    }
}

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

    .nav-load,
    .nav-load-logo,
    .nav-load-item,
    .footer-scroll .footer-scroll-col,
    .footer-scroll .footer-contact-item,
    .footer-scroll .footer-bottom,
    .footer-scroll .footer-scroll-logo {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Form Validation Error Styles */
.form-error {
    color: #ba1a1a !important;
    font-size: 12px !important;
    line-height: 16px !important;
    margin-top: 4px !important;
    display: block !important;
    font-weight: 500 !important;
}

input.is-invalid, select.is-invalid, textarea.is-invalid {
    border-color: #ba1a1a !important;
}

/* SweetAlert2 - Application Success Dialog */
.swal-app-popup {
    border-radius: 20px !important;
    padding: 2rem 1.75rem 1.75rem !important;
    font-family: 'Montserrat', sans-serif !important;
}

.swal-app-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1e2a4a !important;
    margin-top: 0.5rem !important;
}

.swal-app-html {
    margin-top: 0.75rem !important;
}

.swal-app-subtitle {
    font-size: 14px;
    line-height: 20px;
    color: #45464e;
    margin: 0 0 16px;
}

.swal-app-details {
    background: #f9f9f9;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 6px 16px;
    text-align: left;
    margin-bottom: 14px;
}

.swal-app-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #ececf0;
    font-size: 13px;
}

.swal-app-row:last-child {
    border-bottom: none;
}

.swal-app-label {
    color: #7a7b85;
    font-weight: 500;
    white-space: nowrap;
}

.swal-app-ref {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #1e2a4a;
    background: #e9ecf5;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 0.03em;
}

.swal-app-value {
    font-weight: 600;
    color: #1e2a4a;
    text-align: right;
}

.swal-app-status {
    background: #fdeceb;
    color: #d93633;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
}

.swal-app-note {
    font-size: 12px;
    color: #9a9aa2;
    margin: 0;
}

.swal-app-confirm-btn {
    background-color: #1e2a4a !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 12px 36px !important;
    border-radius: 999px !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease !important;
}

.swal-app-confirm-btn:hover {
    background-color: #d93633 !important;
}

.swal-app-confirm-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(30, 42, 74, 0.25) !important;
}

/* SweetAlert2 - Newsletter Dialogs */
.swal-newsletter-popup {
    border-radius: 20px !important;
    padding: 2rem 1.75rem 1.75rem !important;
    font-family: 'Montserrat', sans-serif !important;
    box-shadow: 0 20px 40px -15px rgba(30, 42, 74, 0.25) !important;
}

.swal-newsletter-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1e2a4a !important;
    margin-top: 0.5rem !important;
}

.swal-newsletter-html {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    line-height: 22px !important;
    color: #45464e !important;
    margin-top: 0.75rem !important;
}

.swal-newsletter-confirm-btn {
    background-color: #1e2a4a !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 12px 36px !important;
    border-radius: 999px !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.15s ease !important;
}

.swal-newsletter-confirm-btn:hover {
    background-color: #d93633 !important;
    transform: translateY(-1px);
}

.swal-newsletter-confirm-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(30, 42, 74, 0.25) !important;
}

.swal-newsletter-error-btn {
    background-color: #d93633 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 12px 36px !important;
    border-radius: 999px !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.15s ease !important;
}

.swal-newsletter-error-btn:hover {
    background-color: #b52a27 !important;
    transform: translateY(-1px);
}

.swal-newsletter-error-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(217, 54, 51, 0.25) !important;
}

/* News & Events article body (article.html) - formats HTML from the admin rich-text editor */
.article-content {
    color: #2C2C2C;
    font-size: 17px;
    line-height: 30px;
    overflow-wrap: break-word;
}

.article-content > * + * {
    margin-top: 1.1em;
}

.article-content h2,
.article-content h3 {
    color: #1e2a4a;
    font-weight: 600;
    margin-top: 1.6em;
}

.article-content h2 {
    font-size: 26px;
    line-height: 34px;
}

.article-content h3 {
    font-size: 21px;
    line-height: 30px;
}

.article-content a {
    color: #d93633;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5em;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li + li {
    margin-top: 0.4em;
}

.article-content li::marker {
    color: #d93633;
}

.article-content blockquote {
    border-left: 4px solid #d93633;
    background: #f9f9f9;
    padding: 14px 20px;
    border-radius: 0 10px 10px 0;
    color: #1e2a4a;
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.article-content strong {
    color: #1e2a4a;
}

/* ==========================================================
   Homepage News & Events - single scaling row
   Cards share the row width equally and shrink as posts are added.
   Below a readable minimum width the row scrolls sideways instead.
   ========================================================== */
.news-row-wrap {
    position: relative;
}

.news-row {
    display: flex;
    gap: var(--news-gap, 24px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px; /* matches the side padding so the first card snaps flush (no phantom scroll) */
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* room for the hover lift and shadow, which overflow would otherwise clip */
    padding: 12px 4px 20px;
    margin: -12px -4px -20px;
}

.news-row::-webkit-scrollbar {
    display: none;
}

.news-row > .news-card {
    flex: 1 1 0;
    min-width: var(--news-min, 160px);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    transform: none;
}

.news-row > .news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 30px -12px rgba(30, 42, 74, 0.25);
}

/* Phones: one card and a peek of the next, swipe for more */
@media (max-width: 639px) {
    .news-row > .news-card {
        min-width: 78%;
    }
}

.news-card-media {
    display: block;
    height: 192px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px;
}

.news-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.news-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    line-height: 20px;
    color: #45464e;
    white-space: nowrap;
}

.news-card-title {
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    color: #1e2a4a;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 16px;
    line-height: 24px;
    color: #45464e;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-more {
    margin-top: auto;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #1e2a4a;
    transition: color 0.2s ease;
}

.news-card-more:hover {
    color: #d93633;
}

/* Medium cards (about 5-6 per row on a laptop) */
@container (max-width: 250px) {
    .news-card-media { height: 150px; }
    .news-card-body { padding: 16px; }
    .news-card-top { margin-bottom: 10px; }
    .news-card-date { font-size: 12px; }
    .news-card-title { font-size: 17px; line-height: 24px; }
    .news-card-excerpt { font-size: 14px; line-height: 21px; -webkit-line-clamp: 2; margin-bottom: 12px; }
    .news-card-more { font-size: 13px; }
}

/* Compact cards (7+ per row): stack the badge and date, keep the essentials */
@container (max-width: 200px) {
    .news-card-media { height: 120px; }
    .news-card-body { padding: 14px; }
    .news-card-top { flex-direction: column; align-items: flex-start; gap: 6px; }
    .news-card-title { font-size: 15px; line-height: 21px; }
    .news-card-excerpt { font-size: 13px; line-height: 19px; }
}

/* Scroll arrows - only shown when the row has more cards than fit */
.news-row-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1e2a4a;
    border: 1px solid #e2e2e2;
    box-shadow: 0 6px 18px rgba(30, 42, 74, 0.18);
    transform: translateY(-50%);
    transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.news-row-arrow:hover {
    background: #d93633;
    border-color: #d93633;
    color: #ffffff;
}

.news-row-arrow[hidden] {
    display: none;
}

.news-row-arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

.news-row-arrow.is-prev { left: -22px; }
.news-row-arrow.is-next { right: -22px; }

@media (max-width: 639px) {
    .news-row-arrow { display: none; }
}
