/* --- 1. STYLING FOR THE BANNER IMAGE (Corrected) --- */
#site-header {
       background-image: url('Hartland-tree-header.jpg'); 
       background-size: cover; 
    
    /* Center the image if the header size changes */
    background-position: center center; 
    
    /* Prevent the image from tiling */
    background-repeat: no-repeat;
    
    /* Added for responsiveness: height relative to width */
    height: 0; 
    padding-top: 45%; 

    /* Ensure text (like the navigation) is readable over the image */
    color: #ffffff; 
    
    /* No margin so the nav sits right below it */
    margin-bottom: 0; 
}

/* --- DESKTOP/TABLET MENU STYLING (Applies to all screen sizes first) --- */

nav ul {
    list-style: none; /* Remove list bullets */
    padding: 0;
    margin: 0;
    text-align: center; /* Center the entire menu */
}

nav li {
    display: inline-block; /* Makes the main menu items line up horizontally */
    position: relative; /* Essential for positioning the dropdown content */
    margin: 0; /* Add horizontal spacing between main links */
}
nav li a {
    padding: 10px 10px; /* Add desired padding for spacing */
}


/* Hide the dropdown content by default on ALL screen sizes */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; /* Position it right below the main link */
    left: 0;
    z-index: 10; /* Ensure it appears over other content */
    min-width: 200px; /* Give the dropdown a minimum width */
    text-align: left; /* Align text inside the dropdown */
    background: #556B2F; /* Dark Olive Green background */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* CSS for Tap functionality (This opens the menu when JS adds the 'active' class) */
.dropdown.active .dropdown-content {
    display: block !important; 
}

/* Show the dropdown content on hover for desktop/tablet */

/* Style links inside the dropdown */
.dropdown-content li {
    display: block; /* Make links in the dropdown stack vertically */
    margin: 0;
}

/* Style links inside the dropdown */
.dropdown-content a {
    display: block; /* Makes the link take up full width */
    padding: 10px 15px; 
    text-align: left; /* Ensures wrapped text lines up neatly on the left */
}
/* --- Styles that apply to ALL links and lists inside the menu --- */
/* --- MOBILE DROPDOWN STYLING (for screens up to 600px wide) --- */
@media screen and (max-width: 600px) {
    /* --- Overrides for Desktop/Horizontal Styles --- */
    nav li {
        display: block; /* Forces the main list items to stack vertically */
        margin: 0;
        border-bottom: 1px solid #7C8F6E; /* Adds a separator line */
    }
    
    /* Ensures the main menu links are full width */
    nav a {
        display: block; 
        width: 100%;   
        padding: 20px 0;
        font-size: 1.2em;
        text-align: center;
    }
    /* --- Accordion Functionality --- */
    .dropdown-content {
        position: static; /* Allows the content to flow naturally, not float */
        background: #4A5A39; /* Slightly darker background for contrast */
        box-shadow: none;
        width: 100%;
        min-width: auto;
    }
    
    /* Ensures the sub-links are indented and left-aligned */
    .dropdown-content a {
        text-align: left;
        padding-left: 20px !important;
        background-color: #6B7C4F;
        border-bottom: 1px solid #7C8F6E;
    }
    
    /* Ensure the sub-header is styled */
    .dropdown-content .sub-header {
        background: #3A472C;
        font-size: 1.1em;
        font-style: italic;
        font-weight: bold;
        color: #C1FF72 !important; 
        border-bottom: 1px solid #7C8F6E;
    }
}

/* --- BASE PAGE STYLING --- */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}
.container {
    width: 85%;
    max-width: 1000px;
    margin: auto;
    overflow: hidden;
    padding: 20px 0;
}
nav {
    background: #556B2F; /* Dark Olive Green */
    color: #fff;
    padding: 10px 0;
    text-align: center;
}
nav a {
    color: #fff;
    text-decoration: none;
    padding: 0 15px;
    font-weight: bold;
}
nav a:hover {
    color: #7CFC00;
}
section {
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h2 {
    color: #556B2F; /* Dark Olive Green */
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    text-align: center;
    margin-top: 0;
}
h3 {
    color: #228B22;
    margin-top: 25px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 5px;
}
.service-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}
.service-item .icon {
    font-size: 2em;
    margin-right: 15px;
    color: #FF4500; /* Orange Accent */
}
/* Targets all <a> tags that are descendants of a <td> in a table */
td a {
    color: #228B22; /* Forest Green */
    text-decoration: none; /* Removes the underline */
    font-weight: bold;
    border-bottom: 1px dashed #228B22; /* Adds a subtle dashed underline */
}
td a:hover {
    color: #38AA38; /* Slightly lighter green on hover */
    border-bottom: 1px solid #38AA38; /* Changes to a solid line on hover */
}
/* Ensure no icon is showing if a previous icon rule exists */
td a::before,
td a::after {
    content: none !important;
}
 
/* --- FOOTER MENU STYLING --- */

/* Styling the container for the article links (Merged and clean) */
.footer-menu-container {
    padding: 20px 0;
    /* Adding a light background color for contrast */
    background-color: #f4f4f4; 
    border-top: 2px solid #ddd; 
}

/* Hiding the header text */
.footer-menu-container h3 {
    display: none; 
}

/* Use Flexbox to align list items horizontally and centrally (Merged and clean) */
.footer-article-list {
    list-style: none; 
    padding: 0 10px; 
    margin: 0 auto; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 10px; 
    max-width: 1200px; 
}

/* Styling for links inside the Our Core Services list */
.container li a {
    color: #228B22; /* Forest Green base color */
    text-decoration: none; /* Removes the underline */
    font-weight: bold;
    border-bottom: 1px dashed #228B22; /* Adds a subtle dashed underline */
}

/* Hover effect for Core Services links */
.container li a:hover {
    color: #38AA38; /* Lighter green on hover */
    border-bottom: 1px solid #38AA38; /* Solid line on hover */
}

/* Styling the individual list items/links (Includes scaling fix) */
.footer-article-list li {
    max-width: 300px; /* Keep the max width on desktop */
    min-width: 250px; /* Ensure they have a minimum size on desktop/tablet */
    width: 100%; /* Default to 100% width */
    
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px; 
    background-color: #fff;
    overflow: hidden; 
}

/* --- CRITICAL: STYLES FOR THE LINK ITSELF (The missing part!) --- */
.footer-article-list a {
    display: block; /* Makes the entire <li> area clickable */
    text-decoration: none; /* Removes the underline */
    color: #212529; /* Sets a custom, dark text color */
    font-size: 0.9em;
    padding: 10px 12px;
    height: 100%;
    /* Transition for smooth hover effect */
    transition: background-color 0.3s ease, border-color 0.3s ease; 
}

/* --- Hover Element --- */
.footer-article-list a:hover {
    background-color: #e0f0ff; /* Light blue background on hover */
    color: #007bff; /* Darker blue text color on hover */
    border-color: #007bff; /* Blue border on hover */
    text-decoration: none; 
}


/* --- ADJUSTED Media Query for Mobile --- */
@media (max-width: 768px) {
    .footer-article-list {
        flex-direction: column; 
        align-items: center; 
        gap: 5px;
    }
    .footer-article-list li {
        width: 90%; 
        min-width: unset; 
        margin: 0 10px; 
    }
}

/* --- All-Screen Styles (outside any media query) --- */

/* 2. Wrapped Text Alignment Fix (Applies to all screens, but is fine here) */
.dropdown-content a {
    display: block;
    text-align: left !important;
}

/* --- DESKTOP/TABLET OVERRIDE (for screens > 600px) --- */
@media screen and (min-width: 601px) {
    
    /* 1. Container Centering Fix */
    .dropdown-content {
        left: 50%;
        transform: translateX(-50%);
    }

    /* 2. HOVER FIX: Only allow the menu to appear on hover for desktop */
    /* This rule assumes you are NOT using JavaScript for hover on desktop */
    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* --- FOOTER STYLING --- */

footer {
    /* Set light gray background and dark text for contrast */
    background-color: #f4f4f4; 
    color: #333; 
    padding: 30px 0 0; 
    font-family: Arial, sans-serif; 
}

.footer-container {
    /* Centers content and uses Flexbox for columns */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 30px; 
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between; 
}

.footer-column {
    /* Base column width */
    width: 23%; /* Slightly reduced to account for padding/margin */
    min-width: 180px; 
    padding: 15px 10px;
}

/* --- Specific Element Styling --- */

.footer-logo {
    max-width: 150px; 
    height: auto;
    margin-bottom: 10px;
}

/* --- PRIMARY CALL-TO-ACTION BUTTON STYLES (Applies to Call Now button) --- */
/* Container to center inline/inline-block elements */
.center-cta-container {
    text-align: center;
}
.cta-button {
    display: inline-block;
    background-color: #228B22; 
    color: #fff;
    padding: 8px 12px;
    margin-top: 10px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    /* Added transition for smooth hover effect */
    transition: background-color 0.3s ease; 
}

.cta-button:hover {
    background-color: #1a6f1a; 
}

.cta-button.call-button {
    /* Extra space below the Call Now button */
    margin-bottom: 10px; 
}

/* --- SECONDARY ESTIMATE LINK STYLES (The required subtlety fix) --- */
.secondary-cta-button {
    /* Revert button visuals to be a simple link */
    display: inline;
    background: none;
    color: #556B2F; /* Dark Olive Green */
    padding: 0; 
    margin: 5px 0 0;
    text-decoration: underline;
    font-size: 0.9em;
    font-weight: normal; 
}

.secondary-cta-button:hover {
    background: none;
    color: #228B22; /* Forest Green on hover */
    text-decoration: underline;
}

/* Links and Lists */
.footer-column h4 {
    color: #556B2F; /* Dark Olive Green */
    font-size: 1em;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}
.footer-column ul {
    list-style: none;
    padding: 0;
}
.footer-column li {
    margin-bottom: 4px;
}
.footer-column a {
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
}
.footer-column a:hover {
    color: #228B22;
    text-decoration: underline;
}

/* Social Icons */
.social-icons img {
    width: 25px;
    height: 25px;
    margin-right: 8px;
    opacity: 0.8;
}
.social-icons img:hover {
    opacity: 1;
}
/* This rule targets all list items within the common footer-links columns. */
/* If the Services and Company columns have <ul>s that wrap the <li>s, this is the correct selector. */
.footer-links ul li {
    font-size: 14px; /* <--- FIND THE EXACT FONT SIZE USED FOR YOUR LINKS AND PUT IT HERE */
    line-height: 1.5; 
}

/* This is a general targeting rule for the list items that works well: */
.footer-links li {
    font-size: 14px; /* <--- Put the correct size here */
    list-style: none; /* Removes bullets, for a clean look */
    padding-left: 0;
}

/* --- Bottom Bar: Legal & Copyright --- */
.footer-bottom-bar {
    background-color: #dedede; /* Slightly darker gray */
    padding: 10px 20px;
    text-align: center;
    font-size: 0.8em;
    border-top: 1px solid #ccc;
}
.legal-links a {
    color: #333;
    text-decoration: none;
    margin: 0 5px;
}
.legal-links a:hover {
    text-decoration: underline;
    color: #228B22;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column; 
        padding-bottom: 0;
    }
    .footer-column {
        width: 100%; 
        min-width: auto;
        padding: 15px 0;
        text-align: center; 
        border-bottom: 1px solid #ddd;
    }
    .footer-column h4 {
        border-bottom: none;
    }
    .footer-contact {
        order: -1; /* Puts the contact info at the very top on mobile */
    }
    .social-icons {
        margin-top: 10px;
    }
}