.projects-gallery-wrapper {
    width: 100%;
    /* max-width: 160rem; */
    overflow: hidden;
    position: relative;
}

.projects-gallery-row {
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.projects-gallery-track {
    display: flex;
    flex-shrink: 0;
    will-change: transform;
    border: 1rem solid #D9D9D9;
}

.projects-gallery-item {
    position: relative;
    flex-shrink: 0;
    width: 400px;
    height: 300px;
    overflow: hidden;
    display: block;
    z-index: 1;
    line-height: 0;
    margin: 0;
    padding: 0;
}

.projects-gallery-item:hover {
    z-index: 10;
}

/* Quand on survole une carte, flouter toutes les autres images */
.projects-gallery-track:hover .projects-gallery-item:not(:hover) img {
    filter: blur(4px);
    transition: filter 0.3s ease;
}

/* S'assurer que l'image survolée reste nette */
.projects-gallery-track:hover .projects-gallery-item:hover img {
    filter: blur(0);
}

.projects-gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
    vertical-align: bottom;
}

.projects-gallery-item:hover img {
    transform: scale(1.25);
    transform-origin: center center;
    filter: brightness(1.1);
}

.projects-gallery-row {
    cursor: grab;
}

.projects-gallery-row.is-dragging {
    cursor: grabbing;
}

@media (max-width: 768px) {
    .projects-gallery-item {
        width: 200px;
        height: 200px;
    }
    
    .projects-gallery-item.is-expanded {
        width: 350px;
        height: 200px;
    }
    
    .projects-gallery-item:hover {
        width: 350px;
        height: 200px;
    }
    
    .projects-gallery-item img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .projects-gallery-item {
        width: 150px;
        height: 150px;
    }
    
    .projects-gallery-item.is-expanded {
        width: 250px;
        height: 150px;
    }
    
    .projects-gallery-item:hover {
        width: 250px;
        height: 150px;
    }
    
    .projects-gallery-item img {
        height: 150px;
    }
}

/* Overlay pour titre et catégorie */
.projects-gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0) 100%);
    padding: 20px 15px 15px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-sizing: border-box;
}

.projects-gallery-item:hover .projects-gallery-overlay {
    opacity: 1;
    transform: translateZ(0);
    will-change: opacity;
}

.projects-gallery-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.projects-gallery-category {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Responsive pour l'overlay */
@media (max-width: 768px) {
    .projects-gallery-overlay {
        padding: 15px 12px 12px;
    }
    
    .projects-gallery-title {
        font-size: 14px;
    }
    
    .projects-gallery-category {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .projects-gallery-overlay {
        padding: 12px 10px 10px;
    }
    
    .projects-gallery-title {
        font-size: 12px;
        margin: 0 0 3px 0;
    }
    
    .projects-gallery-category {
        font-size: 11px;
    }
}
