/* --- Global Styles & Variables --- */
:root {
    --primary-color: #2c3e50; /* Navy blue from logo */
    --secondary-color: #8B4513; /* Brown from logo */
    --accent-color: #f5f2e8; /* Cream from logo */
    --dark-grey: #333333;
    --light-grey: #f5f2e8; /* Using cream instead of light grey */
    --white-color: #ffffff;
    --font-family-headings: 'Montserrat', sans-serif;
    --font-family-body: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-body);
    line-height: 1.6;
    color: var(--dark-grey);
    background-color: var(--white-color);
}

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

h1, h2, h3 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; color: var(--primary-color); }
h3 { font-size: 1.5rem; color: var(--dark-grey); }

p {
    margin-bottom: 1rem;
}

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

/* --- Header & Navigation --- */
.header {
    background: var(--white-color);
    box-shadow: 0 2px 5px rgba(44, 62, 80, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 60px;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 2rem;
}

.main-nav a {
    font-weight: bold;
    color: var(--dark-grey);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.8)), url('https://source.unsplash.com/random/1600x900/?tools,house') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 6rem 0;
}

.hero h1 {
    font-size: 3.5rem;
}

.hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.cta-button {
    background: var(--secondary-color);
    color: var(--white-color);
    padding: 1rem 2.5rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.3s;
}

.cta-button:hover {
    background-color: #a0522d; /* Lighter shade of brown */
    transform: translateY(-3px);
}

/* --- General Section Styling --- */
section {
    padding: 4rem 0;
}

section:nth-child(even) {
    background-color: var(--accent-color);
}

.about-intro h2, .services-overview h2, .why-choose-us h2 {
    text-align: center;
    margin-bottom: 3rem;
}

/* --- Services Overview Section (Home Page) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-card {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.08);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 3px solid var(--secondary-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.service-card-link:hover .service-card {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.12);
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-card p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.service-card .learn-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: bold;
    color: var(--secondary-color);
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.service-card-link:hover .learn-more {
    border-bottom-color: var(--secondary-color);
}

/* Highlight the "And Much More" card */
.service-card-highlight {
    border-top: 3px solid var(--primary-color);
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--white-color) 100%);
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    min-height: 280px;
    padding: 3rem 2rem !important;
}

.service-card-highlight h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

.service-card-highlight p {
    color: var(--dark-grey);
    font-size: 1.1rem;
    margin-bottom: 1.5rem !important;
    max-width: 90%;
    text-align: center !important;
    flex-grow: 0 !important;
}

.service-card-highlight .learn-more {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0 !important;
    text-align: center !important;
    flex-grow: 0 !important;
}

.service-card-link:hover .service-card-highlight {
    background: linear-gradient(135deg, #f0ebe1 0%, var(--accent-color) 100%);
}

.service-card-link:hover .service-card-highlight .learn-more {
    border-bottom-color: var(--primary-color);
}

/* --- Why Choose Us Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* --- Footer --- */
.footer {
    background: var(--primary-color);
    color: var(--white-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 50px;
    margin-bottom: 1rem;
}

.footer h4 {
    font-family: var(--font-family-headings);
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--accent-color);
    transition: color 0.3s;
}

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

.copyright {
    text-align: center;
    border-top: 1px solid rgba(245, 242, 232, 0.3);
    padding-top: 1rem;
    font-size: 0.9rem;
}

/* --- Page Header for Sub-pages --- */
.page-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--accent-color);
}

/* --- Services List Section (Services Page) --- */
.services-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-item {
    background-color: var(--white-color);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(44, 62, 80, 0.05);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    border-top: 3px solid var(--accent-color);
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(44, 62, 80, 0.1);
    border-top-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* --- CTA Section --- */
.cta-section {
    background-color: var(--accent-color);
    text-align: center;
}

.cta-section h2 {
    margin-bottom: 1rem;
}

/* --- Layout for Pages with Sidebars (UPDATED) --- */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default to a single column on mobile */
    gap: 3rem;
}

/* On larger screens, create the side-by-side layout */
@media (min-width: 992px) {
    .layout-grid {
        /* This is the key change: 1fr 1fr creates two equal columns */
        grid-template-columns: 1fr 1fr; 
        gap: 4rem; /* Increased the gap for better spacing */
        align-items: start; /* Aligns the top of the columns */
    }
}

.main-content h2, .main-content h3 {
    margin-top: 2rem;
}
.main-content h2:first-child, .main-content h3:first-child {
    margin-top: 0;
}

.main-content ul, .main-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.main-content ul li, .main-content ol li {
    margin-bottom: 0.5rem;
}

/* --- Sidebar Styling --- */
.sidebar-widget {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary-color);
}

.sidebar-widget h3 {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    color: var(--primary-color);
}

.sidebar-widget .checklist {
    list-style: none;
    padding-left: 0;
}
.sidebar-widget .checklist li {
    margin-bottom: 0.75rem;
}

.cta-button.full-width {
    display: block;
    text-align: center;
    width: 100%;
}

.sidebar-widget .top-margin {
    margin-top: 2rem;
}

.sidebar-links {
    list-style: none;
    padding: 0;
}
.sidebar-links li a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
    transition: color 0.3s;
    color: var(--primary-color);
}
.sidebar-links li a:hover {
    color: var(--secondary-color);
}
.sidebar-links li:last-child a {
    border-bottom: none;
}

/* --- Contact Form Styling --- */
.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family-body);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(44, 62, 80, 0.5);
}

.contact-form textarea {
    resize: vertical;
}

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 30px;
    height: 25px;
    z-index: 1001; /* Ensure it's above other elements */
}

.mobile-nav-toggle .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hamburger Icon Lines */
.mobile-nav-toggle::before,
.mobile-nav-toggle::after,
.mobile-nav-toggle span {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

.mobile-nav-toggle::before { top: 0; }
.mobile-nav-toggle span { top: 50%; transform: translateY(-50%); }
.mobile-nav-toggle::after { bottom: 0; }

/* Styles for when the menu is open (will be controlled by JS) */
.mobile-nav-toggle[aria-expanded="true"]::before {
    transform: translateY(11px) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"]::after {
    transform: translateY(-11px) rotate(-45deg);
}
.mobile-nav-toggle[aria-expanded="true"] span {
    opacity: 0;
}

/* --- Responsive Design --- */
@media (max-width: 991px) { /* Changed breakpoint to 991px to match the new layout rule */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero h1 { font-size: 2.8rem; }
    
    .mobile-nav-toggle {
        display: block; /* Show the toggle on mobile */
    }

    .main-nav {
        display: none; /* Hide the nav by default on mobile */
        position: absolute;
        top: 100%; /* Position it right below the header */
        left: 0;
        right: 0;
        background-color: var(--white-color);
        box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
    }

    .main-nav.nav-visible {
        display: block; /* Show the nav when JS adds this class */
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul li {
        margin: 0;
    }

    .main-nav a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--accent-color);
    }
    
    .main-nav a:hover, .main-nav a.active {
        background-color: var(--accent-color);
        border-bottom-color: var(--accent-color);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Housecall Pro Iframe Styling --- */
#hcp-lead-iframe {
    width: 100%;
    min-height: 800px; /* Provides ample space for the form content */
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.1);
}