/* Grille masonry */
.ba-phototheque-grid {
    column-gap: 0;
}

.ba-phototheque-grid.ba-columns-1 {
    column-count: 1;
}

.ba-phototheque-grid.ba-columns-2 {
    column-count: 2;
}

.ba-phototheque-grid.ba-columns-3 {
    column-count: 3;
	margin-bottom:-155px;
}

.ba-phototheque-grid.ba-columns-4 {
    column-count: 4;
}

/* Responsive : 2 colonnes sur tablette, 1 sur mobile */
@media (max-width: 1024px) {
    .ba-phototheque-grid.ba-columns-3,
    .ba-phototheque-grid.ba-columns-4 {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .ba-phototheque-grid {
        column-count: 1 !important;
    }
}

/* Chaque élément doit éviter de se casser entre les colonnes */
.ba-photo-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    margin: 0;
    padding: 0;
}

/* Images bord à bord */
.ba-photo-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin: 0;
    border: 0;
}


/* Lightbox */
.ba-phototheque-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.ba-phototheque-lightbox.is-open {
    display: flex;
}

.ba-phototheque-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.ba-phototheque-inner img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
}

.ba-phototheque-lightbox .ba-close,
.ba-phototheque-lightbox .ba-prev,
.ba-phototheque-lightbox .ba-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ba-phototheque-lightbox .ba-close {
    top: -40px;
    right: 0;
    transform: none;
    font-size: 2.5rem;
}

.ba-phototheque-lightbox .ba-prev {
    left: -60px;
}

.ba-phototheque-lightbox .ba-next {
    right: -60px;
}

.ba-phototheque-lightbox .ba-caption {
    margin-top: 1rem;
    color: #fff;
    font-size: 0.9rem;
}

body.ba-phototheque-open {
    overflow: hidden;
}

/* --- HOVER OVERLAY + ZOOM ---- */

.ba-photo-item {
    position: relative;
    overflow: hidden;
}

/* Le lien prend toute la zone et reste cliquable */
.ba-photo-item a {
    display: block;
    position: relative;
}

/* Image + zoom */
.ba-photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.ba-photo-item:hover img {
    transform: scale(1.2);
}

/* Overlay noir semi-transparent */
.ba-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none; /* ne bloque pas le clic */
}

/* Texte centré */
.ba-hover-text {
    padding: 15px;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 22px;
    color: #fff;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hover: overlay + texte visibles */
.ba-photo-item:hover .ba-hover-overlay {
    background: rgba(0, 0, 0, 0.5);
	margin:15px;
}

.ba-photo-item:hover .ba-hover-text {
    opacity: 1;
}

