/* ==========================================================================
   1. Base Reset & Root Variables
   ========================================================================== */
:root {
    --primary-color: #1a252c;   /* Dark Slate */
    --secondary-color: #f2a900; /* Amber/Orange Accent */
    --bg-dark-heavy: #0b1114;   /* Midnight Matte Background */
    --bg-black: #000000;        /* Deep Black Section Fill */
    --text-color: #ffffff;
    --text-muted: #94a3b8;      /* Clean Slate Gray for Readability Copy */
    --text-light: #cbd5e1;      /* Crisp Off-White for Bullets/Paragraphs */
    --white: #ffffff;
    --border-dark: #2a363f;     /* Subtle Structural Component Outlines */
    --font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-stack);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-black); /* Sets a consistent site fallback */
}

/* Global Utility for Dark Mode Core Pages */
.dark-theme {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ==========================================================================
   2. Navigation System (Shared Sitewide)
   ========================================================================== */
header {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo img {
    height: 55px;
    width: auto;
    min-width: 168px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center; /* Aligns textual links and dropdown box wrapper perfectly */
    gap: 20px;           /* Replaced rigid margins with uniform item distribution spacing */
    list-style: none;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* --- Navigation Interactive States --- */

/* Normal link hover + active tab coloring */
.nav-links a:hover, 
.nav-links a.active,
.dropdown-trigger.active {
    color: var(--secondary-color) !important;
}

/* Prevent sticky mobile focus colors */
.nav-links a:focus,
.dropdown-trigger:focus {
    color: inherit;
}

/* Ensure dropdown trigger functions as a flex layout element */
.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

/* Base style for the chevron */
.dropdown-trigger .chevron {
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
    display: inline-block;
    color: inherit; /* Chevron naturally mirrors the color of the text label */
    transition: transform 0.2s ease;
}

/* --- Desktop Dropdown Container Structure --- */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #11171c;
    min-width: 180px;
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 8px 0;
    z-index: 1000;
    margin-top: 10px;
}

/* Hover bridge wrapper gap */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
}

.dropdown-menu a {
    color: var(--text-muted);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: #1a232a;
    color: var(--secondary-color) !important;
}

/* Desktop Hover Triggers */
.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-dropdown:hover .dropdown-trigger {
    color: var(--secondary-color) !important;
}

.nav-dropdown:hover .dropdown-trigger .chevron {
    transform: rotate(180deg);
    color: var(--secondary-color);
}

/* Hamburger Display Rule */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
}

/* ==========================================================================
   Responsive Viewport Overrides (Tightly Controlled Mobile Media Block)
   ========================================================================== */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    /* Reset desktop hover reveal events on mobile */
    .nav-dropdown:hover .dropdown-menu {
        display: none !important;
    }

    /* Strict Mobile Dropdown Submenu Viewport Constraints */
    .nav-links .nav-dropdown .dropdown-menu {
        display: none !important;
        visibility: hidden;
        opacity: 0;
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        box-shadow: none;
        background-color: rgba(26, 37, 44, 0.4);
        border: none;
        padding-left: 15px;
        margin-top: 5px;
        border-radius: 4px;
    }

    /* Display explicitly when utility toggle class is present */
    .nav-links .nav-dropdown.mobile-open .dropdown-menu {
        display: block !important;
        visibility: visible;
        opacity: 1;
    }

    /* Force text and chevron to turn secondary color when open */
    .nav-links .nav-dropdown.mobile-open .dropdown-trigger,
    .nav-links .nav-dropdown.mobile-open .dropdown-trigger .chevron {
        color: var(--secondary-color) !important;
    }

    /* Rotate chevron upside down when open */
    .nav-links .nav-dropdown.mobile-open .dropdown-trigger .chevron {
        transform: rotate(180deg) !important;
    }

    .nav-links .nav-dropdown .dropdown-trigger,
    .nav-links .nav-dropdown .dropdown-trigger .chevron {
        color: var(--white) !important;
        transform: rotate(0deg) !important;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    /* Keep your existing .mobile-open rules right below it so they take priority ONLY when open */
    .nav-links .nav-dropdown.mobile-open .dropdown-menu {
        display: block !important;
        visibility: visible;
        opacity: 1;
    }

    .nav-links .nav-dropdown.mobile-open .dropdown-trigger,
    .nav-links .nav-dropdown.mobile-open .dropdown-trigger .chevron {
        color: var(--secondary-color) !important;
    }

    .nav-links .nav-dropdown.mobile-open .dropdown-trigger .chevron {
        transform: rotate(180deg) !important;
    }
}

/* ==========================================================================
   3. Global Page Layout Headers & Hero Sections
   ========================================================================== */
/* Video Background Hero (Home Page Specific) */
.hero {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0 20px;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 37, 44, 0.8);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Standardized Inner Page Hero (Services, Contact, etc.) */
.page-hero {
    background-color: var(--bg-dark-heavy);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-dark);
}

.section-label {
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.page-hero h1 {
    font-size: 42px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.page-hero p {
    max-width: 600px;
    margin: 0 auto;
    font-size: 18px;
    color: var(--text-muted);
}

/* ==========================================================================
   4. Buttons & Global Structural Layouts
   ========================================================================== */
section {
    padding: 80px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    position: relative;
    text-transform: uppercase;
    color: var(--white); /* Updated globally to match dark aesthetic */
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 10px auto 0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

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

.btn-secondary {
    border: 2px solid var(--white);
    color: var(--white);
    margin-left: 15px;
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* Base structural layout grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ==========================================================================
   5. Dark Overlay Showcase Cards Component
   ========================================================================== */
.card {
    position: relative;
    height: 350px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

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

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom, 
        rgba(26, 37, 44, 0.2) 0%,   
        rgba(26, 37, 44, 0.6) 50%,  
        var(--primary-color) 100%   
    );
    z-index: 2;
}

.card-content {
    position: relative;
    z-index: 3;
    width: 100%;
    color: var(--white);
}

.card h3 {
    margin-bottom: 10px;
    font-size: 22px;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card p {
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.95;
}

/* ==========================================================================
   6. Alternating Service Details Component
   ========================================================================== */
.services-detailed-section {
    padding: 80px 20px;
    background-color: var(--primary-color);
}

.service-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.service-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.service-media img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-top: 3px solid var(--secondary-color);
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.service-text h2 {
    font-size: 28px;
    text-transform: uppercase;
    color: var(--white);
}

.accent-divider {
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 10px 0 20px;
}

.service-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.service-bullets {
    color: var(--text-light);
    padding-left: 1.25rem;
    line-height: 2;
}

.service-cta-wrapper {
    margin-top: 2rem;
}

.dark-separator {
    border: 0;
    border-top: 1px solid var(--border-dark);
}

/* ==========================================================================
   7. Heavy Action Bottom Banners & Callouts
   ========================================================================== */
.bottom-cta-banner {
    background: var(--bg-dark-heavy);
    padding: 4rem 20px;
    text-align: center;
    border-top: 4px solid var(--secondary-color);
}

.bottom-cta-banner h2 {
    color: var(--white);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.bottom-cta-banner p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons-container {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-phone-action {
    background: var(--secondary-color);
    color: var(--primary-color);
    font-weight: bold;
    padding: 12px 30px;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: 4px;
}

.btn-phone-action:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* ==========================================================================
   8. Lead Intake Contact Forms
   ========================================================================== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info h3 {
    font-size: 24px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.contact-info p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-light);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--white);
    font-family: var(--font-stack);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* ==========================================================================
   9. Footer Systems
   ========================================================================== */
footer {
    background-color: #05080a;
    color: var(--text-muted);
    padding: 40px 20px;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid var(--border-dark);
}

/* ==========================================================================
   10. Responsive Design Media Queries
   ========================================================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        padding: 20px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 15px 0;
        text-align: center;
    }
    
    .hamburger {
        display: block;
    }
    
    /* Layout Unstacking Overrides */
    .grid-2, 
    .grid-3, 
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .service-detail-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    /* Ensures media images gracefully layer chronological order on mobile screens */
    .service-detail-row:nth-child(even) {
        flex-direction: column-reverse !important;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .btn-secondary {
        margin-left: 0;
        margin-top: 15px;

    }
}

/* ==========================================================================
   11. Dynamic Project Gallery & Lightbox Architecture
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 4px;
    border-top: 3px solid var(--border-dark);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    height: 250px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover {
    border-color: var(--secondary-color);
}

/* Lightbox Modal Overlay Backdrop */
.lightbox {
    display: none; /* Hidden strictly by default until activated by JS */
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 8, 10, 0.95);
    align-items: center;
    justify-content: center;
}

/* Modal Open state trigger helper class */
.lightbox.active {
    display: flex;
}

#lightboxImg {
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Action Control Mechanics */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--white);
    font-size: 40px;
    background: none;
    border: none;
    cursor: pointer;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 37, 44, 0.6);
    color: var(--white);
    border: 1px solid var(--border-dark);
    font-size: 24px;
    padding: 12px 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.lightbox-arrow:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.left-arrow { left: 30px; }
.right-arrow { right: 30px; }

@media (max-width: 768px) {
    .lightbox-arrow {
        padding: 8px 14px;
        font-size: 18px;
    }
    .left-arrow { left: 10px; }
    .right-arrow { right: 10px; }
}

/* ==========================================================================
   12. Multi-Column Footer Grid Architecture
   ========================================================================== */
.main-site-footer {
    background-color: #05080a; /* Ultra-dark backdrop to contrast with your sections */
    border-top: 1px solid var(--border-dark);
    padding: 60px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;     
    gap: 15px;
}

.footer-logo-link img {
    height: 45px;
    width: auto;
    object-fit: contain;
    display: inline-block;
}

.footer-brand p {
    line-height: 1.6;
    max-width: 400px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--secondary-color); /* Highlight with your brand secondary color */
}

/* Contact Details Override Link Coloration */
.footer-col p a {
    color: var(--white);
    font-weight: 500;
}

/* Footer Bottom Base Ribbon */
.footer-bottom {
    border-top: 1px solid var(--border-dark);
    padding: 20px 0;
    background-color: #020405;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    margin: 0;
    color: #526675;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    .footer-brand {
        grid-column: span 2;
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .footer-brand {
        grid-column: span 1;
    }
}

/* ==========================================================================
   13. Homepage Services Preview Grid Layout
   ========================================================================== */
.services-preview-section {
    background-color: #0b0f12; /* Keeps background cohesive with home design flow */
    padding: 80px 0;
    border-bottom: 1px solid var(--border-dark);
}

/* Centralized Header Typography Configuration */
.section-header-centered {
    text-align: center;
    margin-bottom: 50px;
}

.section-header-centered h2 {
    color: var(--white);
    font-size: 32px;
    text-transform: uppercase;
    margin-top: 10px;
    letter-spacing: 1px;
}

.accent-divider-centered {
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 15px auto 0 auto;
    border-radius: 2px;
}

/* Five-Column Responsive Flex-Grid Grid Box */
.services-preview-grid {
    display: grid;
    /* Lowers the threshold to 200px so 5 columns fit easily on a standard desktop screen */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; /* Snugs the gap down slightly to grant the cards more breathing room */
    margin-bottom: 45px;
}

.service-preview-card {
    background-color: #11171c;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 15px; /* Reduced from 25px to keep card heights elegant when slim */
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card-image-box {
    width: 100%;
    height: 140px; /* Reduced from 180px so the layout doesn't look like a tall vertical strip */
    overflow: hidden;
    border-radius: 2px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-dark);
}

.service-preview-card h3 {
    color: var(--white);
    font-size: 16px; /* Slightly scaled down text so headings don't wrap aggressively */
    font-weight: 600;
    margin-bottom: 10px;
}

.service-preview-card p {
    color: var(--text-muted);
    font-size: 13px; /* Clean, highly readable body size for tighter rows */
    line-height: 1.5;
}

.service-preview-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}

.card-image-box {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 2px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-dark);
}

.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.service-preview-card:hover .card-image-box img {
    transform: scale(1.04);
}

.service-preview-card h3 {
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.service-preview-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Center Bottom Link Layout Container */
.center-action-wrapper {
    text-align: center;
}

/* Mobile Layout Transformations */
@media (max-width: 992px) {
    .services-preview-grid {
        grid-template-columns: 1fr; /* Shifts into a crisp uniform list view */
        gap: 25px;
    }
    
    .service-preview-card {
        max-width: 500px;
        margin: 0 auto; /* Keeps card blocks perfectly balanced centered */
    }
}

/* Subpage Banner Typography Framework */
.subpage-hero {
    background-color: #11171c; /* Structural tone slightly lighter than absolute dark background */
    background-image: linear-gradient(rgba(11, 15, 18, 0.8), rgba(11, 15, 18, 0.8)), url('assets/images/fencing-hero-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 100px 20px;
    text-align: center;
}

.subpage-hero h1 {
    color: var(--white);
    font-size: 42px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.subpage-hero p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 600px;
    margin: 20px auto 0 auto;
    line-height: 1.6;
}