/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('/images/juanita.jpg') no-repeat center center fixed;
    background-size: cover;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

h1 {
    font-family: "Georgia", "Times New Roman", serif;
    text-align: center;
    margin: 1rem 0;
    color: #5a3917;
}

/* ===== LINK STYLES ===== */

a {
    text-decoration: none;
    color: #007BFF;
}

a:hover {
    color: #0056b3;
}

/* ===== HEADER STYLES ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to right, #f1f1ec, #ecdbc7);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.header-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.header-wrapper h1 {
    width: 100%;
    text-align: center;
    margin: 0; /* Optional: removes default margin if needed */
}

/* ===== SEARCH BOX ===== */
#search-form {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 0.5rem;
}

#search-input {
    width: 400px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}

#search-form button {
    padding: 10px 20px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 0 4px 4px 0;
    background-color: #f8f8f8;
    cursor: pointer;
}

#search-form button:hover {
    background-color: #e8e8e8;
}

/* ===== MAIN CONTENT STYLES ===== */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

article {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

article h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ===== IMAGE CONTAINERS TO DISPLAY SEARCH RESULTS ===== */
/* Ensure the list item uses grid layout */
#search-results ul li {
    display: grid;
    grid-template-columns: 1fr auto; /* Text takes remaining space, image takes only what it needs */
    gap: 15px; /* Padding between text and image */
    margin-bottom: 30px;
    align-items: start; /* Align items to the top */
}

/* ===== RECIPE PRESENTATION ===== */
.recipe-wrapper {
    margin: 1rem 0;
}

.recipe-wrapper img {
    float: right;
    width: 45%;
    max-width: 45%;
    margin: 0 0 1rem 1rem;
    border-radius: 8px;
}

.recipe-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* ===== LIST OF RECIPE RESULT STYLES ===== */
.recipe-description {
    font-size: 14px;
    color: #555;
    margin: 5px 0;
    line-height: 1.4;
}

.recipe-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

.recipe-content {
    flex: 1;
    margin-right: 15px;
}

/* Style for the image container */
.recipe-image {
    max-width: 30vw;
    width: 100%; /* Ensure the container takes full available width */
    display: flex;
    justify-content: flex-end; /* Aligns content to the right */
    align-items: flex-start; /* Aligns content to the top */
    margin-left: 10px;
    margin-bottom: 10px;
    height: calc(1.2em * 4); /* Set container height to 4 lines of text */
    overflow: hidden; /* Prevents overflow */
}

/* Style for the image itself */
.recipe-image img {
    max-width: 100%; /* Fill the container width */
    max-height: 80%; /* Fill the container height */
    width: auto; /* Allow width to adjust based on height */
    height: auto; /* Allow height to adjust based on width */
    object-fit: contain; /* Ensure the image fits within the container */
    border-radius: 4px;
    display: block; /* Removes any extra space below the image */
}

/* ===== LIST STYLES ===== */
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

/* ===== CATEGORY STYLE ===== */
.recipe-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

#category-buttons {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}#ecdbc7

.category-button {
    display: inline-block; /* Ensures the span behaves like a block-level element */
    background-color: #f0dbc3;
    border: 1px solid #ddd;
    margin-right: 10px; 
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer; /* Indicates the span is clickable */
    font-size: 14px;
    text-decoration: none;
    color: black;
}

.category-button:hover {
    background-color: #f0d2af;
}

#recipe-categories a,
.recipe-categories a {
    background-color: #f0f0f0;
    padding: 3px 8px;
    margin-right: 5px;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

/* ===== FOOTER STYLES ===== */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #2c3e50;
    color: #fff;
    margin-top: 2rem;
}

/* ===== MOBILE STYLES (HAMBURGER MENU AND SIDEBAR) ===== */
@media (max-width: 767px) {
    /* Hamburger menu */
    .hamburger {
        display: block;
        cursor: pointer;
        padding: 10px;
        background: #f3e1aa;
        border-radius: 5px;
        position: absolute;
        top: 4rem;
        right: 1rem;
        z-index: 1001;
    }

    .hamburger div {
        width: 25px;
        height: 3px;
        background-color: #007BFF;
        margin: 5px 0;
    }

    /* Sidebar for mobile */
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        height: 100%;
        background-color: #fff;
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        padding: 4rem 1rem 1rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.active {
        display: block;
        transform: translateX(0);
    }

    /* Main content adjustment for mobile */
    main {
        padding: 1rem;
    }

    /* Header adjustment for mobile */
    .header-wrapper {
        flex-direction: column;
        align-items: center;
        padding: 0.5rem 1rem;
        position: relative;
        margin: 0 auto;
    }

    .header-wrapper h1 {
        margin: 0.5rem 0;
    }

    /* Search form for mobile */
    #search-form {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        max-width: 300px;
        margin: 0 auto;
        gap: 0.5rem;
    }

    #search-input {
        width: 70%;
        height: 2.2rem;
        width: 10rem;
        padding: 0.5rem;
    }

    #search-form button {
        height: 2.2rem;
        width: auto;
        padding: 0 1rem;
        margin-top: 0;
    }

    /* Recipe images for mobile */
    .recipe-wrapper img {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 1rem 0;
    }

}

/* ===== LARGE SCREEN LAYOUT ===== */
/* Large screen layout: two columns */
@media (min-width: 768px) {
    main {
        display: flex;
        gap: 2rem; /* Space between columns */
    }

    .main-article {
        flex: 0 0 70%; /* Main article takes 70% */
    }

    .sidebar {
        flex: 0 0 30%; /* Sidebar takes 30% */
        font-family: "Helvetica", Arial, sans-serif;
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
}


