/*fonts*/

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,600;0,700;1,400&display=swap');

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}


body{
    font-weight: 300;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    
}

.btn{
    font-family: inherit;
    cursor: pointer;
    outline: 0;
    font-size: 1rem;
}

.title{
    font-size: 2rem;
    margin-bottom: 1rem;
}

.container{
    min-height: 100vh;
}

.meal-wrapper{
    max-width: 1280px;
    margin: 0 auto;
    background: #fff;
    text-align: center;
}

.meal-search{
    margin: 2rem 0;
}

.meal-search-box{
    margin: 1.2rem 0;
    display: flex;
    align-items: stretch;
}

.search-control,
.search-btn{
    width: 100%;
}


.search-control{
padding: 0 1rem;
font-size: 1rem;
font-family: inherit;
outline: 0;
border: 1px solid rgb(66, 153, 127);
color: rgb(66, 153, 127);
border-top-left-radius: 2rem;
}

.search-control::placeholder{
    color: rgb(66, 153, 127);
}

.search-btn{
width: 55px;
height: 55px;
font-size: 1.8rem;
background: rgb(66, 153, 127);
color: #fff;
border: none;
border-top-right-radius: 2rem;
border-bottom-right-radius: 2rem;
}

.meal-result{
    margin-top: 4rem;
    max-width: 80%;
    margin: 0 auto;
}

#meal{
    margin: 2.4rem 0;
}

.meal-item{
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 21px -12px rgba(0, 0, 0, 0.79);
    margin: 2rem 0;
}

.meal-img img{
    width: 100%;
    display: block;
    height:max-content;
}

.meal-name{
    padding: 1.5rem 0.5rem;
}

.meal-name h3{
    font-size: 1.4rem;
}

.recipe-btn{
    text-decoration: none;
    color: white;
    background-color: rgb(66, 153, 127);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.75rem 0;
    display: block;
    width: 175px;
    margin: 1rem auto;
    border-radius: 2rem;
    transition: all 0.5s linear;
}

.recipe-btn:hover{
    background:rgb(35, 114, 91);
}

/*Meal details*/
.meal-details{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background-color: rgb(35, 114, 91);
    border-radius: 1rem;
    width: 90%;
    height: 90%;
    overflow: scroll;
    display: none;
    padding: 2rem 0;
    
}

.meal-details-content p{
    padding: 1rem 0;
}

.meal-details::-webkit-scrollbar{
    width:10px;
}

.meal-details::-webkit-scrollbar-thumb{
    background: #f0f0f0;
    border-radius: 2rem;
}

.showRecipe{
    display: block;
}

.meal-details-content{
    margin: 2rem;
}

.meal-details-content p:not(.recipe-category){
    padding: 1rem 0;
}

.btn-recipe-close-btn{
    cursor: pointer;
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 1.8;
    background-color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.recipe-title{
    padding-bottom: 1rem;
}

.recipe-category{
    background-color: #fff;
    font-weight: 600;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    color:rgb(35, 114, 91);
}

.recipe-instructions{
    padding: 1rem 0;
}

.recipe-meal-img img{
width: 100px;
height: 100px;
border-radius: 50%;
margin: 0 auto;
display: block;
}

.recipe-link{
    margin: 1.4rem 0;
}

.recipe-link a{
    color: white;
    font-size: 1.2;
    font-weight: 700;
    transition: all 0.4s linear;
}

.recipe-link a:hover{
    color:rgb(148, 167, 161);
}

.notFound{
    grid-template-columns: 1fr !important;
    color:rgb(35, 114, 91);
    font-size: 1.5rem;
    font-weight: 600;
    width: 100%;
}

@media screen and (min-width: 600px){
    .meal-search-box{
        width: 540px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media screen and (min-width: 768px){
    #meal{
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    .meal-item{
       margin: 0; 
    }
    .meal-details{
        width: 600px;
    }
}

@media screen and (min-width: 992px){
    #meal{
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}