/* =====================================================
   Accordion Gallery v2.0.0
   SATURNE innovations — https://saturne.media/
   ===================================================== */

/* ── Empêche tout scroll horizontal parasite ────────── */
:root, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Wrapper ─────────────────────────────────────────── */
.ag-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

.ag-gallery {
    display: flex;
    align-items: stretch;
    padding: 0;
    min-width: min-content;
}

/* ── Card ────────────────────────────────────────────── */
.ag-card {
    position: relative;
    flex-shrink: 0;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transition:
        width     0.45s cubic-bezier(.4,0,.2,1),
        min-width 0.45s cubic-bezier(.4,0,.2,1);
    z-index: 1;
}

/* Arrondis sur les bords extérieurs gauche et droit uniquement */
.ag-card:first-child { border-radius: 10px 0 0 10px; }
.ag-card:last-child  { border-radius: 0 10px 10px 0; margin-right: 0 !important; }

.ag-card.ag-active { z-index: 5; }

/* ── Image ───────────────────────────────────────────── */
.ag-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    transition: transform 0.45s cubic-bezier(.4,0,.2,1);
}

.ag-card.ag-active img { transform: scale(1.04); }

/* ── Dimmer ──────────────────────────────────────────── */
.ag-dimmer {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.ag-card.ag-active .ag-dimmer { opacity: 0; }
.ag-gallery.ag-has-active .ag-card:not(.ag-active) .ag-dimmer { opacity: 1; }

/* ── Overlay dégradé ─────────────────────────────────── */
.ag-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* ── Tab indicator — masqué ──────────────────────────── */
.ag-tab { display: none; }

/* ── Info panel ──────────────────────────────────────── */
.ag-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.1rem 1.1rem 1.3rem;
    color: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity   0.35s 0.08s ease,
        transform 0.35s 0.08s ease;
    pointer-events: none;
    z-index: 11;
}

.ag-card.ag-active .ag-info {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Textes ──────────────────────────────────────────── */
.ag-date {
    font-size: 13px;
    letter-spacing: 0.05em;
    opacity: 0.72;
    margin-bottom: 5px;
    font-weight: 400;
    color: #fff;
}

.ag-title {
    display: block;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
    color: #fff;
    text-decoration: none;
}

.ag-desc {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 14px;
    opacity: 0.82;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ag-btn {
    display: inline-block;
    position: relative;
    z-index: 12;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 20px;
    padding: 6px 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.ag-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.8);
    color: #fff;
}

/* ── Lien cliquable toute la carte ───────────────────── */
.ag-card-link {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: block;
}

.ag-has-link { cursor: pointer; }

/* ── No-image fallback ───────────────────────────────── */
.ag-card:not(:has(img)) { background: #1a1a2e; }

/* ── Full width — géré par JS ────────────────────────── */
.ag-fullwidth-outer { display: block; box-sizing: border-box; }
.ag-fullwidth-outer .ag-wrapper  { width: 100%; overflow: hidden; padding: 0; }
.ag-fullwidth-outer .ag-gallery  { width: 100%; min-width: 0; padding: 0; }
.ag-fullwidth-outer .ag-card     { flex: 1 1 0; min-width: 0; }
.ag-fullwidth-outer .ag-card.ag-active { flex: 0 0 auto; }

/* ── Mobile : layout vertical (≤ 767px) ─────────────── */
@media (max-width: 767px) {

    .et_pb_section:has(.ag-fullwidth-outer),
    .et_pb_row:has(.ag-fullwidth-outer),
    .et_pb_column:has(.ag-fullwidth-outer),
    .et_pb_code:has(.ag-fullwidth-outer) {
        overflow: visible !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .ag-fullwidth-outer {
        position: relative !important;
        left: 0 !important;
        width: 100vw !important;
        margin-left: 0 !important;
        overflow: visible !important;
    }

    .ag-fullwidth-outer .ag-wrapper,
    .ag-wrapper { overflow: visible; padding: 0; width: 100%; }

    .ag-fullwidth-outer .ag-gallery,
    .ag-gallery {
        flex-direction: column;
        height: auto !important;
        min-width: 0;
        gap: 0;
        padding: 0;
        width: 100%;
    }

    .ag-fullwidth-outer .ag-card,
    .ag-card {
        width: 100% !important;
        min-width: 0 !important;
        flex: none;
        height: 320px;
        margin-right: 0 !important;
        border-radius: 0 !important;
        box-shadow: none;
        transition: none;
    }

    .ag-card:first-child,
    .ag-card:last-child { border-radius: 0 !important; }

    .ag-card .ag-dimmer { opacity: 0 !important; }
    .ag-card .ag-info   { opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto; }

    .ag-tab { display: none; }

    .ag-title { font-size: 17px; }
    .ag-date  { font-size: 12px; }
    .ag-desc  { font-size: 13px; -webkit-line-clamp: 2; display: -webkit-box; }
    .ag-btn   { font-size: 12px; padding: 5px 14px; }
}
