/* Styles pour la galerie d'articles */
.article-gallery {
    width: calc(100% + 8rem); /* Déborde de 4rem de chaque côté */
    height: 150px;
    overflow: visible;
    scrollbar-width: none;
    margin: 4rem 0 -1rem -4rem; /* Marge négative pour compenser */
    position: relative;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.article-gallery.active {
    cursor: grabbing;
}

.article-gallery::-webkit-scrollbar {
    display: none; /* Cache scrollbar Chrome */
}


.widget-random-image  img {
    margin: 0;
}



.gallery-container {
    height: 100%;
    display: flex;
    gap: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gallery-container img {
    height: 100%;
    width: 100%;  
    object-fit: cover;
    flex: 1;
    min-width: 200px; 
    cursor: pointer;
    transition: opacity 0.3s;
    border-radius: 0; 
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-image-wrapper {
   transform: translateY(-2rem);
}


/* Style spécial pour une seule photo */
.gallery-container.single-photo img {
    max-width: 50%;
    margin: 0 auto;
}

/* Modal */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 9999; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-image {
    max-height: 90vh;
    max-width: 90vw;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    border-radius: 8px; 
}

/* Boutons de navigation */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: opacity 0.3s;
    opacity: 0.6;
}

.modal-nav:hover {
    opacity: 1;
}

.modal-nav::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-style: solid;
    border-color: #828282;
    border-width: 0 2px 2px 0;
    top: 50%;
    left: 50%;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-prev::before {
    transform: translate(-25%, -50%) rotate(135deg);
}

.modal-next::before {
    transform: translate(-75%, -50%) rotate(-45deg);
}

/* Bouton fermer */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #333;
    top: 50%;
    left: 50%;
}

.modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
