/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    /* --- Brand Colors --- */
    --primary-color: #547953;       /* Sage Green (Main Brand) */
    --primary-hover: #3E5C3D;       /* Darker Sage */
    --secondary-color: #E9C46A;     /* Gold/Mustard (Accents) */
    --danger-color: #D32F2F;        /* Red (Errors/Likes) */
    
    /* --- Text Colors (High Contrast for SEO) --- */
    --text-main: #1A201A;           /* Almost Black - Primary Text */
    --text-body: #2C3E2C;           /* Dark Green-Grey - Body Text */
    --text-muted: #596E59;          /* Accessible Muted Green */
    --text-light: #ffffff;
    
    /* --- Backgrounds --- */
    --bg-body: #FDFCF8;             /* Warm Off-White (Reduces Eye Strain) */
    --bg-surface: #ffffff;          /* Pure White (Cards) */
    --bg-highlight: #F1F5F1;        /* Light Sage Tint */
    
    /* --- Layout & Spacing --- */
    --container-width: 1200px;
    --border-radius: 8px;
    
    /* --- Shadows --- */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(44, 62, 44, 0.08);
    --shadow-lg: 0 12px 24px rgba(44, 62, 44, 0.12);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 100%; /* Base 16px */
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape on iOS */
}

body {
    font-family: 'Lora', serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. TYPOGRAPHY (Responsive & SEO Friendly)
   ========================================================================== */
h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Lora', serif;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* Responsive Heading Sizes */
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

/* Mobile Font Adjustment (Prevents Overflow) */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Images */
img {
    max-width: 100%;
    height: auto; /* Maintains aspect ratio (Critical for CLS score) */
    display: block;
}

/* ==========================================================================
   3. NAVIGATION (Mobile Touch Friendly)
   ========================================================================== */
.navbar {
    background-color: var(--bg-surface) !important;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    border-bottom: 1px solid #E8EBE8;
}
.navbar-nav {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.navbar a {
    display: flex;
    align-items: center;
  
}
.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Navigation Links - Large tap targets for SEO */
.nav-link {
    font-size: 1rem;
    color: var(--text-main) !important;
    font-weight: 600;
    padding: 0.75rem 1rem !important; /* Min 44px height usually covered here */
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--bg-highlight);
    text-decoration: none;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 10px 16px; /* Easy to tap */
    font-family: 'Lora', serif;
    border-radius: 4px;
}

.dropdown-item:hover {
    background-color: var(--bg-highlight);
    color: var(--primary-color);
}

/* ==========================================================================
   4. CARDS & LAYOUT
   ========================================================================== */
.article-card {
    background: var(--bg-surface);
    border: 1px solid #EAEAEA;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.article-card .card-img-top {
    height: 220px;
    object-fit: cover;
    width: 100%;
}

.article-card .card-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-card .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.article-card .card-title a {
    color: var(--text-main);
    text-decoration: none;
    background: linear-gradient(transparent 95%, var(--primary-color) 5%);
}

.article-card .card-title a:hover {
    color: var(--primary-color);
}

.article-card small.text-muted {
    margin-top: auto;
    color: var(--text-muted) !important;
    font-size: 0.875rem;
}

/* ==========================================================================
   5. SINGLE ARTICLE (Readability Focused)
   ========================================================================== */
article {
    /* Layout */
}

/* Meta Data */
.article-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-meta i {
    color: var(--primary-color);
}

/* Featured Image */
.featured-image-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

/* --- Content Typography (The most important part for Food Blogs) --- */
.article-content {
    font-size: 1.125rem; /* 18px - Perfect for reading */
    line-height: 1.8;
    color: #2F2F2F;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2, 
.article-content h3 {
    margin-top: 2.5rem;
    color: var(--primary-color);
}

/* --- Ingredients Box --- */
.card.border-primary {
    border: 1px solid #D1D9D1 !important;
    background-color: #FAFCFA; /* Very light green */
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.card-header.bg-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
    font-size: 1.25rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.list-group-item {
    background-color: transparent;
    border-bottom: 1px dashed #D1D9D1;
    padding: 0.75rem 0;
    font-size: 1.125rem;
}

.bi-check2-circle {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-right: 10px;
    vertical-align: text-bottom;
}

/* --- Instructions --- */
.instructions-list .badge {
    background-color: var(--primary-color) !important;
    width: 35px;
    height: 35px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', serif;
}

/* --- Ad Block --- */
.ad-block {
    background: #fff;
    border: 1px solid #eee;
    padding: 1rem;
    margin: 2rem 0;
    border-radius: var(--border-radius);
}

/* --- Affiliate Links --- */
.affiliate-link {
    color: #C25E00; /* Contrast color for links */
    border-bottom: 1px dotted #C25E00;
}
.affiliate-link:hover {
    background-color: #FFF3E0;
    text-decoration: none;
}

/* ==========================================================================
   6. SIDEBAR & WIDGETS
   ========================================================================== */
.sticky-sidebar {
    position: sticky;
    top: 90px;
    z-index: 10;
}

/* Widgets */
.card.shadow-sm {
    border: none;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    background: var(--bg-surface);
}

.list-group-item.d-flex {
    border: none;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Newsletter */
.card-header.bg-primary {
    font-weight: 700;
}

/* ==========================================================================
   7. INTERACTIVE ELEMENTS (Buttons & Forms)
   ========================================================================== */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem; /* Large touch area */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

/* Forms */
.form-control {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #CED4DA;
    font-size: 1rem; /* Prevents iOS zoom on input focus */
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(84, 121, 83, 0.2);
}

/* ==========================================================================
   8. ANIMATIONS & UTILITIES
   ========================================================================== */
/* Like Button */
.heart-active {
    color: var(--danger-color) !important;
    animation: heartBeat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Fade In */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer {
    background-color: #1A201A !important; /* Very Dark Green */
    color: #C1CDC1;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 4px solid var(--primary-color);
}

footer a {
    color: #fff;
    opacity: 0.7;
}

footer a:hover {
    opacity: 1;
    color: var(--primary-color);
    text-decoration: none;
}

/* Scroll Top Button */
#scrollTopBtn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--primary-color);
    border: none;
    color: white;
}

/* ==========================================================================
   9. MOBILE OPTIMIZATIONS (Specific)
   ========================================================================== */
@media (max-width: 576px) {
    /* Increase side padding for better readability on phones */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Stack buttons full width */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .btn-group .btn {
        width: 100%;
        border-radius: 8px !important; /* Reset pill shape for stacked buttons */
    }

    /* Adjust Card Images */
    .article-card .card-img-top {
        height: 200px;
    }
    
    /* Ensure modal doesn't touch edges */
    .modal-dialog {
        margin: 1rem;
    }
}