nav {
    top: 0;
    transition: top 0.4s ease;
}

nav div.right a {
    color: rgb(161, 157, 157);
    text-decoration: underline;
    
}


button {
    border-radius: 40px;
    padding: 4px;
    background-color: white;
    transition: 0.3s all ease-out;
}

button:hover {
    cursor: pointer;
    background-color: black;
    color: white;
}

i.bx-search-alt-2 {
    font-size: 2rem;
}

/* Tri */
button.pertinence {
    position: relative;
    padding: 0.8rem 1.4rem;

}

div.sorts-display {
    display: none;
    flex-direction: column;
    background-color: #fff;
    padding: 0.8rem 1.4rem;
    gap: 0.6rem;
    box-shadow: 2px 2px 5px black;
    border-radius: 8px;

    position: absolute;
    top: 60%;
    right: 20%;
    transform: translate(60%, 10%);
}

div.sorts-display label {
    cursor: pointer;
}


/* MAIN */
main {
    padding-top: 6rem;
}

/* Div SearchBar */
div.search-bar {
    justify-content: center;
    align-items: center;
    display: flex;
    margin: 2rem 3rem;
}

div.search-bar form {
    display: flex;
    align-items: center;
    justify-content: center;
    
}

div.search-bar input[type='search'] {
    padding: 12px 30px;
    width: 30vw;
    border-radius: 20px;
}

div.input-button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Div SearchBar & Filter */
div.searchBar-filter-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: auto;
    padding: 1rem 0;
}

div.searchBar-filter-sort button.filter {
    padding: 0.8rem 1.2rem ;
    display: flex;
    align-items: center;
}

div.filter-sort {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
div.searchBar-filter-sort button.filter i {
    font-size: 1.2rem;
}

/* Bouton reset */
form button.reset {
    padding: 0.8rem 1rem; 
    margin-left: 1.5rem;
    border-radius: 1.2rem;
}

/* Filtrages */
div.filters-display {
    display: none;

    position: absolute;
    left: 42%;
    top: 33%;
    transform: translate(-40%, -20%);
    background-color: #fff;
    width: 50%;
    min-width: 700px;
    border-radius: 8px;
    box-shadow: 2px 2px 5px black;
    padding: 20px;

    z-index: 998;
}

div.filters-display .active {
    display: block;
}

div.filters-display div.top {
    display: flex;
    justify-content: space-between;
}

div.filters-display div.top button {
    border: 0;
    font-weight: 800;
    font-size: 1.02rem;
}

div.list-tags,
div.list-ingredients {
    display: flex;
    flex-wrap: wrap;
    padding: 16px;
    gap: 0.6rem;
}


div.results-filters-by {
    padding: 0 4.2rem 3rem 4.2rem;
    font-size: 1.6rem;
}

    /* Système de filtrage */
input[type='checkbox'] {
    display: none;
}
input[type='checkbox'] + span {
    background-color: white;
    border: 2px solid black;
    color: black;
    padding: 0.3rem 0.8rem;
    border-radius: 3rem;
    cursor: pointer;
}
input[type='checkbox'] + span:hover {
    background-color: black;
    color: white;
}

input[type='checkbox']:checked + span{
    background-color: black;
    color: white;
}


input[type='submit'] {
    padding: 0.4rem 0.8rem;
    cursor: pointer;
}


/* Liste des recettes (section) */
div.all-recipes {    
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 5rem;
}

div.all-recipes a {
    text-decoration: none;
    transition: filter 0.6s ease-in;
}

div.all-recipes h3 {
    font-size: 3rem;
    margin-bottom: 2rem;
    margin-left: 4rem;
}

p.result-null {
    padding: 0 4.2rem 3rem 4.2rem;
    font-size: 1.6rem;
    text-align: center;
}

section.list-sections a {
    max-width: 350px;
    width: 100%;
}

section.list-sections {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2.6rem;
    margin: 2rem;
}

section.list-sections section {
    color: white;
    border-radius: 0 0 20px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 2px 4px black;
    gap: 0.6rem;
    padding-bottom: 2rem;
    position: relative;
}

section.list-sections section img {
    height: 250px;
    width: 100%;
    border-radius: 0 0 20px 20px;
    object-fit: cover;
    
}

section.list-sections section > h4 {
    font-size: 2rem;
    font-weight: 200;
    background-color: #fff;
    border-radius: 0 0 20px 20px;
    color: black;

    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
    padding: 0 1rem;
}

div.infos {
    color: black;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 1.2rem;
}

div.infos span.time {
    font-size: 1.2rem;
}

div.infos-tag {
    display: flex;
    flex-direction: column;
    align-items: start;
}   

/* ACCESSIBILITE AU FOCUS */
div.searchBar-filter-sort button:focus {
    outline: 3px solid black;
    transition: 0.2s all ease-in;
}

div.input-button-wrapper input:focus,
div.input-button-wrapper button:focus {
    outline: 3px solid black;
    transition: 0.2s all ease-in;
}

section.list-sections a:focus {
    transform: scale(1.08);
    outline: none;
    transition: 0.2s all ease-in;
}

/* RESPONSIVE */

@media screen and (max-width: 1130px) {
    div.sorts-display {
        position: absolute;
        top: 60%;
        right: 13%;
        transform: translate(60%, 10%);
    }
}

@media screen and (max-width: 900px) {
    div.searchBar-filter-sort {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    div.search-bar input[type='search'] {
        width: 80vw;
    }

    div.search-bar {
        margin: 1.2rem;
    }

    div.sorts-display {
        position: absolute;
        top: 60%;
        right: 53%;
        transform: translate(120%, 62%);
    }

    div.filters-display {
        position: absolute;
        left: 42%;
        top: 33%;
        transform: translate(-40%, 20%);
        min-width: 350px;
    }

}

@media screen and (max-width: 480px) {
    div.searchBar-filter-sort {
        margin-top: 6rem;
    }
}
