.realisation-header--video {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 20 / 9;
}

.realisation-header__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.realisation-header__filter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 37, 56, 0.3);
    z-index: 2;
    pointer-events: none;
}

.realisation-header__overlay {
    position: absolute;
    left: 7%;
    right: 7%;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 3;
    padding: 8% 0;
}

.realisation-header--image {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Use same sizing strategy as video: automatic aspect-ratio-based height */
    aspect-ratio: 16 / 9;
}

.realisation-header__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.realisation-header__categories {
    font-size: 0.9em;
}

a.realisation-category-link {
    /* Style des liens de catégories */
    color: var(--e-global-color-accent);
    font-size: 1.125rem;
    background: var(--e-global-color-text);
    border-radius: 40px;
    padding: 6px 23px 9px;
    transition: background .3s ease, color .3s ease;
    margin-right: 8px;
    font-style: normal;
}

a.realisation-category-link:last-child {
    margin-right: 0;
}

.realisation-category-link:hover {
    color: var(--e-global-color-text);
    background: var(--e-global-color-primary);
}

/* Fallback for browsers without aspect-ratio support: use the padding-top trick */
@supports not (aspect-ratio: 1 / 1) {
    .realisation-header--video::before,
    .realisation-header--image::before {
        content: "";
        display: block;
        padding-top: 56.25%; /* 16:9 fallback */
    }
    /* ensure media stays absolute (already set) */
}

/* === Force video visibility and mobile behaviour ===
   Ces règles aident à surmonter des styles globaux qui pourraient
   masquer les vidéos sur mobile. Elles forcent l'affichage de la
   vidéo et masquent la version image sur petits écrans. */
.realisation-header__video {
    z-index: 1; /* en dessous de l'overlay (z-index:3) et du filter (2) */
    display: block !important;
}

@media screen and (max-width: 768px) {
    .realisation-header__video {
        display: block !important;
    }
    /* Si le thème affiche parfois l'image desktop à côté de la vidéo,
       masquer l'image sur mobile pour éviter doublons. */
    .realisation-header--image {
        display: none !important;
    }

    .realisation-header__categories {
        display: none;
    }

    /* Ajuster l'aspect-ratio sur mobile : le ratio large (20/9) peut
       donner un conteneur trop haut ou mal cadré sur petits écrans.
       Ici on revient à un ratio plus standard et on limite la hauteur. */
    .realisation-header--video,
    .realisation-header--image {
        aspect-ratio: 9 / 9 !important;
        max-height: 66vh;
    }

    /* Fond noir semi-transparent couvrant tout le header sur mobile */
    .realisation-header__filter {
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 2;
        display: block !important;
        pointer-events: none;
    }

    /* Garder l'overlay texte mais sans fond supplémentaire pour éviter
       double superposition — texte reste blanc et lisible */
    .realisation-header__overlay {
        background: transparent;
        padding: 12px 16px;
        border-radius: 8px;
        color: #ffffff;
        bottom: 6vh;
    }

    .realisation-header__overlay * {
        color: inherit;
    }

    /* Fallback padding-top pour les navigateurs sans support aspect-ratio */
    @supports not (aspect-ratio: 1 / 1) {
        .realisation-header--video::before,
        .realisation-header--image::before {
            padding-top: 56.25%; /* 16:9 */
        }
    }


}

        /* Debug badge showing which source is active (mobile / desktop). Remove in production if undesired. */
        .realisation-header--video[data-active-mode]::after {
            content: attr(data-active-mode);
            position: absolute;
            right: 8px;
            top: 8px;
            background: rgba(0, 0, 0, 0.6);
            color: #fff;
            font-size: 12px;
            padding: 4px 8px;
            border-radius: 16px;
            z-index: 10;
            pointer-events: none;
        }
    
        .realisation-header--video[data-active-mode="mobile"]::after {
            background: rgba(2, 136, 209, 0.9);
        }
    
        .realisation-header--video[data-active-mode="desktop"]::after {
            background: rgba(80, 80, 80, 0.85);
        }
    
/* Titres et sous-titres des réalisations */
.realisation-header__title,
.realisation-header__subtitle {
    color: var(--e-global-color-text);
    font-weight: 700;
    margin: 0;
}

.realisation-header__subtitle {
    padding-bottom: 40px;
}

@media screen and (max-width: 768px) {
    .realisation-header__subtitle {
        padding: 20px 0 0 0;
    }
}