/* ==========================================================================
   1. THEME TOKENS (CSS VARIABLES)
   ========================================================================== */
:root {
    /* Brand Colors */
    --primary-green: #4f6d3b;
    --accent-gold: #bf8f00;

    /* Backgrounds */
    --bg-main: #ffffff;         /* Main body background */
    --bg-grey: #f4f5f4;         /* Gray background sections */
    --bg-surface: #ffffff;      /* Cards, dropdowns, inputs */
    --bg-glass: rgba(255, 255, 255, 0.9); /* Header */
    --hero-bg: linear-gradient(135deg, #e0e4e1 0%, #ffffff 100%);

    /* Typography */
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-inverse: #ffffff;    /* Text on dark buttons */

    /* Borders & Shadows */
    --border-subtle: rgba(0, 0, 0, 0.05);
    --border-input: #ccc;
    --shadow-resting: 0 10px 30px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 15px 35px rgba(79, 109, 59, 0.08);
}

body.dark-mode {
    /* Brand Colors */
    --primary-green: #84b563;
    --accent-gold: #d4ac0d;

    /* Backgrounds */
    --bg-main: #121212;
    --bg-grey: #1a1a1a;
    --bg-surface: #1a1a1a;
    --bg-glass: rgba(18, 18, 18, 0.85);
    --hero-bg: linear-gradient(135deg, #222 0%, #121212 100%);

    /* Typography */
    --text-primary: #f4f5f4;
    --text-secondary: #aaaaaa;
    --text-inverse: #121212;

    /* Borders & Shadows */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-input: #444;
    --shadow-resting: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 15px 35px rgba(132, 181, 99, 0.1);
}

/* ==========================================================================
   2. GLOBAL STYLES
   ========================================================================== */
html { 
    scroll-behavior: smooth; 
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; /* Removes blue tap box on mobile */
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px; 
    text-align: center;
}

/* --- UTILITY CLASSES --- */
.narrow { max-width: 800px; }
.center-text { text-align: center; }
.grey-bg { background-color: var(--bg-grey); }
.text-green { color: var(--primary-green); }
.text-justify { text-align: justify; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-50 { margin-top: 50px; }

.divider {
    width: 60px; 
    height: 3px; 
    background-color: var(--primary-green); 
    margin: 30px auto; 
    border-radius: 3px; 
}

.contact-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}
.contact-link:hover { color: var(--primary-green); }

.contact-link-green {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}
.contact-link-green:hover { color: var(--text-primary); }

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 999; 
    background-color: var(--bg-glass);
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid var(--border-subtle); 
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px; 
    background: transparent; 
    position: relative; 
}

.logo { height: 50px; }

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 5px;
}

.main-nav {
    display: flex;
    gap: 15px;
    align-items: center; 
    flex-wrap: nowrap;   
    white-space: nowrap; 
}

.main-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 22px;
    border-radius: 30px;
    border: 1.5px solid var(--border-subtle);
    transition: all 0.3s ease;
    display: inline-block;
}

.main-nav a:hover {
    background-color: var(--primary-green);
    color: var(--text-inverse);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 109, 59, 0.2);
}

.main-nav a.active {
    background-color: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
}

/* ==========================================================================
   4. BUTTONS & FORMS
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.btn-black { background-color: var(--text-primary); color: var(--bg-main); }
.btn-black:hover { background-color: var(--primary-green); color: var(--text-inverse); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(79, 109, 59, 0.2); }

.btn-green { background-color: var(--primary-green); color: var(--text-inverse); width: 100%; }
.btn-green:hover { background-color: var(--text-primary); color: var(--bg-main); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(26, 26, 26, 0.2); }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 20px auto;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 5px rgba(79, 109, 59, 0.2);
}

.whatsapp-btn {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: color 0.3s ease;
}
.whatsapp-btn:hover { color: var(--text-primary); text-decoration: underline; }

/* ==========================================================================
   5. PAGE SECTIONS (Hero, Services, Blog Cards)
   ========================================================================== */
.hero { background: var(--hero-bg); padding: 100px 0; }
.hero-grid { display: flex; flex-direction: column-reverse; align-items: center; text-align: center; gap: 40px; }
.hero h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 20px; }
.hero-text h1, .services-hero h1, .special-cards h3 { color: var(--accent-gold); }

.hero-image img { max-width: 300px; }
.bio-grid, .services-grid { display: flex; flex-direction: column; gap: 50px; margin-top: 50px; }
.bio-image img { width: 100%; max-width: 400px; border-radius: 4px; }

/* Component Cards (Services, Blog, Resources) */
.service-box, .blog-card, .resource-card { 
    background-color: var(--bg-surface); 
    padding: 40px 30px; 
    border: 1px solid var(--border-subtle); 
    border-radius: 12px; 
    text-align: left; 
    box-shadow: var(--shadow-resting); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-box:hover, .blog-card:hover, .resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover); 
}

.section-title, .services-grid h3 { text-align:center; color: var(--primary-green); }

/* Additional text color mapping */
p { color: var(--text-secondary); }
strong, h1, h2, h3, h4, h5, h6 { color: var(--text-primary); }
.hero-text h1, .services-hero h1, .special-cards h3 { color: var(--accent-gold); }

/* ==========================================================================
   6. SEARCH STYLES
   ========================================================================== */
.search-form { 
    display: flex; align-items: center; background: var(--bg-grey); border-radius: 20px; padding: 4px 12px; border: 1px solid var(--border-subtle); margin-left: 10px; 
}
.search-form input { border: none; background: transparent; padding: 6px; font-size: 0.9rem; outline: none; width: 100px; color: var(--text-primary); transition: width 0.3s ease; }
.search-form input:focus { width: 160px; }
.search-form button { background: transparent; border: none; cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; padding: 4px; transition: color 0.2s ease; }
.search-form button:hover { color: var(--primary-green); }

.search-dropdown {
    display: none; position: absolute; top: calc(100% + 15px); right: 0; width: 340px; background: var(--bg-surface);
    border: 1px solid var(--border-subtle); border-radius: 8px; box-shadow: var(--shadow-resting); z-index: 2000; overflow: hidden;
}
.main-nav .search-dropdown-item {
    display: flex; align-items: center; width: 100%; padding: 12px 16px; text-decoration: none; color: var(--text-primary);
    border: none; border-bottom: 1px solid var(--border-subtle); border-radius: 0; margin: 0; background: transparent; transition: background-color 0.2s;
    font-size: 0.9rem; text-align: left; white-space: normal; box-shadow: none !important; transform: none !important;
}
.main-nav .search-dropdown-item:last-child { border-bottom: none; }
.main-nav .search-dropdown-item:hover { background-color: var(--bg-grey); color: var(--text-primary); }
.search-dropdown-item .badge { background: var(--bg-grey); color: var(--primary-green); font-size: 0.65rem; padding: 3px 6px; border-radius: 4px; margin-right: 12px; font-weight: 600; text-transform: uppercase; flex-shrink: 0; border: 1px solid var(--border-subtle); }
.search-dropdown-item .title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; line-height: 1.3; }
.main-nav .search-dropdown-item.see-all { justify-content: center; font-weight: 600; color: var(--primary-green); background: var(--bg-grey); }

/* ==========================================================================
   7. FOOTER & EXTRAS
   ========================================================================== */
footer { background: #000; color: #fff; padding: 30px 20px 20px; text-align: center; margin-top: auto; }
footer p, 
footer span {
    color: rgba(255, 255, 255, 0.7); /* Overrides the global rule with a nice, soft white */
}
.footer-content { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; padding-bottom: 15px; }
.social-icons { display: flex; gap: 12px; }
.social-icons a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background-color: #222; border-radius: 50%; transition: all 0.3s ease; text-decoration: none; }
.social-icons svg { fill: #ffffff; width: 18px; height: 18px; display: block; }
.social-icons a:hover { background-color: var(--primary-green); transform: translateY(-3px); }
.privacy-link { color: #fff; text-decoration: none; opacity: 0.7; font-size: 0.8rem; margin-top: 10px; display: inline-block; }

.theme-toggle { background: none; border: none; cursor: pointer; color: var(--text-primary); display: flex; align-items: center; justify-content: center; padding: 5px; border-radius: 50%; transition: background-color 0.3s ease; }
.theme-toggle:hover { background-color: rgba(128, 128, 128, 0.2); }
.theme-toggle svg { transition: transform 0.3s ease; }
.theme-toggle:hover svg { transform: rotate(15deg); }

.hamburger { position: relative; width: 34px; height: 34px; padding: 5px; }
.hamburger .icon-bars, .hamburger .icon-close { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(0deg); transition: opacity 0.25s ease, transform 0.3s ease; }
.hamburger .icon-bars { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
.hamburger .icon-close { opacity: 0; transform: translate(-50%, -50%) rotate(-90deg); display: block !important; }
.hamburger.is-open .icon-bars { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }
.hamburger.is-open .icon-close { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }

/* ==========================================================================
   8. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (min-width: 768px) {
    .hero-grid { flex-direction: row; text-align: center; }
	.bio-grid { flex-direction: row; text-align: justify; }
    .services-grid { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) and (min-width: 951px) {
    .main-nav { gap: 8px; }
    .main-nav a { padding: 8px 12px; font-size: 0.9rem; }
    .search-form input:focus { width: 130px; }
}

@media (max-width: 950px) {
    .nav-container { flex-direction: row; }
    .hamburger { display: block; }
    
    /* Ensure mobile menu matches theme background */
    .main-nav {
        display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%;
        background-color: var(--bg-surface); padding: 0 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 1000;
        gap: 10px; max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-8px);
        transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease, background-color 0.3s ease;
        pointer-events: none;
    }

    .main-nav.active-menu {
        max-height: 1200px !important; 
        overflow-y: auto !important;
        opacity: 1; transform: translateY(0); padding: 20px; pointer-events: all;
    }

    .main-nav a, .search-form {
        text-align: center; width: 100%; opacity: 0; transform: translateY(-6px);
        transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.3s ease, color 0.3s ease;
    }

    .search-form { margin-left: 0 !important; margin-top: 10px; }
    .search-form input { width: 100%; }
    .search-form input:focus { width: 100%; }

    /* Mobile Live Search Dropdown Embed Fix */
    .main-nav .search-wrapper .search-dropdown {
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
        margin-top: 10px !important;
        box-shadow: none !important;
        border: 1px solid var(--border-subtle) !important;
        border-radius: 8px !important;
        background-color: var(--bg-main) !important;
        
        max-height: 280px !important; 
        overflow-y: auto !important; 
        -webkit-overflow-scrolling: touch; 
    }

    .main-nav .search-wrapper .search-dropdown a.search-dropdown-item {
        opacity: 1 !important;
        transform: none !important;
        transition: background-color 0.2s; 
    }

    .main-nav.active-menu a:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
    .main-nav.active-menu a:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.10s; }
    .main-nav.active-menu a:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
    .main-nav.active-menu a:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.20s; }
    .main-nav.active-menu a:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }
    .main-nav.active-menu a:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 0.30s; } 
    .main-nav.active-menu .search-form { opacity: 1; transform: translateY(0); transition-delay: 0.35s; } 
}

@media (max-width: 768px) {
    .footer-content { flex-direction: column; gap: 20px; text-align: center; }
    .hero h1 { font-size: 2.2rem; }
}

/* --- COOKIE CONSENT BANNER --- */
#cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 9999; background: #111; color: #eee; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: 0 -4px 20px rgba(0,0,0,0.25); transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
#cookie-banner.cookie-visible { transform: translateY(0); }
#cookie-banner p { margin: 0; font-size: 0.88rem; line-height: 1.5; flex: 1; min-width: 200px; }
#cookie-banner p a { color: #a8c48a; text-decoration: underline; }
#cookie-banner p a:hover { color: #fff; }
.cookie-buttons { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { padding: 9px 20px; border-radius: 30px; font-size: 0.85rem; font-weight: 600; font-family: inherit; cursor: pointer; border: none; transition: all 0.2s ease; }
.cookie-btn-accept { background: var(--primary-green); color: #fff; }
.cookie-btn-accept:hover { background: #3d5630; }
.cookie-btn-decline { background: transparent; color: #aaa; border: 1px solid #444; }
.cookie-btn-decline:hover { color: #fff; border-color: #888; }
@media (max-width: 600px) { #cookie-banner { flex-direction: column; align-items: flex-start; padding: 16px 18px; } .cookie-buttons { width: 100%; } .cookie-btn { flex: 1; text-align: center; } }