/* --- AT-8 MASTER DESIGN TOKENS --- */
:root {
    --at8-blue: #1e3a8a;
    --at8-blue-light: #2563eb;
    --at8-yellow: #fbbf24;
    --at8-white: #ffffff;
    --at8-dark: #111827;
}

/* 1. ELEMENTOR CONTAINER RESET (.e-con) */
/* Removes unwanted default padding and margins from Elementor containers */
.e-con {
    --padding-inline-start: 0px !important;
    --padding-inline-end: 0px !important;
    --padding-top: 0px !important;
    --padding-bottom: 0px !important;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body {
    font-family: "gotham", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    scroll-behavior: smooth;
    padding-top: 80px; /* Offset for the fixed header */
}

/* --- MOBILE SPECIFIC ADJUSTMENTS --- */
@media (max-width: 768px) {
    body { padding-top: 70px; }
    
    /* Set font-weight 700 for extrabold text on mobile */
    .font-extrabold { font-weight: 700 !important; }

    /* Remove background highlight on tap for mobile menu button */
    #mobile-menu-button {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }

    /* Mobile Submenu Styling */
    .at8-mobile-nav .sub-menu {
        display: block !important; 
        padding-left: 1.5rem;
        margin-top: 0.5rem;
        list-style: none;
        border-left: 2px solid var(--at8-yellow);
    }

    .at8-mobile-nav .sub-menu li a {
        padding: 0.5rem 0;
        font-size: 0.75rem;
        opacity: 0.8;
        border-bottom: none !important;
        text-transform: none;
    }
}

/* --- Utilities --- */
.bg-at8-blue { background-color: var(--at8-blue); }
.text-at8-blue { color: var(--at8-blue); }
.bg-at8-yellow { background-color: var(--at8-yellow); }
.text-at8-yellow { color: var(--at8-yellow); }
.border-at8-yellow { border-color: var(--at8-yellow); }

/* --- Header Navigation Styling --- */
.at8-desktop-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.at8-desktop-nav li {
    margin: 0 1rem;
    position: relative; 
}

/* Base Desktop Link Style */
.at8-desktop-nav li a {
    font-weight: 600;
    color: var(--at8-blue);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.75rem; 
    letter-spacing: 0.1em;
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    display: block;
}

.at8-desktop-nav li a:hover { color: #1e3a8a; }

/* Underline Animation for Top-Level Links only */
.at8-desktop-nav > li:not(:last-child):not(.menu-item-has-children) > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--at8-yellow);
    transition: width 0.3s;
}

.at8-desktop-nav > li:not(:last-child):not(.menu-item-has-children) > a:hover::after { width: 100%; }

/* --- Desktop Submenu / Dropdown Styling --- */
.at8-desktop-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--at8-yellow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    padding: 0.75rem 0;
    list-style: none;
}

.at8-desktop-nav li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.at8-desktop-nav .sub-menu li { margin: 0; width: 100%; }

/* Reset: Ensure Submenu Items are NOT buttons */
.at8-desktop-nav .sub-menu li:last-child { margin-left: 0 !important; }
.at8-desktop-nav .sub-menu li a {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    background-color: transparent !important;
    color: var(--at8-blue) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.at8-desktop-nav .sub-menu li a::after { display: none !important; }
.at8-desktop-nav .sub-menu li a:hover { background: #f8fafc !important; }

/* --- Top-Level Last Menu Item (Contact Button Style) --- */
.at8-desktop-nav > li:last-child { margin-left: 2rem; }
.at8-desktop-nav > li:last-child > a {
    background-color: var(--at8-blue);
    color: white !important;
    padding: 0.6rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.at8-desktop-nav > li:last-child > a::after {
    content: '\f061'; /* FontAwesome Arrow Right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 0.5rem;
    font-size: 0.7rem;
}

.at8-desktop-nav > li:last-child > a:hover {
    background-color: var(--at8-yellow) !important;
    color: var(--at8-dark) !important;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px -10px rgba(251, 191, 36, 0.5);
}

/* --- Mobile Menu Base --- */
.at8-mobile-nav { list-style: none; padding: 0; margin: 0; }
.at8-mobile-nav li a {
    display: block;
    padding: 1rem 0;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
    text-transform: uppercase;
}
.at8-mobile-nav li:last-child a { color: var(--at8-yellow); font-weight: 800; border: none; }

/* --- Footer Link Styling (Yellow Border Hover) --- */
.at8-footer-menu, .at8-legal-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.at8-footer-menu li a, 
.at8-legal-nav li a {
    color: inherit !important;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
    display: inline-block;
    padding-bottom: 2px;
}

.at8-footer-menu li a:hover, 
.at8-footer-menu li a:active,
.at8-legal-nav li a:hover, 
.at8-legal-nav li a:active {
    color: inherit !important;
    border-bottom-color: var(--at8-yellow) !important;
}

/* Ensure legal nav wraps and centers correctly on small screens */
.at8-legal-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.at8-legal-nav li {
    margin: 5px 10px;
}

/* --- Hero Section & Brand Animations --- */
.hero-bg {
    background-size: cover;
    background-position: center;
}

@keyframes brandGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-brand-color {
    background: linear-gradient(to right, #fbbf24, #8fa8f2, #fbbf24);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: brandGradient 4s ease infinite;
    display: inline-block;
}

/* --- Stats Section (The Skew Logic) --- */


/* --- Stats Section (The Skew Logic) --- */
.stats-segment-container {
    display: flex;
    flex-wrap: wrap; /* Allows stacking on mobile */
    width: 100%;
    overflow: hidden;
    background-color: #0f172a;
}

.stat-segment {
    flex: 0 0 100%; /* Full width on mobile */
    padding: 3rem 2rem; /* Reduced padding for mobile */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    z-index: 1;
}

/* Adjustments for Desktop (768px and up) */
@media (min-width: 768px) {
    .stat-segment {
        flex: 1; /* Side-by-side on desktop */
        padding: 5rem 3rem;
    }

    .stat-segment::before {
        content: '';
        position: absolute;
        top: 0;
        left: -30px;
        width: calc(100% + 60px);
        height: 100%;
        z-index: -1;
        transform: skewX(-10deg);
    }
}

/* On Mobile, we remove the skew to prevent horizontal "cut off" */
@media (max-width: 767px) {
    .stat-segment::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        transform: none; /* Straight edges for mobile stacking */
    }
    
    .stat-number {
        font-size: 3rem; /* Slightly smaller text for mobile */
    }
}

/* Gradient logic remains the same */
.stat-segment-1::before { background: linear-gradient(135deg, #0f172a, #1e293b); }
.stat-segment-2::before { background: linear-gradient(135deg, #111827, #1e3a8a); }
.stat-segment-3::before { background: linear-gradient(135deg, #1e3a8a, #1d4ed8); }
.stat-segment-4::before { background: linear-gradient(135deg, #1d4ed8, #2563eb); }

/* Ensure the flex container in the info box aligns nicely */
.stat-info-box {
    display: flex;
    align-items: flex-start;
}

.stat-number {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.stat-accent-bar {
    width: 4px;
    height: 48px;
    background-color: var(--at8-yellow);
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 800;
    line-height: 1.3;
    max-width: 180px;
    color: rgba(255, 255, 255, 0.9);
}


/* --- Professional Sectors Styling --- */
/* --- AT8 UTILITIES: SECTORS GRID CSS --- */

/* Base Grid Settings */
#sectors {
    background-color: #ffffff;
    padding: 6rem 0; /* py-24 */
}

/* Card Accent Borders - Matches Reference HTML */
.sector-accent-energy { border-top: 6px solid #f59e0b; }
.sector-accent-water { border-top: 6px solid #0ea5e9; }
.sector-accent-telecoms { border-top: 6px solid #8b5cf6; }
.sector-accent-civils { border-top: 6px solid #10b981; }
.sector-accent-specialist { border-top: 6px solid #64748b; }

/* Icon Backgrounds and Icon Colors */
.sector-icon-bg-energy { background-color: #fff7ed; color: #f59e0b; }
.sector-icon-bg-water { background-color: #f0f9ff; color: #0ea5e9; }
.sector-icon-bg-telecoms { background-color: #f5f3ff; color: #8b5cf6; }
.sector-icon-bg-civils { background-color: #f0fdf4; color: #10b981; }
.sector-icon-bg-specialist { background-color: #f1f5f9; color: #64748b; }

/* Button Styling & Hover State */
.btn-blue-to-yellow {
    background-color: var(--at8-blue);
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    width: 100%;
    text-decoration: none;
}

.btn-blue-to-yellow:hover {
    background-color: var(--at8-yellow) !important;
    color: var(--at8-dark) !important;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px -10px rgba(251, 191, 36, 0.5);
}

/* Intersection Observer Reveal Logic */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Card Hover Elevation */
.sector-card-v2 .bg-white {
    transition: all 0.5s ease;
}

.sector-card-v2:hover .bg-white {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Typography */
#sectors h3 {
    letter-spacing: -0.01em;
    line-height: 1.2;
}

#sectors p {
    color: #4b5563; /* text-gray-600 */
}

/* Responsive Adjustments for Mobile */
@media (max-width: 767px) {
    #sectors {
        padding: 4rem 0;
    }
    
    .sector-accent-energy, 
    .sector-accent-water, 
    .sector-accent-telecoms, 
    .sector-accent-civils, 
    .sector-accent-specialist {
        border-top-width: 4px; /* Slightly thinner border for mobile */
    }

    #sectors h2 {
        font-size: 2.25rem; /* text-4xl */
    }
}
/* --- Accreditations --- */
.accred-badge {
    background: white;
    padding: 2.5rem 1.5rem;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 4px solid #f1f5f9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.accred-badge::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 0%;
    background: currentColor;
    opacity: 0.05;
    transition: height 0.3s ease;
}

.accred-badge:hover::after { height: 100%; }
.accred-badge:hover { transform: translateY(-12px); box-shadow: 0 25px 30px -10px rgba(0, 0, 0, 0.1); }

.accred-chas { color: #dc2626 !important; border-bottom-color: #dc2626 !important; }
.accred-achilles { color: #2563eb !important; border-bottom-color: #2563eb !important; }
.accred-cline { color: #0891b2 !important; border-bottom-color: #0891b2 !important; }
.accred-iso9 { color: #059669 !important; border-bottom-color: #059669 !important; }
.accred-iso14 { color: #d97706 !important; border-bottom-color: #d97706 !important; }
.accred-safe { color: #7c3aed !important; border-bottom-color: #7c3aed !important; }

/* --- Reveal & Zoom Logic --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.zoom-hover { overflow: hidden; }
.zoom-hover img { transition: transform 0.5s ease; }
.zoom-hover:hover img { transform: scale(1.1); }


/* --- AT8 GALLERY WIDGET STYLES --- */

/* Filter Buttons */
.gallery-filter {
    background: white;
    color: var(--at8-blue);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-filter.active, .gallery-filter:hover {
    background: var(--at8-yellow);
    color: white;
    border-color: var(--at8-blue);
    box-shadow: 0 10px 15px -5px rgba(30, 58, 138, 0.3);
}

/* Grid System */
.at8-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.gallery-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--at8-dark);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 58, 138, 0.95), transparent);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(10px);
}

.gallery-card:hover img {
    transform: scale(1.1);
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.overlay-content {
    width: 100%;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .at8-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filter {
        padding: 0.5rem 1rem;
        font-size: 0.65rem;
    }
}