.gal-container {
    column-count: 3;          /* nombre de colonnes par défaut */
    column-gap: 20px;         /* espace horizontal entre colonnes */
    width: 100%;
}

.gal-container .gal-image {
    position: relative;
    break-inside: avoid;      /* évite que les images se coupent */
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gal-container .gal-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gal-container .gal-image .caption {
    font-size: 0.7rem;
    color: #ffffffc5;
    font-style: italic;
    margin: 0;

    position: absolute;
    bottom: 5px;
    right: 10px;
}

/* Effet hover */
.gal-container .gal-image:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Responsive */
@media (max-width: 1000px) {
    .gal-container {
        column-count: 2;
    }
}
@media (max-width: 768px) {
    .gal-container {
        column-count: 1;
    }
}


/* GRID LAYOUT */

.gal-container-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 colonnes égales */
  gap: 40px;
}

.gal-image-grid img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
}

.gal-image-grid p {
  margin-top: 8px;
  color: var(--content-light);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 800px) {
    .gal-container-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}


/* POPUP */
.img-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.img-popup-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.gallery-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    z-index: 990;

    scroll-snap-type: x mandatory;
    overflow: scroll;
}

.gallery-popup-overlay .gal-img-container {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: start;
    text-align: center;
}

.gallery-popup-overlay img {
    width: 70%;
    max-height: 80vh;
    object-fit: contain;
}

.popup-btn {
    position: fixed;
    z-index: 999;

    font-size: 4em;
    padding: 10px;

    cursor: pointer;
    transition: 0.3s;
}
.popup-btn:hover svg {
    width: 35px;
}

.popup-btn.previous {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}
.popup-btn.next {
    right: 0;
    top: 50%;
    transform: rotate(180deg) translateY(50%);
}

.popup-btn svg {
    width: 30px;
    height: auto;
    display: block;
    transition: 0.2s ease;
}

.popup-btn path {
    color: #fffc;
}

.gal-img-container .download-btn-cont {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}
.popup-btn.download {
    display: inline-block;
    font-size: 2.3em;
    transform: translateX(-50%);
    transition: 0.3s;
}
.popup-btn.download:hover {
    font-size: 2.5em;
}