/* Galerie de vignettes des pièces jointes (images) */
.ispag-gallery { margin: 6px 0 18px; }

.ispag-gallery__toggle,
.ispag-gallery__more {
    background: none;
    border: 0;
    padding: 4px 0;
    cursor: pointer;
    font-weight: 600;
    color: inherit;
}
.ispag-gallery__more { color: #0073aa; margin-top: 8px; }
.ispag-gallery__caret { display: inline-block; transition: transform .2s; margin-right: 4px; }
.ispag-gallery__toggle[aria-expanded="false"] .ispag-gallery__caret { transform: rotate(-90deg); }
.ispag-gallery.is-collapsed .ispag-gallery__grid,
.ispag-gallery.is-collapsed .ispag-gallery__more { display: none; }

.ispag-gallery__grid {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}
.ispag-gallery:not(.is-expanded) .ispag-gallery__item.is-extra { display: none; }

.ispag-gallery__item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
    list-style: none;
}
.ispag-gallery__link { display: block; width: 100%; height: 100%; }
.ispag-gallery__link img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ispag-gallery__item:hover img { transform: scale(1.05); }
.ispag-gallery__caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 14px 6px 4px;
    font-size: 11px; color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transition: opacity .15s;
}
.ispag-gallery__item:hover .ispag-gallery__caption { opacity: 1; }
.ispag-gallery__remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; padding: 0 !important; line-height: 20px;
    text-align: center; background: rgba(255,255,255,.9);
    opacity: 0; transition: opacity .15s;
}
.ispag-gallery__item:hover .ispag-gallery__remove,
.ispag-gallery__item:focus-within .ispag-gallery__remove { opacity: 1; }
@media (hover: none) { .ispag-gallery__remove, .ispag-gallery__caption { opacity: 1; } }

/* Lightbox */
.ispag-lightbox {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(0,0,0,.88);
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.ispag-lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; }
.ispag-lightbox__bar { color: #fff; margin-top: 10px; font-size: 14px; text-align: center; }
.ispag-lightbox__bar a { color: #fff; margin-left: 12px; text-decoration: underline; }
.ispag-lightbox__btn {
    position: absolute; background: none; border: 0; color: #fff;
    font-size: 40px; cursor: pointer; padding: 10px 16px; line-height: 1;
}
.ispag-lightbox__close { top: 6px; right: 10px; }
.ispag-lightbox__prev { left: 6px; top: 50%; transform: translateY(-50%); }
.ispag-lightbox__next { right: 6px; top: 50%; transform: translateY(-50%); }
