@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@100..900&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;
}

/* Container styles */
.container {
    width: 90%;
    margin: 0 auto;
}


/* Recipe cards container */
#recipes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 50px;
}


/* Recipe card styles */
.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: lighter;
    font-family: "League Spartan", "Poppins", sans-serif;
    margin: 0;
}

/* Recipe detail container */
.recipe-detail {
    display: none;
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-height: 80vh;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow-y: auto;
}

.recipe-detail.open {
    display: block;
    /* Show when open */
}


.container h1 {
    font-family: "League Spartan", "Poppins", sans-serif;
    margin: 20px 20px 0;
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Recipe detail content */
.recipe-detail h2 {
    font-size: 2em;
    margin-bottom: 30px;
    margin-top: -50px;
}

.recipe-detail img {
    width: 80%;
    height: auto;
    border-radius: 8px;
}

.recipe-detail h3 {
    font-size: 2em;
    margin: 30px 0;
}

.recipe-detail ul {
    padding: 0;
}

.recipe-detail ul li {
    margin-bottom: 10px;
}

.recipe-detail p {
    font-size: 1.1em;
    line-height: 1.6;
}



/* Close button styles */
.close-btn {
    position: sticky;
    top: 20px;
    left: 900px;
    font-size: 2em;
    cursor: pointer;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 100%;
    padding: 0 10px;
    z-index: 1001;
}


/* Prevent background scrolling when recipe detail is open */
body.no-scroll {
    overflow: hidden;
    padding-right: 15px;
}




/* Media Queries */

/* 1024px and up */
@media (max-width: 1100px) {
    .recipe-detail {
        padding: 40px;
    }

    .recipe-detail h2 {
        font-size: 1.8em;
    }

    .recipe-detail img {
        width: 70%;
    }

    .recipe-detail h3 {
        font-size: 1.6em;
    }

    .recipe-detail p {
        font-size: 1em;
    }

    #recipes {
        flex: none;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 768px and up */
@media (max-width: 800px) {

    .navbar-toggler {
        scale: 0.9;
    }

    .recipe-detail {
        width: 90%;
    }

    .recipe-detail h2 {
        font-size: 1.6em;
    }

    .recipe-detail img {
        width: 75%;
    }

    .recipe-detail h3 {
        font-size: 1.4em;
    }

    .recipe-detail p {
        font-size: 1.05em;
    }

    #recipes {
        flex: none;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}


/* Below 425px */
@media (max-width: 480px) {
    .navbar-toggler {
        scale: 0.9;
    }

    .recipe-detail {
        width: 100%;
        padding: 20px;
    }

    .recipe-detail h2 {
        font-size: 1.2em;
    }

    .recipe-detail img {
        width: 100%;
    }

    .recipe-detail h3 {
        font-size: 1em;
    }

    .recipe-detail p {
        font-size: 0.9em;
    }

    #recipes {
        flex: none;
        display: grid;
        justify-items: center;
        grid-template-columns: repeat(1, 1fr);
    }
}