/* ═══════════════════════════════════
   AO - Galerie + (Mobile)
   Affiche uniquement sur mobile < 768px
   Masqué sur desktop et tablette
═══════════════════════════════════ */

/* Masqué par défaut sur desktop/tablette */
.agm-wrap {
    display: none;
    width: 100%;
    position: relative;
}

/* ══════════════════════
   MOBILE < 768px — visible
   Grande photo pleine largeur en haut
   4 vignettes en 2×2 dessous
══════════════════════ */
@media (max-width: 767px) {
    .agm-wrap {
        display: block !important;
    }

    .agm-inner {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto !important;
        gap: 3px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .agm-inner .agm-cell:nth-child(1) {
        grid-column: 1 / 3 !important;
        grid-row: auto !important;
        height: 55vw !important;
    }

    .agm-inner .agm-cell:nth-child(2),
    .agm-inner .agm-cell:nth-child(3),
    .agm-inner .agm-cell:nth-child(4),
    .agm-inner .agm-cell:nth-child(5) {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 28vw !important;
    }
}

/* ══════════════════════
   CELLULE
══════════════════════ */
.agm-cell {
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.agm-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 50% 50% !important;
    display: block !important;
    max-width: none !important;
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
}

.agm-placeholder {
    position: absolute;
    inset: 0;
    background: #d0d4cc;
}

/* ══════════════════════
   EFFETS SURVOL
══════════════════════ */
.agm-cell.effect-zoom { cursor: zoom-in; }
.agm-cell.effect-zoom:hover .agm-img { transform: scale(1.06); }

.agm-overlay {
    position: absolute; inset: 0;
    background: var(--oc, rgba(101,136,78,0.55));
    opacity: 0; transition: opacity 0.35s ease;
    pointer-events: none; z-index: 1;
}
.agm-cell.effect-overlay { cursor: pointer; }
.agm-cell.effect-overlay:hover .agm-overlay { opacity: 1; }
.agm-cell.effect-overlay:hover .agm-slide-leg { transform: translateY(0) !important; }

.agm-slide-leg {
    position: absolute; left: 0; right: 0;
    padding: 8px 12px; background: rgba(17,20,16,0.82);
    pointer-events: none; z-index: 2;
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
}
.agm-leg-bottom { bottom: 0; transform: translateY(100%); }
.agm-leg-top    { top: 0;    transform: translateY(-100%); }
.agm-leg-center { top: 50%;  transform: translateY(calc(-50% + 16px)); text-align: center; }
.agm-cell.effect-slide { cursor: pointer; }
.agm-cell.effect-slide:hover .agm-leg-bottom { transform: translateY(0); }
.agm-cell.effect-slide:hover .agm-leg-top    { transform: translateY(0); }
.agm-cell.effect-slide:hover .agm-leg-center { transform: translateY(-50%); }

.agm-legende-txt { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; display: block; }

.agm-lb-icon {
    position: absolute; top: 8px; right: 8px;
    width: 26px; height: 26px; background: rgba(10,14,8,0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s ease; color: #fff; z-index: 3;
}
.agm-cell.has-lb { cursor: zoom-in; }
.agm-cell:hover .agm-lb-icon { opacity: 1; }

/* ══════════════════════
   LIGHTBOX
══════════════════════ */
.agm-lb { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.28s ease; }
.agm-lb.agm-open { opacity: 1; pointer-events: all; }
.agm-lb-img-wrap { max-width: 92vw; max-height: 90vh; display: flex; align-items: center; justify-content: center; }
.agm-lb-img { max-width: 92vw; max-height: 84vh; object-fit: contain; display: block; width: auto; height: auto; }
.agm-lb.anim-fade-scale .agm-lb-img { transform: scale(0.88); transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94); }
.agm-lb.anim-fade-scale.agm-open .agm-lb-img { transform: scale(1); }
.agm-lb.anim-slide-up .agm-lb-img-wrap { transform: translateY(44px); transition: transform 0.38s cubic-bezier(0.25,0.46,0.45,0.94); }
.agm-lb.anim-slide-up.agm-open .agm-lb-img-wrap { transform: translateY(0); }
.agm-lb.anim-zoom-origin .agm-lb-img { transition: transform 0.42s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.3s ease; }
.agm-lb-leg { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); white-space: nowrap; }
.agm-lb-close { position: absolute; top: 16px; right: 20px; background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.65); padding: 8px; transition: color 0.2s; z-index: 2; }
.agm-lb-close:hover { color: #fff; }
.agm-lb-prev, .agm-lb-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); cursor: pointer; color: rgba(255,255,255,0.7); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; z-index: 2; }
.agm-lb-prev { left: 16px; }
.agm-lb-next { right: 16px; }
.agm-lb-prev:hover, .agm-lb-next:hover { background: rgba(255,255,255,0.18); color: #fff; }
.agm-lb-prev.agm-hide, .agm-lb-next.agm-hide { display: none; }
