.projects-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* gap: 2rem; */
    justify-content: space-between;
    align-items: center;
}

.projects-header-subtitle {
    font-size: var(--font-size-description-subtitle);
    font-weight: var(--font-weight-regular);
}


.projects-header-title {
    font-weight: var(--font-weight-bold);
    margin-bottom: 1rem;
}

@media (max-width: 1186px) {
    .projects-header {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    .projects-header-title,
    .projects-header-subtitle {
        text-align: center;
        }
}

.filter-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 100%;
}

@media (max-width: 632px) {
    .filter-container {
        flex-direction: row;
        align-items: center;
        gap: 3rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-container > * {
        flex: 1 1 calc(50% - 2rem); /* Each item takes 50% width minus the gap */
        max-width: calc(50% - 1rem);
        box-sizing: border-box;
    }
}

/* Style du bouton filter dropdown */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-button {
    display: flex;
    justify-content: space-between; /* Déjà en space-between, ce qui est correct */
    align-items: center;
    width: 100%;
    padding: 1.2rem 1.9rem;
    background-color: white;
    border: 0.0625rem solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: var(--font-size-project-filter);
    font-weight: var(--font-weight-light);
    transition: border-color 0.2s ease;
}

@media (max-width: 632px) {
    .filter-dropdown-button {
        font-weight: var(--font-weight-regular);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

}

.filter-dropdown-button:hover {
    border-color: rgba(0, 0, 0, 0.3);
}

.filter-dropdown-button.active {
    border-color: rgba(0, 0, 0, 0.4);
}

.filter-dropdown-label {
    display: flex;
    align-items: center;
    margin-right: 2rem; /* Ajoute un espace minimum à droite du label */
    color: #333333;
}

.filter-selection-count {
    display: none;
    background-color: #222fe6; /* Changé de #f8b84e à #222fe6 */
    color: #ffffff; /* Changé à blanc pour meilleur contraste avec le bleu */
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0.5rem;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.filter-selection-count.show {
    display: flex;
}

.filter-chevron {
    display: flex;
    justify-content: flex-end;
    margin-left: 1rem;
    transition: transform 0.2s ease;
    color: #000;
}

@media (max-width: 632px) {
    .filter-chevron {
        margin-left: 0rem;
    }
}

@media (max-width: 400px) {
    .filter-dropdown-label {
        margin-right: 0; /* Supprime l'espace minimum à droite du tag */
    }
}

.filter-dropdown-button.active .filter-chevron {
    transform: rotate(180deg);
}

/* Style du menu filter dropdown */
.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.3125rem);
    left: 0;
    width: 100%;
    background-color: white;
    border: 0.0625rem solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    z-index: 20;
}

.filter-dropdown-menu.show {
    max-height: 18.75rem;
    opacity: 1;
    overflow-y: auto;
}

.filter-dropdown-item {
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    font-size: var(--font-size-project-filter-menu);
    color: #000;
}

.filter-dropdown-item:hover {
    background-color: #f5f5f5;
}

.filter-dropdown-item.selected {
    background-color: #f0f0f0;
}

.filter-dropdown-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.filter-dropdown-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.filter-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid rgba(204, 204, 204, 0.8);
    border-radius: 0.1875rem;
    margin-right: 0.625rem;
    position: relative;
}

.filter-checkbox.checked::after {
    content: '';
    position: absolute;
    width: 0.625rem;
    height: 0.625rem;
    background-color: #222fe6; /* Changé de #5964f2 à #222fe6 pour correspondre à la couleur d'accent */
    border-radius: 0.125rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-footer-container {
    position: sticky;
    bottom: 0;
    background-color: white;
    width: 100%;
    border-top: 0.0625rem solid #eee;
}

/* Footer avec boutons */
.filter-dropdown-footer {
    display: flex;
    justify-content: right;
    padding: 0.625rem 1rem;
}

.filter-dropdown-footer button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
}

.filter-dropdown-footer button:hover {
    color: #000;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 31rem); /* Par défaut : 4 cartes par ligne */
    gap: 2rem;
    row-gap: 2.6rem;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    max-width: 100%;
}

.project-grid-researcher {
    display: grid;
    grid-template-columns: repeat(3, 31rem); /* Par défaut : 3 cartes par ligne */
    gap: 2rem;
    row-gap: 2.6rem;
    justify-content: left;
    width: 100%;
    padding: 1rem;
    max-width: 100%;
}

.project-card {
    position: relative;
    width: 31rem;
    height: 38rem;
    border-radius: 1.2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 1px 1px 4px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform-origin: center center;
    cursor: pointer;
    background-color: rgb(255, 255, 255);
}

.project-card:hover {
    box-shadow: 1px 1px 8px 0 rgba(0, 0, 0, 0.3);
    transform: scale(1.005);
}


.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%; /* S'assure que le lien couvre toute la hauteur */
}


@media (max-width: 1350px) {
    .project-grid {
        grid-template-columns: repeat(3, 31rem); 
    }
}

@media (max-width: 1050px) {
    .project-grid {
        grid-template-columns: repeat(2, 31rem); 
    }
    .project-grid-researcher {
        grid-template-columns: repeat(2, 31rem);
        justify-content: left;
    }
}

@media (max-width: 680px) {
    .project-grid {
        grid-template-columns: repeat(1, 31rem);
    }
    .project-grid-researcher {
        grid-template-columns: repeat(1, 31rem);
        justify-content: center;
    }
}

/* Statut en haut à droite */
.status {
    position: absolute;
    top: 1.2rem;
    right: 1.6rem;
    padding: 0.2rem 1rem;
    border-radius: 1rem;
    font-size: var(--font-size-project-status);
    font-weight: var(--font-weight-regular);
    z-index: 10;
}

/* Status of projects*/

.status-incoming  { 
  background-color: #FAF3C0;
  color: #6E5E00;
} 

.status-ongoing  { 
  background-color: #e6f7f3; 
  color: #2E6653;
}
.status-finished  { background-color: #fff6e5; }


/* Container pour l'image */
.image-container {
    height: 11rem;
    width: 100%;
    position: relative;
    flex-shrink: 0; /* Empêche l'image de rétrécir */
}

.image-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
}

.project-image {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-top-left-radius: 1.2rem;
    border-top-right-radius: 1.2rem;
}

/* Container pour les informations de l'université */
.university-container {
    display: flex;
    margin-top: 1.2rem;
    padding: 0 1.9rem;
    align-items: center;
    flex-shrink: 0; /* Empêche le container de rétrécir */
}

.university-logo {
    width: 3.4rem;
    height: 3.4rem;
    margin-right: 1rem;
    overflow: hidden;
}

.university-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.university-info {
    display: flex;
    flex-direction: column;
}

.university-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-project-university);
    width: 20rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.authors {
    font-size: var(--font-size-project-authors);
    font-weight: var(--font-weight-light);
    width: 20rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* Ligne de séparation */
.divider {
    width: 88%;
    height: 0.1rem;
    background-color: #e2e8f0;
    margin: 1.2rem auto 1.2rem auto;
    flex-shrink: 0; /* Empêche la ligne de rétrécir */
}

/* Conteneur pour tout le contenu en dessous du divider */
.content-container {
    display: flex;
    flex-direction: column;
    padding: 0 1.8rem;
    height: 17.8rem;
}

/* Partie supérieure du contenu (titre, description) */
.upper-content {
    flex-grow: 1; /* Prend l'espace disponible */
}

/* Partie inférieure du contenu (location, catégories) */
.bottom-content {
    margin-top: auto; /* Pousse le contenu vers le bas */
}

/* Titre du projet */
.project-title {
  margin: 0;
  font-size: var(--font-size-project-title);
  line-height: 1.2;
  font-weight: var(--font-weight-semibold);

  display: -webkit-box;
  display: box; /* future standard */
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-description {
  margin-top: 0.7rem;
  font-size: var(--font-size-project-description);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Emplacement */
.location {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem; /* Espace entre location et catégories */
}

.location-icon {
    padding-top: 0.6rem;
    margin-right: 0.5rem;
}

.location-text {
    font-size: var(--font-size-project-location);
    font-weight: var(--font-weight-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Catégories */
.categories {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.category {
    font-size: var(--font-size-project-categories);
    font-weight: var(--font-weight-regular);
    padding: 0.1rem 0.8rem;
    border-radius: 1rem;
    
    /* Largeur minimale */
    min-width: 8rem; /* Ajustez cette valeur selon vos besoins */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}