/* ===============================
   GRID RESPONSIVE
================================ */
.mgp-grid {
    display: grid;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;

    /* magique  */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Fade-in */
.mgp-grid.loaded {
    opacity: 1;
}

/* ===============================
   ITEM RESPONSIVE (16:9)
================================ */
.mgp-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    display: block;
    width: 100%;

    aspect-ratio: 16 / 9;
    /* 🔥 RESPONSIVE */
    background: #000;
}

@supports not (aspect-ratio: 16 / 9) {
    .mgp-item {
        height: 0;
        padding-bottom: 56.25%;
        /* 16:9 */
    }

    .mgp-item img {
        position: absolute;
        inset: 0;
    }
}


.mgp-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* ZOOM */
.mgp-item:hover img {
    transform: scale(1.08);
}

/* ===============================
   OVERLAY
================================ */
.mgp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mgp-item:hover .mgp-overlay {
    opacity: 1;
}

/* ===============================
   IMAGE LOUPE
================================ */
.mgp-overlay.image::after {
    content: "🔍";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #fff;
}

/* ===============================
   YOUTUBE ICON
================================ */
.mgp-overlay.video {
    background:
        rgba(0, 0, 0, 0.55);
    background-size: 80px;
}

/* ===============================
   YOUTUBE TITLE
================================ */
.mgp-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 13px;
    padding: 6px 8px;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mgp-item.video:hover .mgp-video-title {
    opacity: 1;
}

/* ===============================
   PAGINATION
================================ */
.mgp-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.mgp-pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #6bcd82;
    /* vert */
    border-radius: 50%;
    background: transparent;
    color: #6bcd82;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mgp-pagination a:hover {
    background: #6bcd82;
    color: #fff;
}

.mgp-pagination a.active {
    background: #6bcd82;
    color: #fff;
}

/* ===============================
   PAGINATION FLECHE
================================ */
.mgp-pagination a.mgp-next-pages {
    border: none;
    color: #f9f9f9;
    font-size: 20px;
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
    font-weight: bold;

    /* Ajout d'épaisseur */
    font-weight: 900;
    /* plus gras pour "épaisseur" */
}

/* Inverser la direction de la flèche */
.mgp-pagination a.mgp-next-pages::before {
    content: '←';
    /* flèche vers la gauche */
    display: inline-block;
    transform: scaleX(1.5);
    /* pour augmenter l'épaisseur visuelle */
    font-size: 30px;
}


/* ===============================
   LOADER
================================ */
.mgp-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
    border-radius: 10px;
}


/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {
    .mgp-grid {
        gap: 10px;
    }

    .mgp-video-title {
        font-size: 12px;
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .mgp-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (min-width: 1024px) {
    .mgp-grid {
        grid-template-columns: repeat(var(--cols-desktop, 3), 1fr);
    }
}