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

body {
    font-family: 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 {
    text-align: center;
    margin: 1rem 0;
    color: #5a3917;
}

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, #FFD700, #FF8C00);
    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 */
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
    display: block; /* Always show hamburger */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #5a3917;
    padding: 0.5rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
}


/* ===== NAVIGATION ===== */
.nav-menu {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: absolute;
    top: 3.5rem;
    right: 0;
    width: 25%;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.nav-menu.active {
    display: flex; /* Show when active */
}

.nav-menu a {
    font-weight: bold;
    padding: 0.5rem 0.75rem; /* Reduced horizontal padding */
    color: #0000EE;
    text-decoration: underline;
    flex: 1;
    text-align: center;
    font-size: 0.9rem; /* Slightly smaller font */
}

.nav-menu a:hover {
    color: #0056b3;
}

/* ===== IMAGE CONTAINERS ===== */
.image-container {
    display: flex;
    width: 100%;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 0;
    flex-wrap: wrap;
}

.image-container img {
    height: 80px;
    width: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

/* ===== 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;
}

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

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

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    .hamburger {
        display: block;
        position: absolute; /* Take hamburger out of the flex flow */
        top: 0.5rem;
        right: 1rem;
        z-index: 200; /* Ensure it's above other elements */
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 3.5rem;
        right: 0;
        width: 35%;
        background: rgba(255, 255, 255, 0.95);
        padding: 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-menu a {
        padding: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        text-decoration: none;
        color: #0000EE;
        text-align: right;
        padding-right: 1rem;
    }
    .header-wrapper {
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center items horizontally */
        padding: 0.5rem 1rem;
        max-width: 1200px;
        margin: 0 auto;
        position: relative;
    }
    .header-wrapper > *:not(.hamburger) {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }
    .header-wrapper h1 {
        margin: 0.5rem 0;
    }
    #search-form {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center; /* Vertically center items */
        max-width: 300px;
        margin: 0 auto;
        gap: 0.5rem; /* Add space between input and button */
    }
    #search-input {
        width: 70%;
        height: 2.2rem; /* Set a fixed height */
        padding: 0.5rem;
    }
    #search-form button {
        height: 2.2rem; /* Match input height */
        width: auto; /* Let button size to content */
        padding: 0 1rem; /* Add horizontal padding */
        margin-top: 0;
    }
}




/* ===== PRINT STYLES ===== */
.print-button {
    padding: 0.5rem 1rem;
    background-color: #bbf19c;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem;
    height: fit-content;
}

.print-button:hover {
    background-color: #90c970;
}

@media print {
    body * {
        visibility: hidden;
    }

    .recipe, .recipe * {
        visibility: visible;
    }

    .recipe {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0 0 0 1cm;
    }

    .recipe, .recipe-wrapper {
        background: none !important;
        color: black !important;
        margin: 0;
        padding: 0;
    }

    .recipe-wrapper img {
        display: none;
    }

    header, footer, nav, .image-container {
        display: none;
    }

    a {
        color: black !important;
        text-decoration: underline;
    }

    ul, ol {
        margin: 0.1rem 0;
        padding-left: 1.5rem;
    }

    ul li, ol li {
        margin-bottom: 0.1rem;
        line-height: 1.1;
    }

    h1, h2, h3 {
        margin: 0.2rem 0;
        line-height: 1.1;
    }

    p {
        margin: 0.1rem 0;
        line-height: 1.1;
    }

    .recipe * {
        line-height: 1.1;
    }
}

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

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

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

@media (max-width: 768px) {
    .recipe-wrapper img {
        float: none;
        width: 100%;
        margin: 0 0 1rem 0;
    }
}

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

#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;
}

/* ===== RECIPE RESULT STYLES ===== */
.recipe-result {
    border: 1px solid #ddd;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    overflow: auto;
}

.recipe-result h3 {
    margin-top: 0;
}

.recipe-image {
    float: right;
    margin-left: 10px;
    margin-bottom: 10px;
}

.recipe-image img {
    max-width: 113px;
    max-height: 113px;
    border-radius: 4px;
}

.recipe-content {
    overflow: hidden;
}

#recipes-list,
#search-results {
    margin-top: 20px;
}

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




/* ===== CATEGORY STYLE ===== */

      .category-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin: 20px 0;
      }
      .category-list a {
        background-color: #f5c264;
        padding: 10px 15px;
        border-radius: 5px;
        text-decoration: none;
        color: #333;
        font-size: 14px;
        transition: background-color 0.2s;
      }
      .category-list a:hover {
        background-color: #e0e0e0;
      }
      .category-list h2 {
        text-align: center;
        margin-top: 0;
      }



  /* Modal styles */
  .modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
  }
  .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    text-align: center;
    border-radius: 5px;
  }
  .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  .close:hover {
    color: black;
  }

