/* EDUSHARK TRAINING: scroll reveal and micro-interactions for the pages that
   carry no figures: about, certification, the courses index, team training,
   ebooks, the four curriculum pages and the blog index.

   Pure CSS, no script. Everything on the page is fully visible with no motion
   by default. The reveal only runs where the browser supports scroll-driven
   animation AND the visitor has not asked for reduced motion; outside those
   two guards nothing here changes opacity. Only opacity, translate and
   transform are animated, so nothing reflows and layout never shifts.

   Two keyframes, one per lift mechanism. Cards whose hover lift is written
   with `transform` (the page-scoped .cat-, .bk- and .cu- cards) are revealed
   through `translate`, and cards whose hover lift is written with `translate`
   (the shared card rule in modern.css) are revealed through `transform`. A
   filled animation on a property would otherwise pin that property and the
   hover would stop working.

   This file is deliberately not loaded on the lesson pages that render from
   var DAYS. Their bodies are untouched. */

@keyframes esk-soft-translate {
    from {
        opacity: 0;
        translate: 0 12px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

@keyframes esk-soft-transform {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        /* Lift written with transform on the page, so reveal via translate. */
        .about-section,
        .cat-finder,
        .cat-card,
        .cat-note,
        .cat-team,
        .ct-lead,
        .ct-format,
        .bk-group-head,
        .bk-card,
        .bk-next,
        .bk-team,
        .cu-start,
        .cu-phase-head,
        .cu-card,
        .cu-foot,
        .blogs-filter {
            animation: esk-soft-translate linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 50%;
        }

        /* Lift written with translate in modern.css, so reveal via transform. */
        .value-item,
        .benefit-item {
            animation: esk-soft-transform linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 50%;
        }

        /* A light stagger inside uniform grids, by sibling order. */
        .cat-card:nth-child(2n),
        .value-item:nth-child(2n),
        .benefit-item:nth-child(2n),
        .ct-format:nth-child(2n),
        .cu-card:nth-child(3n + 2) {
            animation-range: entry 6% entry 56%;
        }

        .cu-card:nth-child(3n) {
            animation-range: entry 12% entry 62%;
        }
    }

    /* Hover lift for the cards that had none. The value cards already carry
       the shared transition from modern.css; the format cards get their own. */
    .ct-format {
        transition: translate 0.25s var(--ease-out, ease), box-shadow 0.25s ease,
            border-color 0.25s ease;
    }

    .value-item:hover,
    .ct-format:hover {
        translate: 0 -6px;
        box-shadow: var(--shadow-hover);
    }

    .ct-format:hover {
        border-color: #bfdcd6;
    }

    /* Underline that grows from the left on inline text links. currentColor,
       so it reads in both themes without a colour of its own. */
    .about-section p a,
    .cat-note a,
    .bk-group-head a,
    .bk-next a:not(.btn),
    .read-more {
        text-decoration: none;
        background-image: linear-gradient(currentColor, currentColor);
        background-repeat: no-repeat;
        background-size: 0% 1.5px;
        background-position: 0 100%;
        padding-bottom: 1px;
        transition: background-size 0.3s var(--ease-out, ease);
    }

    .about-section p a:hover,
    .about-section p a:focus-visible,
    .cat-note a:hover,
    .cat-note a:focus-visible,
    .bk-group-head a:hover,
    .bk-group-head a:focus-visible,
    .bk-next a:not(.btn):hover,
    .bk-next a:not(.btn):focus-visible,
    .read-more:hover,
    .read-more:focus-visible {
        text-decoration: none;
        background-size: 100% 1.5px;
    }
}
