html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

:root {
    --primary-color: #1e3d2f; /* Deep Forest Green */
    --secondary-color: #f9f8f6; /* Off-white/Cream */
    --accent-color: #7a2e36; /* Heritage Maroon */
    --dark-overlay: rgba(30, 61, 47, 0.3); /* Default light overlay for Home */
}

/* --- Base/Utility Styles --- */

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

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

/* --- Navbar Styling --- */

.navbar {
    background-color: var(--primary-color);
    border-bottom: 5px solid rgba(122, 46, 54, 0.8);
    padding-top: 10px;
    padding-bottom: 10px;
}

.navbar-brand-img {
    height: 120px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

    .navbar-nav .nav-link.active,
    .navbar-nav .nav-link:hover {
        color: var(--secondary-color) !important;
        border-bottom: 2px solid var(--accent-color);
    }

/* --- Video Hero Sections --- */

.video-hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background: #000;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-overlay);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
}

.hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

    .btn-primary:hover {
        background-color: #5c2329;
        border-color: #5c2329;
    }

.video-hero-section .btn-primary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

    .video-hero-section .btn-primary:hover {
        background-color: white;
        color: black;
        border-color: white;
        transform: translateY(-2px);
    }

.no-video .video-background {
    background: url('/images/background-fallback.jpg') no-repeat center center;
    background-size: cover;
}

    .no-video .video-background video {
        display: none;
    }

/* --- Internal Page Headers (Residential/Commercial) --- */

.page-masthead {
    position: relative;
    height: 100vh; /* This forces full screen height */
    min-height: 600px; /* Ensures it doesn't get too small on short windows */
    display: flex;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

/* Update the mobile media query to match Index mobile height */
@media (max-width: 768px) {
    .page-masthead {
        /* Increased from 50vh to 80vh */
        height: 80vh;
        min-height: 500px;
        padding-top: 120px;
        padding-bottom: 80px;
    }
}

.masthead-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-overlay);
    z-index: 1;
}

.masthead-content {
    position: relative;
    z-index: 2;
    color: white;
}

.masthead-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem; /* Increased slightly to match the larger banner */
    font-weight: 700;
    text-transform: uppercase;
}

.masthead-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 1rem;
}

/* Ensure mobile resizing adjusts gracefully */
@media (max-width: 768px) {
    .page-masthead {
        height: 50vh; /* Slightly shorter on mobile */
        min-height: 400px;
        padding-top: 120px;
        padding-bottom: 80px;
    }
}

/* --- Section Content Styling --- */
.content-section {
    padding: 80px 0;
}

.content-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* --- Footer Styling --- */

.footer {
    background-color: var(--primary-color);
    color: #e6e6e6;
    border-top: 5px solid var(--accent-color); /* The "red line" */
    padding-top: 40px; /* Adds the requested space below the line */
}

.footer-section {
    margin-bottom: 30px;
}

.footer-title {
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-links {
    list-style: none;
    padding: 0;
}

    .footer-links li a {
        color: #ccc;
        text-decoration: none;
        line-height: 2.2;
        transition: color 0.3s ease;
    }

        .footer-links li a:hover {
            color: var(--accent-color);
        }

.contact-info p {
    margin-bottom: 10px;
}

.contact-info i {
    color: var(--accent-color);
    margin-right: 10px;
    width: 15px;
}

/* Email link styles */
.contact-email a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

    .contact-email a:hover {
        color: #5c2329;
        text-decoration: underline;
    }

/* Footer email */
.footer-email {
    color: #ccc;
    text-decoration: none;
    font-weight: 600;
}

    .footer-email:hover {
        color: var(--accent-color);
        text-decoration: underline;
    }

.social-icons a {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

    .social-icons a:hover {
        color: var(--accent-color);
    }

.footer-divider {
    border-top: 1px solid #333;
    margin-top: 20px;
    margin-bottom: 20px;
}

.copyright, .privacy-link, .terms-link {
    color: #aaa;
    text-decoration: none;
}

    .privacy-link:hover, .terms-link:hover {
        color: var(--accent-color);
    }

.separator {
    color: #aaa;
    margin: 0 5px;
}

/* --- Responsive Adjustments --- */

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .masthead-title {
        font-size: 2.5rem;
    }

    .masthead-subtitle {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .video-hero-section {
        height: 80vh;
        min-height: 500px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-content .col-lg-8 {
        padding: 0 20px;
    }

    .page-masthead {
        padding-top: 120px;
        padding-bottom: 80px;
        min-height: 300px;
    }
}

@media (max-width: 576px) {
    .video-hero-section {
        height: 70vh;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .btn-primary {
        padding: 10px 30px;
        font-size: 1rem;
    }

    .masthead-title {
        font-size: 2rem;
    }
}

/* --- Stats Section --- */
.stats-section {
    background-color: #f8f9fa;
    padding: 80px 0;
    text-align: center;
}

.stat-item {
    padding: 20px;
    transition: transform 0.3s ease;
}

    .stat-item:hover {
        transform: translateY(-5px);
    }

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: block;
}

.stat-label {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background-color: #fff;
}

    .card-body .btn {
        margin-top: auto;
        align-self: center;
        min-width: 150px;
    }

main {
    margin-bottom: 5rem;
}

.text-primary {
    color: var(--accent-color) !important;
}

/* --- Internal Header Specifics --- */

.mainpage-header {
    /* Adjusted from 0.8 to 0.4 to allow video visibility */
    --dark-overlay: rgba(30, 61, 47, 0.4);
}

    .mainpage-header .masthead-title {
        color: var(--secondary-color);
        font-weight: 700;
    }

    .mainpage-header .masthead-subtitle {
        color: rgba(249, 248, 246, 0.9);
        font-weight: 400;
    }

/* Removed the ::after glow to ensure a completely solid background */
.brand-gradient-bg::after {
    display: none;
}

.main-content {
    padding-top: 105px; /* Accounting for the 5px border */
    min-height: calc(100vh - 100px);
}

.client-logo-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 2rem;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

    .client-logo-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        border-color: var(--accent-color);
    }
