/**
 * Pictos du méga-menu (novembre 2026) : grand format, animation au survol, sans sélecteur animé.
 * Fichier autonome chargé après header.css : aucune modification de header.css n'est nécessaire.
 */

/* Le sélecteur animé (cadre + trait sous le nom) est retiré du méga-menu. */
.pgi-header-mega-menu--single .pgi-header-mega-menu__card-media {
    padding: 0;
}

.pgi-header-mega-menu--single .pgi-header-mega-menu__card-title::after {
    content: none;
}

.pgi-header-mega-menu--single .pgi-header-mega-menu__card:hover .pgi-header-mega-menu__card-title,
.pgi-header-mega-menu--single .pgi-header-mega-menu__card:focus-visible .pgi-header-mega-menu__card-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Pictos: larger, in the picto's own format (768 × 675); the 1.12 zoom trims the picto's built-in margin. */
.pgi-header-mega-menu__card-media {
    max-width: 190px;
    aspect-ratio: 768 / 675;
}

.pgi-header-mega-menu__card-image,
.pgi-header-mega-menu__card-video {
    transform: scale(1.12);
}

/* Animated pictos: the video sits exactly over the static image and only shows while playing.
   Its last frame is identical to the image, so the end of the animation is seamless. */
.pgi-header-mega-menu__card-video {
    position: absolute;
    top: var(--pgi-mega-video-inset, 0px);
    left: var(--pgi-mega-video-inset, 0px);
    width: calc(100% - 2 * var(--pgi-mega-video-inset, 0px));
    height: calc(100% - 2 * var(--pgi-mega-video-inset, 0px));
    object-fit: contain;
    object-position: center center;
    background: var(--pgi-white);
    opacity: 0;
    pointer-events: none;
}

.pgi-header-mega-menu__card-video.is-playing {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .pgi-header-mega-menu__card-video {
        display: none;
    }
}
