/**
 * Scena Features — ratios vidéo des fiches artistes.
 *
 * Divi/FitVids enveloppe les iframes oEmbed dans un conteneur dont la hauteur
 * est créée par padding-top. L’ancien CSS imposait ensuite une autre hauteur à
 * l’iframe, ce qui laissait une grande zone vide dans le conteneur.
 */

/* Les vidéos classiques gardent le ratio 16:9 prévu par la fiche artiste. */
.sc3-artist .sc3-video-card:not(.sc3-video-card--portrait)
    .sc3-video-frame .fluid-width-video-wrapper {
    padding-top: 56.25% !important;
}

/* Les Shorts et autres vidéos verticales utilisent leur ratio naturel 9:16. */
.sc3-artist .sc3-video-card--portrait
    .sc3-video-frame .fluid-width-video-wrapper {
    padding-top: 177.7778% !important;
}

/* L’iframe remplit toujours le conteneur calculé par FitVids. */
.sc3-artist .sc3-video-frame .fluid-width-video-wrapper iframe,
.sc3-artist .sc3-video-frame .fluid-width-video-wrapper embed,
.sc3-artist .sc3-video-frame .fluid-width-video-wrapper object {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
}

/* Repli lorsque FitVids n’a pas encore enveloppé l’iframe. */
.sc3-artist .sc3-video-frame > iframe,
.sc3-artist .sc3-video-frame > embed,
.sc3-artist .sc3-video-frame > object {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
}

.sc3-artist .sc3-video-card--portrait .sc3-video-frame > iframe,
.sc3-artist .sc3-video-card--portrait .sc3-video-frame > embed,
.sc3-artist .sc3-video-card--portrait .sc3-video-frame > object {
    aspect-ratio: 9 / 16 !important;
}

/*
 * Empêche une vidéo verticale de devenir démesurément haute lorsque la grille
 * passe à deux colonnes ou à une seule colonne.
 */
.sc3-artist .sc3-video-card--portrait {
    width: 100%;
    max-width: 280px;
    justify-self: start;
}

@media (max-width: 640px) {
    .sc3-artist .sc3-video-card--portrait {
        justify-self: center;
    }
}
