html,
body {
    overflow-x: hidden;
}

/* --------------------------------------------------- */
/* --------------------------------------------------- */
/* ------------- MEDIA MIN-WIDTH 350PX --------------- */
/* ------------------ SUP. OU ÉGALE ------------------ */
/* --------------------------------------------------- */
@media screen and (min-width: 350px) {
    main {
        margin: 330px auto 280px auto;
        width: 90%;
        max-width: 1400px;
    }

    .sr-only {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

    .all_projects {
        margin: 50px auto 250px auto;
        display: flex;
        flex-direction: column;
        max-width: 1200px; 
    }

    .projects {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .projects li a {
        display: flex;
        flex-direction: column;
        text-decoration: none;
    }

    .projects figure {
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .projects figcaption {
        font-size: 2rem;
        font-weight: bold;
    }

    .projects img {
        width: 100%;
        height: auto;
        display: block;
    }

    .custom-select-wrapper {
        margin-bottom: var(--gutter-width);
    }

    /* Survol légende */
    .projects li {
        position: relative;
        padding: 2.5px;
    }

    .projects li figcaption {
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        width: 350px;
        height: 150px;
        min-height: 100px;
        font-weight: bold;
        color: black;
        background: rgba(212, 17, 17, 0.95);
        padding: 0.5rem;
        opacity: 0;
        pointer-events: none;
        z-index: 999;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        transition: opacity 0.3s;
    }

    .projects li:hover figcaption {
        width: 350px;         
        opacity: 1;
        pointer-events: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .title_project {
        font-family: "InclusiveSans-Light";
        font-weight: normal;
        font-style: normal;
        font-size: 1rem;
    }

    small {
        font-family: "InclusiveSans-Light";
        font-style: normal;
        font-weight: normal;
    }

    /* Dropdown */
    .custom-select-wrapper {
        position: relative;
        width: 50%;
        margin-bottom: 10px;
    }

    .selected-option,
    .option {
        font-size: 2.5rem;
    }

    .selected-option {
        padding: 6px 10px;
        border: 1px solid #000000;
        border-radius: 5px;
        cursor: pointer;
        background-color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .filter-icon {
        width: 35px;
        height: auto;
        rotate: 180deg;
        display: inline-block;
    }

    .select-options {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        border: 1px solid #000000;
        border-top: none;
        background: white;
        z-index: 10;
        border-radius: 0 0 5px 5px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .option {
        padding: 6px 10px;
        cursor: pointer;
    }

    .option:hover {
        background: #000000;
        color: white;
    }

    .projects .project-item {
        display: block;
    }

    .dropdown-container {
        position: relative;
        width: 100%;
        user-select: none;
        margin-bottom: 20px;
    }
    
    .options-container {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid #ddd;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 10;
    }
    
    .options-container.open {
        max-height: 400px;
        overflow-y: auto;
    }
}



/* --------------------------------------------------- */
/* --------------------------------------------------- */
/* ------------- MEDIA MIN-WIDTH 768PX --------------- */
/* ------------------ SUP. OU ÉGALE ------------------ */
/* --------------------------------------------------- */
@media screen and (min-width: 768px) {
    main {
        width: 85%;
    }
}



/* --------------------------------------------------- */
/* --------------------------------------------------- */
/* ------------- MEDIA MIN-WIDTH 1000PX --------------- */
/* ------------------ SUP. OU ÉGALE ------------------ */
/* --------------------------------------------------- */
@media screen and (min-width: 1000px) {
    main {
        margin: 230px auto 150px auto;
        width: 80%;
    }

    .all_projects {
        margin: 20px auto 30px auto;
        width: 80%;
    }

    .custom-select-wrapper {
        width: 200px;
    }

    .selected-option,
    .option {
        font-size: var(--text-size-desktop);
    }

    .filter-icon {
        width: 15px;
    }

    .dropdown-container {
        width: 200px;
        margin-bottom: 10px;
    }

    .options-container.open {
        max-height: 200px;
        overflow-y: auto;
    }
}



/* --------------------------------------------------- */
/* --------------------------------------------------- */
/* ------------- MEDIA MIN-WIDTH 1200PX --------------- */
/* ------------------ SUP. OU ÉGALE ------------------ */
/* --------------------------------------------------- */
@media screen and (min-width: 1200px) {
    main {
        margin: 145px auto 100px auto;
        width: 85%;
    }

    .all_projects {
        margin: 20px auto 60px auto;
    }

    .projects {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    /* Survol */
    .projects li {
        position: relative;
    }

    .projects figure {
        margin: 0;
        position: relative;
    }

    .projects li figcaption {
        bottom: -40px;
        left: 0;
        width: 200px;
        height: 100px;
        opacity: 0;
        line-height: 1; 
        font-size: 16px;
    }

    .projects li:hover figcaption {
        width: 200px;  
        height: 100px;       
        opacity: 1;
        pointer-events: auto;
        left: 80%;
        transform: translateX(-50%);
        text-align: center;
    }
}



/* --------------------------------------------------- */
/* --------------------------------------------------- */
/* ------------- MEDIA MIN-WIDTH 1500PX --------------- */
/* ------------------ SUP. OU ÉGALE ------------------ */
/* --------------------------------------------------- */
@media screen and (min-width: 1500px) {
    main {
        width: 90%;
    }
    
    .all_projects {
        margin: 20px auto 60px auto;
        width: 90%;
    }

    /* Survol */
    .projects li figcaption {
        bottom: -50px;
        left: 0;
        width: 200px;
        height: 100px;
    }

    .projects li:hover figcaption {
        width: 200px;  
        height: 100px;       
        left: 90%;
        transform: translateX(-50%);
    }
}