.videos-section {
    padding: 2% 1%;
    /* max-width: 1200px; */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: black;
    width: 100%;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    width: 100%;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-card--featured .video-card__media {
    width: 100%;
}

.videos-section .section-title {
    font-size: 2.2rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    color: white;
    position: relative;
    margin-bottom: 1%;
}

.videos-section .section-title::after {
    display: none;
}

.videos-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    padding: 1%;
}

.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.video-card--featured {
    width: 100%;
    grid-column: 1 / -1;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.video-card--featured a {
    text-decoration: none;
}

.video-card__media {
    position: relative;
    /* aspect-ratio: 16/9; */
    background: white;
    overflow: hidden;
    padding: 1%;
    border-radius: 12px 12px 0 0;
}

.video-card__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.video-card__content {
    padding: 0.2rem 1.2rem 0.2rem 1rem;
}

.video-card__tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color, #333);
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.video-card__title {
    font-size: 1.2rem;
    line-height: 1.3em;
    margin: 0.5rem 0;
    color: var(--text-color, #333);
}

.video-card--featured .video-card__title {
    font-size: 1.5rem;
    line-height: 1.2em;
    font-weight: bold;
    margin: 5px 0;
    color: #333;
}

.video-card__excerpt {
    color: var(--text-color-light, #666);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.video-card__date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-color-light, #666);
}

.video-card__link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #01a29a;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.video-card__link:hover {
    background: var(--primary-color-dark, #222);
}

.video-card__link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
}

@media (max-width: 768px) {
    #specvid {
        padding: 0 15px;
    }

    .video-card__title {
        font-size: 1.1rem;
    }

    /* Retrouver le padding titre qui etait sur #specvid (l'ID a saute avec
       la refonte du bloc, on le remplace par la classe). */
    .videos-grid--2-3 .video-card__title {
        padding: 0 15px;
    }

    /* Mobile n'affiche que les 3 premieres videos (2 top + 1 small)
       demande Nathalie : ne pas afficher les 5 comme en desktop. */
    .videos-grid--2-3 .video-card:nth-child(n+4) {
        display: none;
    }

    /* Featured = même style que les autres cards en mobile */
    .video-card--featured .video-card__title {
        font-size: 1.1rem;
        line-height: 1.2;
        font-weight: bold;
        margin: 0.5rem 0;
        color: var(--text-color, #333);
        padding: 0 15px;
    }

    .video-card--featured {
        max-width: none;
        grid-column: auto;
    }

    .video-card--featured .video-card__content {
        padding: 0.2rem 0 0.2rem 0;
    }

    /* Play icon featured = même taille que les autres cards */
    .video-featured-play-icon {
        background: rgba(0, 0, 0, 0.7);
        padding: 1rem;
        width: 80px;
        height: 80px;
    }

    .video-featured-play-icon svg {
        width: 48px;
        height: 48px;
    }

    /* Titre section aligné à gauche */
    .videos-section .section-title {
        font-size: 1.5em;
        margin-bottom: 6%;
        margin-left: 0;
        text-align: left;
        width: 100%;
        padding-left: 5%;
    }

    .videos-section {
        padding: 2rem 1rem;
        margin-bottom: 0;
    }

    .videos-grid {
        gap: 1.5rem;
        padding: 0 5%;
        margin-bottom: 5%;
    }

    .video-card .video-card__excerpt {
        display: none;
    }
}

/* Image van décorative */
.with-background-decor {
    position: relative;
    overflow: hidden;
}

.decor-van {
    position: absolute;
    top: 30%;
    right: 44px;
    width: 510px;
    height: 155px;
    background-image: url(/wp-content/uploads/2025/05/fond-voiture-yogi-vec-05.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: bottom center;
    /* opacity: 0.25; */
    z-index: 0;
    pointer-events: none;
    transform: scaleX(-1);
    /* transform: scaleX(-1); */
    transform: scaleX(-1);
}

.video-card--featured .video-card__media,
.video-card--featured .video-card__content {
    position: relative;
    z-index: 1;
}

/* Soleil */
.decor-sun {
    position: absolute;
    top: 85px;
    left: 40px;
    width: 120px;
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.videos-section {
    position: relative;
}

/* Image par défaut pour les vignettes manquantes */
.video-card__no-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    min-height: 180px;
    color: #555;
}

/* Amélioration de la vidéo en vedette */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .video-card__link {
        padding: 0.45rem 1.3rem;
        margin-top: 5px;
    }

    .video-card__content {
        padding: 0.2rem 0 0.2rem 0;
    }

    .decor-van {
        display: none;
    }

    .decor-sun {
        display: none;
    }
}

.video-featured-wrapper {
    position: relative;
    display: block;
    width: 100%;
    padding-bottom: 66.6875%; /* 1067/1600 = 0.666875 */
    overflow: hidden;
    border-radius: 15px;
}

.video-featured-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-featured-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* ---------------------------- */
@media (min-width:930px) {

    .video-card.video-card--featured,
    .video-card--featured .video-card__media {
        border-color: transparent
    }

    /* ===== Nouveau layout Desktop 'Nos videos' (2 rang 1 + 3 rang 2) =====
       Demande Nathalie 08/07 : uniquement desktop, le mobile garde son
       comportement stack vertical actuel (repeat auto-fit). */
    .videos-grid.videos-grid--2-3 {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .videos-grid--2-3 .video-card--top {
        grid-column: span 3;
    }

    .videos-grid--2-3 .video-card--small {
        grid-column: span 2;
    }

    /* Coherence des titres du rang 1 : meme taille de police que le rang 2
       pour eviter le desequilibre visuel (demande explicite Nathalie). */
    .videos-grid--2-3 .video-card__title {
        font-size: 1.2rem;
        line-height: 1.3em;
        font-weight: bold;
    }
}

/* ---------------------------- */
/* --------------------------------------------------------------------------
   Ratio des vignettes : 3:2 impose.
   Sans cela chaque vignette suit le ratio natif de son image, et une image
   en 16:9 casse l'alignement de la rangee (204 px de haut contre 241 pour
   ses voisines). object-fit: cover recadre au lieu de deformer.
   Demande de Nathalie (recette CCLS du 2026-11-05), appliquee aux deux sites.
   NB : la regle a d'abord ete posee dans css/image-standards.css, avant de
   constater que ce fichier n'est pas charge (enqueue commente dans
   inc/theme-setup.php). Elle vit donc ici, dans la feuille du bloc.
   -------------------------------------------------------------------------- */
.video-card__media img {
    aspect-ratio: 3/2;
    width: 100%;
    height: auto;
    object-fit: cover;
}
