/* --- Global Styles & Resets --- */
body {
    font-family: 'Open Sans', sans-serif;
    font-size: 18px; /* Base font size */
    line-height: 1.6; /* Improves readability */
    margin: 0; /* Remove default body margin */
    padding: 0;
    box-sizing: border-box; /* Ensures padding and border are included in element's total width/height */
    overflow-x: hidden; /* Prevent horizontal scrollbar from overflowing content */
}

/* Apply box-sizing to all elements */
*, *::before, *::after {
    box-sizing: inherit;
}

/* --- Accessibility Skip Link --- */
.offpage {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.offpage:focus {
    position: static;
    width: auto;
    height: auto;
}

/* --- Header & Banner Section --- */
header {
    background-color: aliceblue;
    border-bottom: 1px solid #dcdbdb;
    padding: 1rem 0;
    display: flex;
    flex-direction: column; /* Stacks banner and nav */
    align-items: center; /* Centers items horizontally within header */
}

.banner {
    position: relative;
    width: 100%; /* Ensure banner takes full width */
    overflow: hidden;
    margin-bottom: 1rem; /* Space between banner and nav */
}

.banner img {
    width: 100%; /* Image takes full width of banner */
    height: auto; /* Maintain aspect ratio */
    display: block;
    opacity: 0.4;
    object-fit: cover; /* Ensures image covers the area nicely without distortion */
    min-height: 200px; /* Minimum height for smaller screens */
    max-height: 400px; /* Max height to prevent very tall banners */
}

.text {
    position: absolute;
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for true centering */
    text-align: center;
    font-family: cursive;
    color: #333;
    /* Adjusted width to use clamp for better control across sizes */
    width: clamp(280px, 90vw, 700px); /* Min 280px, up to 90% of viewport width, max 700px */
    padding: 10px;
    text-shadow: 2px 2px 5px rgba(105, 63, 63, 0.7);
    /* Added z-index to ensure text is always above other elements if there are z-index conflicts */
    z-index: 2;
}

.text h1 {
    /* Increased font size for "Hey Foodies !!" - default (mobile) size */
    font-size: 3em;
    margin-bottom: 0.5em;
    line-height: 1.2; /* Tighter line height for multi-line headings */
}

.text p {
    /* Slightly increased font size for the other text - default (mobile) size */
    font-size: 1.1em;
    line-height: 1.4;
    margin: 0.5em 0;
}

/* --- Navigation Bar --- */
nav {
    width: 100%; /* Ensure nav takes full width */
    max-width: 900px; /* Limits max width of nav content */
    z-index: 1; /* Ensure nav is below text, but above other content */
}

nav ul {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap on small screens */
    justify-content: center; /* Centers nav items horizontally */
    list-style-type: none;
    margin: 0;
    padding: 0;
    /* Added a gap for more consistent spacing between buttons */
    gap: 7.5rem; /* This provides space between flex items */
}

nav li {
    display: block;
    /* Removed margin from li because 'gap' is used on ul for spacing */
    /* If you prefer margin over gap, use margin: 0 1rem; and remove gap from ul */
    width: auto;
    flex-grow: 1; /* Allow buttons to grow */
    max-width: 180px; /* Limits max width of each button */
}

.button {
    background-color: #363c91;
    border: none;
    border-radius: 10px;
    color: white;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    display: block; /* Make the anchor tag fill the li */
    font-size: 1.1em;
    cursor: pointer;
    transition-duration: 0.4s;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    white-space: nowrap; /* Prevent button text from wrapping */
}

.button:hover {
    background-color: #eee6f9;
    color: #363c91;
}

/* --- Main Content Area --- */
main {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

h2 {
    text-align: center;
    font-size: 2em;
    text-decoration: underline;
    font-variant: small-caps;
    margin-bottom: 1em;
}

main p {
    margin-bottom: 1em;
}

/* --- Gallery Section --- */
#gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

#gallery img {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 200px; /* Minimum width for each image before growing/shrinking */
    max-width: 350px; /* Default max-width for gallery images (e.g., on smaller screens) */
    height: 180px; /* Fixed height for consistency */
    border: 5px solid #6c6a6a;
    border-radius: 20%;
    padding: 5px;
    object-fit: cover;
}

#gallery img:hover {
    box-shadow: 6px 6px 6px 6px #afacac;
}

#gallery :nth-child(2n) {
    border-radius: 40%;
}

/* --- Menu Grid Section --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-gap: 20px;
    padding: 10px;
    margin-left: 0;
}

.item {
    border: 2px solid #3f2c2c;
    padding: 15px;
    text-align: center;
}

.item h3 {
    margin-top: 0;
    font-size: 1.5em;
}

.item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.item ul {
    list-style-type: none;
    padding: 0;
    text-align: left;
    margin: 0;
}

.item ul li {
    margin-bottom: 5px;
    font-size: 0.95em;
}

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* --- Contact Section --- */
#contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    margin-left: 0;
}

#contact img {
    max-width: 80%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 10px;
}

#contact p,
#contact ul {
    max-width: 600px;
    margin: 0 auto 1em auto;
    text-align: center;
}

#contact ul {
    list-style: none;
    padding: 0;
}

#contact ul li {
    margin-bottom: 0.5em;
}

/* --- Footer --- */
footer {
    background-color: gainsboro;
    text-align: center;
    padding: 15px;
    margin-top: 30px;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* --- Media Queries for Larger Screens --- */

/* Tablet & Smaller Desktop Screens (e.g., 768px and up) */
@media screen and (min-width: 768px) {
    .banner img {
        max-height: 500px;
    }

    .text {
        width: clamp(400px, 70vw, 700px); /* Adjusted width range for tablets */
    }

    .text h1 {
        font-size: 4em; /* Increased font size for "Hey Foodies !!" on tablets */
    }

    .text p {
        font-size: 1.3em; /* Slightly increased font size on tablets */
    }

    /* nav ul gap is already taking care of spacing, no specific margin needed here unless you want more */
    /* nav li { margin: 0 1rem; } */ /* Removed, let gap handle it */

    .button {
        padding: 12px 25px;
        font-size: 1.2em;
    }

    #gallery img {
        flex-basis: 250px; /* Base size for tablet gallery images */
        max-width: 400px; /* Adjusted max-width for tablets */
        height: 200px; /* Fixed height for consistency */
    }

    #contact {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 40px;
    }

    #contact img {
        max-width: 300px;
        margin-bottom: 0;
    }

    #contact p,
    #contact ul {
        text-align: left;
        margin: 0;
    }
}

/* Larger Desktop Screens (e.g., 1024px and up) */
@media screen and (min-width: 1024px) {
    .banner img {
        max-height: 600px;
    }

    .text {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        width: clamp(500px, 60vw, 800px);
    }

    .text h1 {
        font-size: 4.5em; /* Further increased font size for "Hey Foodies !!" on larger desktops */
    }

    .text p {
        font-size: 1.5em; /* Slightly increased font size on larger desktops */
    }

    nav ul {
        justify-content: center;
        margin-right: 0;
    }

    #gallery img {
        flex-basis: 300px; /* Base size for larger desktop gallery images */
        max-width: 350px; /* Adjusted max-width for larger desktops */
        height: 250px; /* Fixed height for consistency */
    }
}