@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'poppins', sans-serif;
}

:root{
    --tenne-tawny: #008000;
    --tenne-tawny-dark: #055E05;
}

body{
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.6;
    font-family: 'poppins', sans-serif;
}

.btn{
    font-family: inherit;
    cursor: pointer;
    outline: 0;
    font-size: 1.05rem;
}

.text{
    opacity: 0.8;
}

.title{
     font-size: 3rem;
     margin-bottom: 2rem;
}

.container{
    min-height: 100vh; 
    padding-top: 200px;
}
.meal-wrapper{
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    text-align: center;
}
.meal-search{
    margin: 1rem 0;
}
.meal-search cite{
font-size: 1rem;
}

.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: 1.1rem;
    font-family: inherit;
    outline: 0;
    border: 1px solid var(--tenne-tawny);
    color: var(--tenne --tenne-tawny);
    border-radius: 1rem;
}

.search-control::placeholder{
    color: var(--tenne-tawny);
}
.search-btn{
    width: 75px;
    height: 55px;
    font-size: 1.8rem;
    background: var(--tenne-tawny);

    color: #fff;
    border: none;
    border-top-right-radius: 2rem;
    border-bottom-right-radius: 2rem;
    transition: all 0.4s linear;
} 
.search-btn:hover{
    background: var(--tenne-tawny-dark);
}
.meal-result{
    margin-top: 4rem;
}
#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;
}
.meal-name{
    padding: 1.5rem 0.5rem;
}
.meal-name h3{
    font-size: 1.4rem;
}
.recipe-btn{
    text-decoration: none;
    color: #fff;
    background: var(--tenne-tawny);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.75rem 0;
    display: block;
    width: 175px;
    margin: 1rem auto;
    border-radius: 2rem;
    transition: all 0.4s linear;
}
.recipe-btn:hover{
    background: var(--tenne-tawny-dark);
}

/* meal details */
/* .meal-details{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: var(--tenne-tawny);
    border-radius: 1rem;
    width: 90%;
    height: 90%;
    overflow-y: scroll;
    display: none;
    padding: 2rem 0;
} */

.meal-details {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: var(--tenne-tawny);
  border-radius: 1rem;
  width: 90%;
  max-width: 800px; /* keep it readable on larger screens */
  height: 90%;
  max-height: 90vh; /* don’t exceed viewport height */
  overflow-y: auto; /* scroll inside only */
  display: none;
  padding: 2rem 1rem;
  box-sizing: border-box;
  line-height: 1.6; /* ✅ space between lines for readability */
  word-break: break-word; /* ✅ break long words/URLs */
  overflow-wrap: break-word; /* ✅ ensure wrapping */
}

/* Ensure images don’t overflow */
.meal-details img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 📱 Mobile optimization */
@media (max-width: 576px) {
  .meal-details {
    width: 100%;          /* full width on small screens */
    height: 100%;         /* full height like a fullscreen modal */
    border-radius: 0;     /* remove radius for fullscreen look */
    padding: 1rem;        /* smaller padding */
    font-size: 0.95rem;   /* slightly smaller text */
    line-height: 1.7;     /* better spacing */
  }
}



/* .meal-details:: ::-webkit-scrollbar{
    width: 10px;
}
.meal-details:: ::-webkit-scrollbar-thumb{
    background: #f0f0f0;
    border-radius: 2rem;
} */

/* js related */
.showRecipe{
    display: block;
}

/* .meal-details-content {
  margin: 2rem auto;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
} */

/* Mobile-specific optimization */
/* @media (max-width: 576px) {
  .meal-details-content {
    font-size: 1rem;
    padding: 1.2rem;
    margin: 1rem;
  }
} */


.meal-details-content {
  margin: 1rem auto;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  /* width: 100%; */
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word; /* breaks long words */
  word-wrap: break-word;
  word-break: break-word;
  line-height: 2.0;
}

/* Mobile optimization */
@media (max-width: 576px) {
  .meal-details-content {
    font-size: 0.95rem;   /* slightly smaller text */
    padding: 0.8rem;      /* reduce padding */
    margin: 0.5rem;       /* reduce margin */
    max-width: 100%;
    line-height: 1.7;     /* more space between lines */
  }
}




.meal-details-content p:not(.recipe-category){
    padding: 1rem 0;
}

.recipe-close-btn{
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 1.8rem;
    background: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.recipe-title{
    letter-spacing: 1px;
    padding-bottom: 1rem;
}

.recipe-category{
    background: #fff;
    font-weight: 600;
    color: var(--tenne-tawny);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
}

.recipe-category{
    background: #fff;
    font-weight: 600;
    color: var(--tenne-tawny);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
}

.recipe-instruct{
    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: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.4s linear;
}

.recipe-link a:hover{
    opacity: 0.8;
}

/*  */
.notFound{
    grid-template-columns: 1fr!important;
    color: var(--tenne-tawny);
    font-size: 1.8rem;
    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;
}


@media screen and (min-width: 992px) {
    #meal{
        grid-template-columns: repeat(3, 1fr);
    }
}