/* CSS Variables for consistent theming */
:root {
    --primary-color: #5D4037; /* Dark Brown */
    --secondary-color: #8D6E63; /* Light Brown */
    --bg-color: #FFF8E1; /* Cream */
    --text-color: #3E2723;
    --white: #FFFFFF;
    --ad-bg: #F5F5F5;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Navigation */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Layout */
.page-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0;
    gap: 2rem;
}

.container {
    max-width: 800px; /* Optimal reading width for blogs */
    width: 100%;
    padding: 2rem 5%;
}

/* Ad Sidebar */
.ad-sidebar {
    display: none; /* Hide on smaller screens */
    width: 160px;
    min-height: 600px;
    background-color: var(--ad-bg);
    border: 1px dashed #ccc;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
    position: sticky;
    top: 80px; /* Stay fixed below header when scrolling */
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    flex-shrink: 0;
}



section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Hero Image Placeholder */
.hero-image {
    width: 100%;
    height: 300px;
    background-color: var(--secondary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Recipe Specifics */
.recipe-meta {
    display: flex;
    gap: 1.5rem;
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.ingredients-list {
    list-style-type: square;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.instructions-list {
    margin-left: 1.5rem;
}

.instructions-list li {
    margin-bottom: 1rem;
}

/* Clickable List Items */
.ingredients-list li, .instructions-list li {
    cursor: pointer;
    transition: opacity 0.3s, text-decoration 0.3s, color 0.3s;
}

.ingredients-list li:hover, .instructions-list li:hover {
    color: var(--secondary-color);
}

.completed-item {
    text-decoration: line-through;
    opacity: 0.4;
}

/* Form for Contact */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.contact-form button {
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-form button:hover {
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 5%;
    margin-top: 2rem;
}

footer a {
    color: var(--bg-color);
    text-decoration: underline;
}

/* Dashboard Cards */
.category-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background-color: var(--white);
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.category-card h2 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.category-card p {
    color: #666;
    font-size: 0.95rem;
}

.recent-recipes {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.recipe-list {
    list-style: none;
}

.recipe-list li {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.recipe-list li a {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    transition: color 0.3s;
}

.recipe-list li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

/* Search UI */
.search-container {
    position: relative;
    margin-left: auto;
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

.search-container input {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    width: 200px;
    font-size: 0.9rem;
    transition: width 0.3s, border-color 0.3s;
}

.search-container input:focus {
    width: 250px;
    border-color: var(--primary-color);
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    list-style: none;
    margin-top: 5px;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-list li {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover {
    background-color: #f9f9f9;
}

.autocomplete-list li strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.2rem;
}

.autocomplete-list li span {
    font-size: 0.8rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-dashboard {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: var(--white);
        padding: 1rem 5%;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
