.filters {
    margin: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.filters button {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border: none;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-size: 14px;
}

.filters button:hover {
    background-color: #444;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px;
    gap: 15px;
}

.vignette {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: auto;
    min-height: 350px;
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid #333;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s;
    background-color: #222;
}

.vignette img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.content {
    padding: 12px;
    background-color: #222;
    color: #fff;
}

.content h2 {
    margin: 0 0 8px;
    font-size: 1.2em;
}

.content p {
    margin: 5px 0;
    font-size: 0.9em;
}

.content .link {
    display: inline-block;
    margin-top: 8px;
    color: #007bff;
    text-decoration: none;
}

.vignette .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none; /* Important pour que les clics passent à travers par défaut */
}

.vignette .overlay p {
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9em;
}

.vignette .overlay .link {
    margin-top: 0;
}

/* Sur desktop avec souris, garder l'effet hover */
@media (hover: hover) {
    .vignette:hover {
        transform: scale(1.05);
    }

    .vignette:hover .overlay {
        opacity: 1;
        pointer-events: auto; /* Permettre l'interaction avec l'overlay */
    }
}

/* Pour les appareils tactiles */
@media (hover: none) {
    .vignette {
        cursor: pointer;
    }
    
    .vignette:active {
        transform: scale(1.02);
    }
    
    /* Par défaut, l'overlay est invisible */
    .vignette .overlay {
        opacity: 0;
        background: rgba(0, 0, 0, 0.85);
        pointer-events: none;
    }
    
    /* Quand l'overlay est actif (après un clic) */
    .vignette .overlay.active {
        opacity: 1;
        pointer-events: auto; /* Permettre l'interaction avec l'overlay */
    }
}

#logo {
    margin-right: 10px;
    max-width: 100%;
    height: auto;
}

#outils {
    margin-bottom: 5vh;
}

/* Media queries pour différentes tailles d'écran */
@media screen and (max-width: 768px) {
    .container {
        gap: 10px;
        margin: 5px;
    }
    
    .vignette {
        margin: 5px 0;
        min-height: 320px;
    }
    
    .vignette img {
        height: 150px;
    }
    
    .content {
        padding: 10px;
    }
    
    .content h2 {
        font-size: 1.1em;
    }
}

@media screen and (max-width: 480px) {
    .filters button {
        padding: 8px 15px;
        font-size: 13px;
        margin: 3px;
    }
    
    .vignette {
        max-width: 100%;
    }
    
    #outils {
        margin-bottom: 3vh;
    }
}