/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Playfair Display', serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    text-align: center;
}

/* Navigation */
header {
    background-color: #E27D60;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

#menu-toggle {
    background: none;
    position: absolute;
    right: 0;
    padding-right: 5px;
    border: none;
    font-size: 24px;
    color: black;
    cursor: pointer;
}

nav {
    background-color: #E8A87C;
    display: grid;
    position: absolute;
    top: 71px;
    right: 0px;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease-out;
}


nav ul {
    margin: 0;
    padding: 0 20px;
    list-style: none;
    overflow: hidden;
}

nav ul li a {
    color: #333;
    text-decoration: none;
    padding: .5rem;
    display: block;
    text-align: center;
    font-size: 1.4rem;
    text-wrap: nowrap;
}

nav ul li.active a {
    /* text-decoration: 4px underline #41B3A3 solid;  */
    color: black;
    font-weight: bolder;
}

nav ul li a:hover {
    background-color: rgba(255,255,255,0.15);
}

nav.show {
    grid-template-rows: 1fr;
    
}

  /* Main recipe page styling */
.main-header {
    font-size: 2rem;
    margin-bottom: 5px;
}

.recipe-page {
    padding: 20px;
    background-color: #41B3A3;
}
.search-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.search-filter input, .search-filter select, .search-filter button {
    padding: 10px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
}
.recipe-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.recipe-card {
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column; /* Stack items vertically */
    flex-grow: 1; /* Allows content to expand but pushes the button down */
    justify-content: space-between; /* Space out elements */
    height: 100%; /* Ensure all cards are the same height */
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #E8A87C;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    opacity: 0; 
    animation: fadeInScaleUp 0.8s ease-out forwards;
    transform: scale(0.8); /* Start slightly smaller */
}
.recipe-card:hover {
    transform: scale(1.05);
}
.recipe-img {
    width: 60%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 0 15px black;
}
.recipe-title {
    margin-top: 10px;
    font-size: 1.5em;
}
  
.recipe-summary {
    font-size: 1.2em;
    color: #555;
}


.recipe-card:nth-child(n) {
    animation-delay: calc(0.2s * var(--index));
}

/* Fade-in & Scale-Up Keyframes */
@keyframes fadeInScaleUp {
    from {
      opacity: 0;
      transform: scale(0.8);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  
/* Modal styles using dialog */
dialog {
    border: none;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    background: white;
    position: relative;
}

dialog img {
    width: 50%;
}

#recipe-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
}








/* Footer */
footer {
    background: #E27D60;
    padding: 10px;
}

.footer-social ul {
    list-style: none;
    align-content: center;
    justify-self: center;
    padding-left: 1rem;
    margin: .5rem 0; /* Add space above the social icons */
    display: flex;
    gap: 1rem;
}

.footer-social li {
    display: inline-block;
}

.footer-social a {
    font-size: 1.2rem;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: #e8f5e9; /* Light green hover color */
}




/* Responsive Styles */
@media (min-width: 768px) {
    nav {
        background-color: #E27D60;
        grid-template-rows: 1fr;
        position: relative;
        top: 0;
        right: 0;
    }

    nav ul {
        display: flex;
        gap: 20px;
    }

    nav ul li {
        flex: 1 1 100%;
    }

    #menu-toggle {
        display: none;
    }


    .search-filter {
        flex-direction: row;
        justify-content: center;
    }
    .search-filter input, .search-filter select, .search-filter button {
        width: auto;
    }
    .recipe-grid {
        /* grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); */
        grid-template-columns: repeat(2, 1fr); /* Two columns */
    }



    .footer-social {
        padding-right: 2rem;
    }
}



@media (min-width: 1024px) {
    .recipe-grid {
        /* grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); */
        grid-template-columns: repeat(3, 1fr); /* Three columns */
    }

}