/* --- CONTAINER GLOBAL --- */
.wpp-video-grid-container {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
}

/* --- GRILLE FLEXBOX --- */
.wpp-video-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* Espace entre les vidéos */
}

/* --- ITEM (LA VIGNETTE) --- */
.wpp-grid-item {
    position: relative;
    width: 90px;  /* Taille fixe pour des carrés réguliers */
    height: 90px;
    border-radius: 12px; /* Bords bien arrondis */
    overflow: hidden; /* Important pour que l'image ne dépasse pas de l'arrondi */
    cursor: pointer;
    background: #e5e5e5;
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0; /* Empêche l'écrasement */
}

/* Effet au survol de la boite */
.wpp-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* --- INTERIEUR --- */
.wpp-inner {
    width: 100%; height: 100%;
    position: relative;
    display: flex; justify-content: center; align-items: center;
}

/* Images et Vidéos en mode COVER */
.wpp-img, .wpp-preview-video {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    margin: 0; /* Reset thème */
}

/* Vidéo cachée par défaut */
.wpp-preview-video { opacity: 0; z-index: 5; transition: opacity 0.3s; background:#000; }
.wpp-grid-item:hover .wpp-preview-video { opacity: 1; }

/* --- BOUTON PLAY (Adapté à la taille 90px) --- */
.wpp-play-overlay {
    position: absolute; inset: 0; z-index: 10;
    display: flex; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.1);
    pointer-events: none;
}
.wpp-grid-item:hover .wpp-play-overlay { opacity: 0; }

.wpp-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
}
.wpp-icon svg { width: 14px; height: 14px; fill: #333; margin-left: 2px; }

/* --- TITRE (Optionnel, petit en bas) --- */
.wpp-title {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: #fff;
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    text-align: center; padding: 12px 2px 2px 2px;
    z-index: 20; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- MODAL (Lightbox Responsive) --- */
.wpp-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 999999; display: none;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(5px);
    padding: 20px; box-sizing: border-box;
}
.wpp-modal.active { display: flex; }
.wpp-modal-content {
    position: relative;
    width: auto; height: auto;
    max-width: 100%; max-height: 100%;
    display: flex; flex-direction: column;
}
.wpp-close {
    position: absolute; top: -45px; right: 0;
    color: #fff; font-size: 30px; cursor: pointer; border: none; background: none;
    padding: 10px;
}
.wpp-full-video {
    display: block; width: auto; height: auto;
    max-width: 100%; max-height: 85vh;
    object-fit: contain;
    border-radius: 8px; box-shadow: 0 5px 30px rgba(0,0,0,0.5); background:#000;
}