/*
 * M.A.K. Galerie — défilement éditorial de l'accueil.
 *
 * The homepage hero/façade has its own existing animation, untouched here.
 * Match the artist-dossier language: slow opacity + 18px vertical entrance,
 * not blur, scale or parallax. Cards keep the physical-scale masonry intact.
 *
 * PROGRESSIVE ENHANCEMENT: no JS / IntersectionObserver / reduced motion =
 * fully visible content. A page-ready class is installed only AFTER priming
 * elements already within the viewport, avoiding a blank first paint.
 */

/* Opt-in ONLY when the browser has an active observer. */
.mak-home-page.mak-home-reveal-ready [data-mak-home-reveal] {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition:
        opacity 900ms cubic-bezier(.22, .61, .36, 1),
        transform 1030ms cubic-bezier(.22, .61, .36, 1);
}
.mak-home-page.mak-home-reveal-ready [data-mak-home-reveal].is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Gentle, consistent offset across works on the SAME generated masonry row.
 * The Masonry JS moves original article elements without replacing them. */
.mak-home-page.mak-home-reveal-ready .mak-index__row > .mak-index__card:nth-child(2) {
    transition-delay: 90ms;
}
.mak-home-page.mak-home-reveal-ready .mak-index__row > .mak-index__card:nth-child(3) {
    transition-delay: 170ms;
}

/* Let the document read in a natural order: image, caption, committee.
 * No transition is applied to the artwork image's inner fit or gallery
 * button hover; only the surrounding editorial element is translated. */
.mak-home-page.mak-home-reveal-ready .mak-home-utrillo__caption {
    transition-delay: 95ms;
}
.mak-home-page.mak-home-reveal-ready .mak-home-utrillo__committee-logo {
    transition-delay: 115ms;
}

/* Keyboard focus must never be visually hidden even if the visitor tabs
 * ahead of the observer's scroll threshold. */
.mak-home-page.mak-home-reveal-ready [data-mak-home-reveal]:focus-within {
    opacity: 1;
    transform: none;
}

/* Smaller travel distance on phones; no width-dependent layout changes. */
@media (max-width: 760px) {
    .mak-home-page.mak-home-reveal-ready [data-mak-home-reveal] {
        transform: translate3d(0, 12px, 0);
    }
    .mak-home-page.mak-home-reveal-ready [data-mak-home-reveal].is-visible,
    .mak-home-page.mak-home-reveal-ready [data-mak-home-reveal]:focus-within {
        transform: translate3d(0, 0, 0);
    }
}

/* The user's system preference also wins if it changes mid-session. */
@media (prefers-reduced-motion: reduce), print {
    .mak-home-page [data-mak-home-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
