/* =============================================================
   style_mes_realisations.css — page liste /projets
   Thème sombre cohérent avec la page d'accueil.
   ============================================================= */

/* Body + main : on hérite de style.css / style_app.css.
   On override juste le background pour la page projets. */
body { background: #0c0c0c; color: #f5f5f5; }

.layout-main { background: #0c0c0c; min-height: 100dvh; }

/* ========= CONTAINER ========= */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container > header {
    text-align: center;
    margin-bottom: 35px;
}
.container > header h1 {
    font-size: 2.5rem;
    margin: 0 0 10px;
    background: linear-gradient(90deg, #8e2de2, #4a00e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}
.container > header .lead {
    color: #aaa;
    font-size: 1.05rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ========= TOGGLE FILTRES ========= */
.filter-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}
.toggle-filter-btn {
    padding: 10px 18px;
    background: #4f52ba;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 82, 186, 0.3);
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.toggle-filter-btn:hover {
    background: #3a3db5;
    transform: translateY(-1px);
}
.arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ========= FORMULAIRE FILTRES (dark) ========= */
.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    background: #111;
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
    border: 1px solid #222;
    margin-bottom: 40px;
    max-height: 600px;
    overflow: hidden;
    transition: all 0.4s ease;
}
.filter-form.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-width: 0;
    opacity: 0;
    pointer-events: none;
}
.filter-form select {
    padding: 11px 14px;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    background: #181818;
    color: #f5f5f5;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaa'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
}
.filter-form select:hover { border-color: #4f52ba; }
.filter-form select:focus {
    outline: none;
    border-color: #8e2de2;
    box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.2);
}
.filter-form button[type="submit"] {
    padding: 11px 18px;
    background: linear-gradient(90deg, #8e2de2, #4a00e0);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
}
.filter-form button[type="submit"]:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.filter-form .btn-reset {
    padding: 11px 18px;
    background: transparent;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.filter-form .btn-reset:hover {
    background: #1a1a1a;
    border-color: #4f52ba;
    color: #fff;
}

.empty {
    text-align: center;
    color: #888;
    padding: 4rem 1rem;
    font-style: italic;
}

/* ========= GRILLE DE CARTES (3 col desktop, 2 tablette, 1 mobile) ========= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}
@media (max-width: 1024px) {
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 640px) {
    .cards-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (hover: hover) and (pointer: fine) {
    .cards-grid:has(.trace-card:hover) > .trace-card:not(:hover) {
        opacity: 0.5;
        filter: grayscale(20%) brightness(0.75);
        transition: opacity 0.3s, filter 0.3s;
    }
}

/* ========= CARTE PROJET ========= */
.trace-card {
    background: #1a1a1a;
    border: 1px solid #232323;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #f5f5f5;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.trace-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 32px rgba(0, 0, 0, 0.6);
    border-color: #4f52ba;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #0c0c0c;
}
.card-image img,
.card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.trace-card:hover .card-image img,
.trace-card:hover .card-image video { transform: scale(1.05); }

/* Badge type (en haut à gauche de l'image) */
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #4f52ba;
    color: #fff;
    padding: 5px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

/* Body de la carte */
.card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.card-body h3 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.card-body .dot { color: #8e2de2; }
.card-body .excerpt,
.card-body p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
}

/* ========= MINI-TAGS SUR LES CARTES ========= */
.card-tags {
    display: flex;
    /* nowrap + overflow:hidden : la ligne de tags reste sur une seule ligne.
       Les noms longs sont tronqués avec ellipsis, ceux qui ne rentrent pas
       sortent du cadre. Le pill "+N" reste toujours visible (flex-shrink: 0). */
    flex-wrap: nowrap;
    gap: 5px;
    margin-top: auto;
    padding-top: 8px;
    overflow: hidden;
    align-items: center;
}
.mini-tag {
    font-size: 0.65rem;
    padding: 4px 9px;
    border-radius: 6px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    /* Nom complet toujours visible — le JS fitTagsToOneLine cache entièrement
       les tags qui ne rentrent pas (pas de troncature ellipsis). */
    flex-shrink: 0;
}
.mini-tag.pole {
    background: #311b92;
    border: 1px solid #4f52ba;
    color: #ddd;
}
.mini-tag.competence {
    background: #4f52ba;
}
.mini-tag.outil {
    background: #2a2a2a;
    color: #ddd;
    border: 1px solid #3a3a3a;
}
.mini-tag.more {
    background: transparent;
    color: #888;
    border: 1px solid #333;
    /* Le compteur "+N" reste toujours visible, jamais tronqué */
    flex-shrink: 0;
}

/* ========= RESPONSIVE ========= */
@media screen and (max-width: 768px) {
    .container { padding: 20px 12px; }
    .container > header h1 { font-size: 1.8rem; }
    .filter-form { grid-template-columns: 1fr 1fr; padding: 16px; }
    .cards-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media screen and (max-width: 480px) {
    .filter-form { grid-template-columns: 1fr; }
}
