/* ===== FILTRES ===== */

.projects-filters {
    margin-bottom: 40px;
}

.filters-row {
    display: flex;
    gap: 48px;
    padding: 16px 0 0;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-chevron{
    transition: transform 0.3s ease;
    width: 13px;
    display: flex;
}

.filter-chevron.rotated {
    transform: rotate(180deg);
}

.filter-chevron path{
    fill: var(--lf-filter-input-color);
}

.filter-dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
}

.filter-dropdown.open {
    max-height: 400px;
    opacity: 1;
}

.filter-option {
    padding: 2px 0;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    transition: color 0.2s ease;
}

.filter-option:hover {
    color: #000;
}

.filter-option:first-child {
    padding-top: 12px;
}

.filter-option:hover,
.filter-option.active {
    color: #000;
}

.filter-selected {
    margin-top: 10px;
    color: rgba(0, 0, 0, 0.5);
}

/* ===== GRILLE PROJECTS ===== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: auto;
    grid-auto-flow: dense;
    gap: 40px;
}

.project-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.project-card img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1);
    transition: filter 0.3s ease;
}

.project-card:hover img{
    filter: brightness(0.6);
}

.project-card-m {
    grid-column: span 2;
    grid-row: span 2;
}

.project-card-l {
    grid-column: span 3;
    grid-row: span 3;
}


/* ===== OVERLAY AU SURVOL ===== */

.project-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.project-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.project-card:hover .project-card-overlay {
    opacity: 1;
}

.project-card-title {
    filter: brightness(0.9);
    text-transform: uppercase;
}



/* ===== RESPONSIVE MOBILE ===== */

@media (max-width: 768px){

    /* Grille simple : 2 colonnes, toutes les cartes carrées et de même taille */
    .projects-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* On neutralise les tailles spéciales : chaque carte occupe 1 case */
    .project-card-m,
    .project-card-l{
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Overlay texte toujours visible sur mobile */
    .project-card-overlay{
        opacity: 1;
        padding: 15px;
    }

    .project-card-title {
        filter: brightness(1);
    }

    /* Jamais d'assombrissement de l'image sur mobile (neutralise le :hover,
       qui peut rester "collé" après un tap sur tactile) */
    .project-card img,
    .project-card:hover img{
        filter: none;
    }

    .projects-filters {
        margin-bottom: 19px;
    }

    .filters-row {
        padding: 10px 0 0;
    }

    .filter-toggle{
        gap: 6px;
        text-align: start;
    }

    .filter-selected{
        margin-top: 0;
    }

    .filter-chevron {
        width: 11px;
    }

    .filter-option {
        padding: 1px 0;
    }

    .filter-option:first-child {
        padding-top: 9px;
    }

}
