/* Galerie photos */
.et-db #page-container #et-boc .et_pb_section:has(.gp-galerie){
    padding-top: 0;
}
.gp-galerie { 
    width: 100%; 
}

/* Filtres */
.gp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}
.gp-toolbar .gp-filters { 
    margin-bottom: 0; 
    width: 100%;
    justify-content: center;
}

.gp-edition-wrap { 
    display: inline-flex; 
    align-items: center; 
    width: 100%;
    justify-content: center;
}
.gp-edition-select {
    border-radius: 25px;
    background: #091B5D;
    color: #fff !important;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
    transition: opacity 0.2s ease;
    padding: 9px 27px;
    font-size: 0.75rem;
    line-height: 1em;
    font-weight: 700;
}
.gp-edition-select:hover { opacity: 0.92; }
.gp-edition-select:focus-visible {
    outline-offset: 2px;
}
.gp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.56rem;
    margin-bottom: 24px;
}
.gp-filter {
    background: #F6F6F6;
    border: none;
    border-radius: 25px;
    padding: 9px 27px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1em;
    color: #091B5D;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.gp-filter.is-active {
    background: #091B5D;
    color: #fff;
    border: none;
}
.gp-filter:focus-visible {
    outline-offset: 2px;
}

.gp-filter.is-disabled,
.gp-filter:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.gp-filter.is-disabled:hover,
.gp-filter:disabled:hover {
    background: #F6F6F6;
    color: #091B5D;
}
.gp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 3.3rem;
}
.gp-card {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: #f4f4f4;
    cursor: pointer;
    contain: layout paint;
    height: 343px;
}
.gp-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gp-card:hover .gp-card-img,
.gp-card:focus-visible .gp-card-img { 
    transform: scale(1.04); 
}
.gp-card:focus-visible {
    outline: 2px solid #1a2a4a;
    outline-offset: 2px;
}

.gp-empty {
    text-align: center;
    padding: 48px 16px;
    color: #777;
}

/* ======================================================
 * Infinite scroll
 * Sentinelle invisible placée après la grille. Quand elle entre
 * dans le viewport (avec rootMargin de 400px), elle déclenche
 * loadMore() côté JS via IntersectionObserver.
 * Contient un spinner qui s'affiche pendant le chargement.
 * ====================================================== */
.gp-infinite-sentinel {
    width: 100%;
    min-height: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    pointer-events: none;
}
.gp-infinite-spinner {
    display: none;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(9, 27, 93, 0.2);
    border-top-color: #091B5D;
    border-radius: 50%;
    animation: gp-spin 0.7s linear infinite;
}
.gp-galerie.is-loading .gp-infinite-spinner {
    display: block;
    margin: 32px 0;
}

/* ======================================================
 * Bouton "Voir plus" : conservé comme fallback accessible
 * au clavier et aux lecteurs d'écran, mais masqué visuellement
 * via la technique standard "visually-hidden" (clip).
 *
 * - L'infinite scroll est le mode normal d'interaction.
 * - Un utilisateur en navigation clavier pure (pas de souris/touch)
 *   peut Tab jusqu'au bouton qui devient alors visible.
 *
 * Pour supprimer complètement le bouton (perte du fallback a11y),
 * remplacer ce bloc par : .gp-load-more-wrap { display: none !important; }
 * ====================================================== */
.gp-load-more-wrap {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.gp-load-more-wrap:focus-within {
    position: static;
    width: auto;
    height: auto;
    margin: 32px 0 0 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    display: flex;
    justify-content: center;
}
.gp-load-more {
    position: relative;
    background: #1a2a4a;
    color: #fff;
    border: 0;
    border-radius: 25px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.gp-load-more:hover { 
    opacity: 0.9; 
}
.gp-load-more:disabled { 
    cursor: wait; opacity: 0.7; 
}
.gp-load-more-spinner {
    display: none;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gp-spin 0.7s linear infinite;
    vertical-align: middle;
}
.gp-load-more.is-loading .gp-load-more-spinner { 
    display: inline-block; 
}
@keyframes gp-spin { 
    to { 
        transform: rotate(360deg); 
    } 
}

html.gp-lb-open { 
    overflow: hidden; 
}
.gp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.gp-lightbox[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
}
.gp-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}
.gp-lb-figure {
    position: relative;
    margin: 0;
    max-width: 92vw;
    max-height: 92vh;
    z-index: 1;
}
.gp-lb-img {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
}
.gp-lb-counter {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}
.gp-lb-close, .gp-lb-prev, .gp-lb-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
    border: 0;
    color: #fff;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s ease;
}
.gp-lb-close:hover, .gp-lb-prev:hover, .gp-lb-next:hover {
    background: rgba(0, 0, 0, 0.7);
}
.gp-lb-close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}
.gp-lb-prev, .gp-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
}
.gp-lb-prev { 
    left: 16px; 
}
.gp-lb-next { 
    right: 16px; 
}

.gp-filters-edition {
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .gp-grid { 
        grid-template-columns: repeat(2, 1fr); gap: 8px; 
    }
    .gp-lb-prev, 
    .gp-lb-next { 
        width: 40px; height: 40px; 
    }
}
@media(max-width: 550px){
    .gp-toolbar .gp-filters { 
        display: grid;
        grid-template-columns: 1fr;
    }
}
@media (max-width: 425px) {
    .gp-grid { 
        grid-template-columns: 1fr; 
        gap: 8px; 
    }
}