/* Basic Reset & Body Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif; /* Your chosen base font */
    background-color: #f0f0e0; /* Your chosen background color (light beige) */
    color: #333; /* Dark gray for text */

    /* New: For full-height layout and flex column structure */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation Bar */
.navbar {
    /* Existing styles */
    background-color: #e0e0d0; /* Slightly darker than body background for subtle contrast */
    padding: 15px 0;
    text-align: center;

    /* New: For fixed positioning */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensure it stays on top */
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Makes list items display in a row */
    justify-content: center; /* Centers the navigation links */
}

.navbar li {
    margin: 0 20px;
}

.navbar a {
    text-decoration: none;
    color: #5d6d7e; /* A contrasting, muted blue-gray for links */
    font-family: "Georgia", serif; /* Your chosen font */
    font-size: 1.1em;
    padding: 5px 10px;
    transition: color 0.3s ease; /* Smooth transition for hover effect */
}

.navbar a:hover,
.navbar a:focus {
    color: #3e4c5e; /* Slightly darker on hover */
}

/* Cloud Banner */
.cloud-banner {
    /* Existing styles */
    width: 100%;
    height: 250px; /* Adjust height as needed */
    background-image: url('image1.png'); /* This is the corrected line! */
    background-size: cover; /* Ensures the image covers the entire banner area */
    background-position: center; /* Centers the image within the banner */
    background-repeat: no-repeat;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: subtle shadow below the banner */

    /* New: For fixed positioning, placed below the navbar */
    position: fixed;
    top: 60px; /* Assuming navbar height is around 60px */
    left: 0;
    z-index: 999; /* Below navbar */
}

/* Main Content Area */
.content {
    max-width: 960px;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;

    /* New: Adjust padding-top to account for fixed elements and their new higher positions */
    /* Navbar (60px) + Banner (250px) + h1 (approx 60px) + intro-text (approx 50px) + some buffer */
    padding-top: calc(60px + 250px + 60px + 50px + 20px);
    flex-grow: 1;
    position: relative;
    z-index: 1;
    margin: 0 auto;
    box-sizing: border-box;
}


h1 {
    color: #4a4a4a;
    text-align: center;
    /* margin-bottom: 25px; - This is now handled by intro-text's position */

    /* New: For fixed positioning and less width, higher */
    position: fixed;
    top: calc(60px + 250px + 10px); /* Below navbar and banner, with a small gap */
    left: 50%; /* Start at the center */
    transform: translateX(-50%); /* Pull back by half its width to truly center */
    max-width: 600px; /* Make it less wide */
    width: 100%; /* Ensure it respects max-width */
    background-color: #ffffff;
    padding: 10px 20px; /* Add horizontal padding */
    z-index: 998;
    margin: 0; /* Reset margin */
    box-sizing: border-box; /* Include padding in width */
}

.intro-text {
    /* New: For fixed positioning, below H1, less wide, higher */
    position: fixed;
    top: calc(60px + 250px + 10px + 60px); /* Below navbar, banner, and H1 with its padding */
    left: 50%; /* Start at the center */
    transform: translateX(-50%); /* Pull back by half its width to truly center */
    max-width: 600px; /* Make it less wide */
    width: 100%; /* Ensure it respects max-width */
    text-align: center;
    background-color: #ffffff;
    padding: 0 20px 20px; /* Add horizontal padding, preserve bottom padding */
    margin: 0;
    z-index: 997;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box; /* Include padding in width */
}


/* Scrollable Recipes Container */
.scrollable-recipes-container {
    /* Adjust heights based on new fixed element positions */
    /* Navbar (60px) + Banner (250px) + h1 (approx 60px) + intro-text (approx 50px) = 420px */
    height: calc(100vh - (60px + 250px + 60px + 50px)); /* Total height of fixed elements */
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 920px; /* Matches content max-width - padding */
    margin: 0 auto;
}

/* Article Sections and Entries (No changes needed here unless you want them) */
.articles-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-entry {
    display: flex;
    align-items: flex-start;
    border: 1px solid #eee;
    padding: 15px;
    background-color: #fcfcfc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 5px;
}

.article-image-container {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    margin-right: 15px;
    border: 1px solid #ddd;
    overflow: hidden;
    border-radius: 4px;
}

.article-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-intro {
    flex-grow: 1;
}

.article-intro h2 {
    margin-top: 0;
    font-size: 1.2em;
    color: #4a4a4a;
}

.article-intro h2 a {
    text-decoration: none;
    color: #5d6d7e;
}

.article-intro p {
    font-size: 0.9em;
    line-height: 1.5;
    color: #666;
}

.read-more {
    text-align: right;
    font-size: 0.9em;
    margin-top: 10px;
}

.read-more a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.read-more a:hover {
    text-decoration: underline;
}

/* --- Article Page Specific Styles --- */

/* Main content wrapper for article pages */
.article-content {
    max-width: 960px; /* Limits content width for readability, same as your main .content */
    margin: 30px auto; /* Centers content and adds vertical spacing */
    padding: 20px;
    background-color: #ffffff; /* White background for content to stand out */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow for content block */
    border-radius: 8px; /* Slightly rounded corners */

    /* Adjust padding-top to account for fixed navbar and cloud banner */
    /* Navbar (60px) + Cloud Banner (250px) + some buffer (e.g., 30px) = 340px */
    padding-top: calc(60px + 250px + 30px); /* Adjust based on your actual navbar and banner heights */
    flex-grow: 1; /* Allows main content to take up remaining space */
    box-sizing: border-box; /* Include padding in total width/height */
}

/* Ensure the navbar and banner are fixed on article pages too */
.navbar, .cloud-banner {
    position: fixed;
    /* ... (rest of their fixed styles from your merged CSS) ... */
}

/* Central image in the article */
.article-main-image {
    display: block; /* Ensures margin auto works for centering */
    max-width: calc(100% - 40px); /* White section width (960px) - padding (20px*2) = 920px. Max-width will be 920px - some margin for the image */
    width: 100%; /* Ensures it scales down on smaller screens */
    height: auto; /* Maintain aspect ratio */
    margin: 0 auto 30px auto; /* Center image, add space below it */
    border-radius: 8px; /* Match content block */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Header for the article */
.article-content .article-header { /* Specificity for h1 within article-content */
    color: #4a4a4a;
    text-align: center;
    margin-top: 0; /* Reset default h1 margin-top */
    margin-bottom: 25px; /* Space below header */
    font-size: 2.2em; /* Make it prominent */
}

/* Text section for the article body */
.article-text {
    line-height: 1.7;
    font-size: 1.1em;
    color: #444;
}

.article-text p {
    margin-bottom: 1em; /* Space between paragraphs */
}

.article-text ul, .article-text ol {
    margin-left: 25px;
    margin-bottom: 1em;
}

.article-text li {
    margin-bottom: 0.5em;
}

/* Adjustments for smaller screens on article pages */
@media (max-width: 768px) {
    .article-content {
        padding-top: calc(60px + 150px + 20px); /* Adjust for smaller banner on mobile */
        margin: 20px auto; /* Less vertical margin on mobile */
    }
    .article-main-image {
        max-width: calc(100% - 20px); /* Adjust image width for mobile padding */
        margin-bottom: 20px;
    }
    .article-content .article-header {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    .article-text {
        font-size: 1em;
    }
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    .article-entry {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .article-image-container {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .navbar ul {
        flex-wrap: wrap;
    }

    /* Adjust fixed elements for smaller screens if needed */
    .cloud-banner {
        height: 150px;
    }
    h1 {
        top: calc(60px + 150px + 10px);
        max-width: 90%; /* Adjust width for mobile */
    }
    .intro-text {
        top: calc(60px + 150px + 10px + 60px);
        max-width: 90%; /* Adjust width for mobile */
    }
    .content {
        padding-top: calc(60px + 150px + 60px + 50px + 20px);
    }
    .scrollable-recipes-container {
        height: calc(100vh - (60px + 150px + 60px + 50px));
    }
}