/* === Global === */
body {
    margin: 0;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: #f6e1cf;
    top: 0;
    left: 0;
    z-index: -1;
}

main {
    margin-top: 10vh; /* décale contenu sous header */
}

/* === Section Projets === */
#projets {
    padding: 60px 20px;
    text-align: center;
}

/* Titre section */
.titre-section {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-top: -30px;
    margin-bottom: 60px;
    font-weight: 700;
    font-family: Montserrat, sans-serif;
}

/* Grille projets */
.grille-projets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px 30px; /* réduit pour mobile/tablette */
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

/* Carte projet */
.carte-projet {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: rgba(50, 50, 50, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 30px 20px 20px 20px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: riseFade 0.8s ease forwards;
    color: #f0f0f0;
}

.carte-projet:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18);
}

.carte-projet .image-projet img {
    transition: transform 0.5s ease;
}

.carte-projet:hover .image-projet img {
    transform: scale(1.03);
}

/* Image projet */
.image-projet {
    position: relative;
    width: 100%;
    aspect-ratio: 1.4 / 1;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background-color: #ddd;
    cursor: pointer;
}

/* Overlay "Voir plus" */
.image-projet .over {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0);
    border-radius: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.carte-projet:hover .over,
.image-projet:hover .over {
    background-color: rgba(0,0,0,0.25);
    opacity: 1;
    pointer-events: auto;
}

.image-projet .over a {
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    background-color: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.image-projet .over a:hover {
    background-color: rgba(0,0,0,0.8);
}

.image-projet img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 25px;
    display: block;
}

/* Titre et description */
.carte-projet h3,
.carte-projet p {
    text-align: left;
    margin-left: 5px;
}

.carte-projet h3 {
    margin-top: 15px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #222;
    font-weight: bold;
    font-family: Montserrat, sans-serif;
}

.carte-projet p {
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    color: #555;
    margin: 8px 0 0;
    margin-left: 4px;
    font-family: Poppins, sans-serif;
}

/* Animation */
@keyframes riseFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filtres projets */
#filtres {
    display: flex;
    gap: 10px;
    margin: 0 auto 50px;
    justify-content: center;
    flex-wrap: wrap;
}

#filtres button {
    padding: 8px 16px;
    border: 2px solid #333;
    border-radius: 25px;
    background-color: transparent;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: Poppins, sans-serif;
}

#filtres button:hover {
    background-color: #333;
    color: #fff;
    transform: scale(1.05);
}

#filtres button.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* Back link */
.back-link {
    position: relative;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    padding: 6px 12px;
    z-index: 1200;
}

/* Plus text */
#pluss {
    font-size: 14px;
    color: black;
}

/* === Media Queries === */

/* Tablette */
@media (max-width: 1024px) {
    .grille-projets {
        gap: 40px 20px;
    }
}

/* Smartphones */
@media (max-width: 768px) {
    .grille-projets {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 10px;
    }

    .titre-section {
        margin-bottom: 40px;
    }

    #filtres {
        gap: 8px;
        margin-bottom: 40px;
    }
}
