@font-face {
    font-family: "Nohemi";
    /* Note le ../fonts car le fichier CSS est dans assets/css/ */
    src: url("../fonts/Nohemi-VF.ttf") format("truetype-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

html { height: 100%; }
body {
    margin: 0;
    font-family: "Nohemi", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    background-color: #0a0a0a;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.principal-projets {
    flex-grow: 1;
    padding: 80px 20px;
}
.section-grille-projets {
    max-width: 1200px;
    margin: 40px auto;
}
.section-grille-projets h1 {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
}

/* --- FILTRES --- */
.filtres-container { 
    background: #1a1a1a; 
    padding: 20px; 
    border-radius: 8px; 
    margin-bottom: 50px; 
    color: white; 
    border: 1px solid #333;
}

.contenu-filtres {
    display: grid;
    /* Colonnes auto-ajustables */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: start;
}

.element-filtre {
    display: flex;
    flex-direction: column;
}

.element-filtre label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 500; 
    color: #ccc; 
    font-size: 0.9em;
    min-height: 20px; 
}

.element-filtre select {
    width: 100%;
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 6px;
    font-family: "Nohemi", Arial, sans-serif;
    font-size: 0.95em;
    box-sizing: border-box; 
}

.element-filtre select:focus {
    outline: none;
    border-color: #bb86fc;
}

.hint {
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}

.btn-filtrer { display: none; }

.lien-reset-container {
    text-align: right; 
    margin-top: 15px;
}

.lien-reinitialiser {
    color: #888;
    font-size: 0.9em;
    text-decoration: underline;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.lien-reinitialiser:hover { color: #eee; }
.hidden { display: none !important; }


/* --- GRILLE & CARTES --- */
.grille-projets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    transition: opacity 0.3s ease;
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.carte-projet {
    background-color: #1c1c1c;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    border: 1px solid #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: block;
    animation: fadeIn 0.4s ease forwards;
}
.carte-projet:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.carte-projet img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.carte-projet:hover img {
    transform: scale(1.05);
}
.titre-carte {
    padding: 20px;
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
    background-color: #1c1c1c;
    position: relative;
    z-index: 1;
}

/* --- BADGES ET INFOS --- */

/* 1. HAUT GAUCHE : Tags Personnalisés */
.superposition-tags {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}

.tag-badge {
    background-color: #bb86fc; /* Violet */
    color: #121212;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 2. BAS GAUCHE : Compétences (texte sombre) */
.competences-preview {
    position: absolute; 
    bottom: 60px; 
    left: 15px; 
    max-width: 60%; /* Pour laisser place à l'année */
    font-size: 0.8em; 
    background: rgba(0, 0, 0, 0.7); 
    padding: 4px 8px; 
    border-radius: 4px; 
    color: #ddd;
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. BAS DROITE : Année BUT */
.annee-badge {
    position: absolute;
    bottom: 60px;
    right: 15px;
    background-color: #bb86fc;
    color: #121212;
    font-size: 0.8em;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.aucun-projet {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2em;
    color: #888;
    padding: 50px 0;
}

@media (max-width: 768px) {
    .contenu-filtres {
        gap: 15px;
    }
}