/* =========================================
   1. GLOBAL RESET & VARIABLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-green: #2e7d32;
    --secondary-green: #4caf50;
    --dark-text: #333;
    --light-text: #f4f4f4;
    --bg-light: #f9fbf9;
    
    --top-bar-height: 45px;
    
    /* DYNAMIC VARIABLES (Controlled by JS) */
    /* We start at the full expanded sizes */
    --nav-current-height: 110px; 
    --logo-current-height: 90px;
}

html {
    scroll-behavior: smooth;
    /* FIX: This now uses the dynamic height variable. 
       Wherever the nav is sized at the moment, the link will land below it. */
    scroll-padding-top: var(--nav-current-height);
}

body {
    line-height: 1.6;
    color: var(--dark-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. UTILITY CLASSES
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

/* Small buffer for services */
.service-block {
    scroll-margin-top: 20px; 
}

/* =========================================
   3. BUTTON STYLES
   ========================================= */
.btn-primary {
    background-color: var(--primary-green);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1b5e20;
}

.btn-secondary {
    background-color: white;
    color: var(--primary-green);
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: 2px solid white;
    transition: 0.3s;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: transparent;
    color: white;
}

.btn-nav {
    background-color: var(--secondary-green);
    color: white !important;
    padding: 8px 16px;
    border-radius: 4px;
    height: auto !important;
    display: inline-block !important;
    line-height: normal;
}

/* =========================================
   4. HEADER WRAPPER & TOP BAR
   ========================================= */
#global-header {
    display: contents; /* Allows Navbar to stick to body */
}

.top-bar {
    background-color: #1b5e20;
    color: white;
    padding: 10px 0;
    font-size: 0.9rem;
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    position: relative; 
    z-index: 1001; 
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.contact-info span {
    margin-right: 20px;
}

/* =========================================
   5. NAVIGATION BAR (LINEAR SHRINK)
   ========================================= */
.navbar {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; 
    top: 0;
    z-index: 1000;
    width: 100%;
    /* NOTE: No transition on height/padding to prevent jitter with JS scroll logic */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    
    /* HERE IS THE MAGIC: The height is set by the variable */
    height: var(--nav-current-height);
    
    padding: 0 20px;
}

/* LOGO STYLES */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    /* Height set by variable */
    height: var(--logo-current-height);
    
    width: auto;
}

/* NAV MENU LINKS */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: stretch;
    height: 100%;
}

.nav-menu li {
    margin-left: 20px;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    transition: color 0.3s; /* Only transition color */
    font-size: 1rem;
    display: flex;
    align-items: center;
    height: 100%; 
}

.nav-menu a:hover {
    color: var(--primary-green);
}

/* --- DROPDOWN STYLING --- */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 280px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1;
    top: 100%; 
    left: 0;
    border-top: 3px solid var(--primary-green);
}

.dropdown-content li {
    display: block;
    height: auto;
}

.dropdown-content a {
    padding: 12px 16px;
    display: block;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    height: auto;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* =========================================
   6. HERO SECTIONS
   ========================================= */
.hero {
    background: url('https://images.unsplash.com/photo-1542601906990-b4d3fb778b09?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') no-repeat center center/cover;
    height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
}

.page-header {
    background-color: var(--primary-green);
    color: white;
    padding: 10px 0;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* =========================================
   7. TEXT & CONTENT STYLING
   ========================================= */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-green);
    margin-bottom: 15px;
}

h3 {
    color: var(--primary-green);
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
}

.service-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 30px;
    border-left: 5px solid var(--primary-green);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 40px 0;
    margin-top: auto;
}

/* =========================================
   9. MOBILE RESPONSIVENESS
   ========================================= */
.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-text);
    margin: 5px auto;
}

@media (max-width: 768px) {
    .navbar .container {
        height: auto;
        padding: 10px 20px;
        align-items: center;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 140px; 
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: left;
        transition: 0.3s;
        box-shadow: 0 5px 5px rgba(0,0,0,0.1);
        padding-bottom: 20px;
        height: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 0;
        width: 100%;
        display: block;
    }

    .nav-menu a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        height: auto;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        background-color: #f9f9f9;
        display: none;
        border-top: none;
    }
    
    .dropdown:hover .dropdown-content {
        display: block;
    }

    .menu-toggle {
        display: block;
    }
    
    .logo img {
        height: 70px;
    }
}