/* ==========================================================================
   Actualités-13enweb — Grille Front-end centrée, responsive & Lightbox
   1 à 4 colonnes max sur desktop/tablette, 2 colonnes (2x2) sur mobile
   ========================================================================== */

.actu13-grid {
    --actu-cols-desktop: 4;
    --actu-cols-mobile: 2;
    --actu-gap: 28px;
    --actu-gap-mobile: 14px;
    --actu-img-height: 400px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: var(--actu-gap);
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.actu13-grid *,
.actu13-grid *::before,
.actu13-grid *::after {
    box-sizing: border-box;
}

.actu13-card {
    flex: 0 1 calc((100% - (var(--actu-cols-desktop) - 1) * var(--actu-gap)) / var(--actu-cols-desktop));
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    padding: 20px 18px;
    margin: 0;
}

/* Quand il n'y a qu'une seule actualité, limiter sa largeur pour un rendu harmonieux */
.actu13-grid[data-actu-count="1"] .actu13-card {
    max-width: 620px;
}

.actu13-title {
    width: 100%;
    text-align: center;
    margin: 0 0 14px 0;
}

.actu13-media {
    width: 100%;
    height: var(--actu-img-height);
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 16px 0;
    cursor: pointer;
}

.actu13-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
    box-shadow:
        0 10px 26px rgba(15, 23, 42, 0.14),
        0 3px 8px rgba(15, 23, 42, 0.08);
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.actu13-media:hover .actu13-img {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 16px 34px rgba(15, 23, 42, 0.2),
        0 4px 12px rgba(15, 23, 42, 0.1);
}

.actu13-link-wrap {
    width: 100%;
    text-align: center;
    margin: 0 0 12px 0;
}

.actu13-link {
    font-weight: 700 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    word-break: break-word;
    transition: opacity 0.2s ease;
}

.actu13-link:hover,
.actu13-link:focus {
    opacity: 0.8;
}

.actu13-desc {
    width: 100%;
    text-align: center;
    margin: 0;
}

/* Responsive Tablette : léger ajustement d'espacement tout en gardant 1 à 4 colonnes */
@media (max-width: 1024px) {
    .actu13-grid {
        --actu-gap: 20px;
        --actu-img-height: 380px;
    }
}

/* Responsive Mobile : 2 colonnes (2x2), centrées */
@media (max-width: 767px) {
    .actu13-grid {
        --actu-img-height: 240px;
        gap: var(--actu-gap-mobile);
    }

    .actu13-card {
        flex: 0 1 calc((100% - (var(--actu-cols-mobile) - 1) * var(--actu-gap-mobile)) / var(--actu-cols-mobile));
        padding: 14px 10px;
        border-radius: 12px;
    }

    .actu13-title {
        margin-bottom: 10px;
    }

    .actu13-media {
        margin-bottom: 10px;
    }

    .actu13-link-wrap {
        margin-bottom: 8px;
    }
}

/* ==========================================================================
   Lightbox épurée (identique à Imagator-13enweb)
   ========================================================================== */

.actu13-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 18, 25, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    padding: 28px;
}

.actu13-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.actu13-lightbox-stage {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.actu13-lightbox-img {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.actu13-lightbox.is-open .actu13-lightbox-img.is-ready {
    transform: scale(1);
    opacity: 1;
}

.actu13-lightbox-btn {
    position: fixed;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.10);
    color: #FFFFFF;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0;
    outline: none;
}

.actu13-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.06);
}

.actu13-lightbox-close {
    top: 22px;
    right: 22px;
}

.actu13-lightbox-prev,
.actu13-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.actu13-lightbox-prev:hover,
.actu13-lightbox-next:hover {
    transform: translateY(-50%) scale(1.06);
}

.actu13-lightbox-prev {
    left: 22px;
}

.actu13-lightbox-next {
    right: 22px;
}

.actu13-lightbox-btn.is-hidden {
    display: none;
}

@media (max-width: 640px) {
    .actu13-lightbox {
        padding: 16px;
    }
    .actu13-lightbox-btn {
        width: 40px;
        height: 40px;
    }
    .actu13-lightbox-close {
        top: 14px;
        right: 14px;
    }
    .actu13-lightbox-prev {
        left: 10px;
    }
    .actu13-lightbox-next {
        right: 10px;
    }
}
