/* --- Global Styles & Variables --- */
:root {
    --primary-blue: #2a5e83;
    --dark-grey: #333333;
    --medium-grey: #555555;
    --light-grey: #f4f4f4;
    --white: #ffffff;
    --black: #000000;
    --light-blue-icon: #a0c4e0;
    --heading-font: 'Poppins', sans-serif;
    --body-font: 'Poppins', sans-serif;
    --base-font-size: 16px;
    --transition-speed: 0.3s;
    --section-padding-desktop: 80px 0;
    --section-padding-mobile: 60px 0;
    --sticky-header-height: 60px;
}

/* --- Base & Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* scroll-padding-top is crucial for fixed headers */
    scroll-padding-top: var(--sticky-header-height);
    font-size: 100%; /* Base font size */
    line-height: 1.7; /* Default line height */
}

body {
    font-family: var(--body-font);
    font-size: var(--base-font-size);
    color: var(--dark-grey);
    background-color: var(--white);
    /* IMPORTANT: Prevent horizontal scroll (though nested transforms can bypass) */
    overflow-x: hidden;
    width: 100%;
    position: relative; /* Can help contain positioned children */
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    margin-bottom: 0.75em; /* Use em for spacing relative to font size */
    line-height: 1.3;
}

h2.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* Responsive font size */
    margin-bottom: 30px;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

h2.section-subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 400;
    color: var(--medium-grey);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

p {
    margin-bottom: 1em; /* Consistent paragraph spacing */
}

p.lead {
    font-size: clamp(1rem, 4.5vw, 1.15rem);
    font-weight: 300;
    margin-bottom: 1.25em;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
a:hover {
    color: #1e425d;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    vertical-align: middle; /* Prevent bottom space under images */
}

ul {
    list-style: none;
}

/* --- Layout & Container --- */
.container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
}

/* --- Utility Classes --- */
.section-padding {
    padding: var(--section-padding-mobile);
}
.text-center { text-align: center; }
.text-white { color: var(--white) !important; }
.bg-white { background-color: var(--white); }
.bg-primary { background-color: var(--primary-blue); }
.bg-dark { background-color: var(--dark-grey); }
.bg-light { background-color: var(--light-grey); }
.bg-black { background-color: var(--black); }
.mb-30 { margin-bottom: 30px !important; }
.mb-50 { margin-bottom: 50px !important; }
.mt-30 { margin-top: 30px !important; }

/* --- Grid System --- */
.grid-2-col {
    display: grid;
    gap: 30px; /* Default gap */
    align-items: center;
    /* overflow: hidden; /* Avoid global overflow on grid if possible */
}

/* --- Header & Navigation --- */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    height: var(--sticky-header-height);
    transform: translateY(-100%); /* Start hidden */
    transition: transform var(--transition-speed) ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#top-bar.visible {
    transform: translateY(0); /* Slide in */
}
.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
#top-bar .logo-small img {
    height: calc(var(--sticky-header-height) - 20px); /* Adjust padding */
    width: auto;
}

/* Desktop Navigation (Shared) */
nav.desktop-nav ul {
    display: flex; /* Use flexbox */
    gap: 25px; /* Spacing between items */
}
nav.desktop-nav ul li a {
    color: var(--white);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    white-space: nowrap; /* Prevent wrapping */
}
nav.desktop-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--white);
    transition: width var(--transition-speed) ease;
}
nav.desktop-nav ul li a:hover { color: var(--light-blue-icon); }
nav.desktop-nav ul li a:hover::after { width: 100%; }

/* Hero Section Navigation */
.hero-nav {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 5;
    /* Hide on mobile by default */
    display: none;
}

/* Mobile Menu Icon (Shared) */
.mobile-menu-icon {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 5; /* Ensure it's clickable */
    display: none; /* Hidden by default, shown in media query */
}
.hero-menu-icon {
    position: absolute;
    top: 25px;
    right: 20px; /* Consistent padding */
    display: block; /* Show in hero initially on mobile */
}
#top-bar .mobile-menu-icon {
     /* Position determined by flex container */
     display: none; /* Shown in media query when desktop nav hides */
}


/* Mobile Popout Menu */
#mobile-menu {
    position: fixed;
    top: 0;
    right: 0; /* Start hidden off-screen */
    width: min(80vw, 280px); /* Responsive width */
    height: 100%;
    background-color: var(--black);
    padding: calc(var(--sticky-header-height) + 20px) 30px 30px 30px; /* Padding below header */
    z-index: 1010;
    transform: translateX(100%); /* Start hidden */
    transition: transform var(--transition-speed) ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    overflow-y: auto;
}
#mobile-menu.open {
    transform: translateX(0); /* Slide in */
}
#mobile-menu ul {
    /* No specific styles needed here now */
}
#mobile-menu ul li {
    margin-bottom: 20px;
}
#mobile-menu ul li a {
    color: var(--white);
    font-size: 1.2rem;
    display: block;
    padding: 10px 0;
    transition: color var(--transition-speed) ease;
}
#mobile-menu ul li a:hover {
    color: var(--primary-blue);
}
.close-menu-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    height: 100vh; /* Full viewport height */
    width: 100%;
    overflow: hidden; /* Crucial for video containment */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
#hero video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover; /* Cover the area */
}
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: -1;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 90%; /* Use percentage */
    width: 700px; /* Max width */
    padding: 20px;
}
.hero-content .main-logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
    max-height: 60vh;
}

/* --- Partners Section --- */
#partners {
    background-color: var(--light-grey);
    /* Add overflow: hidden ONLY if this section uses horizontal animations AND causes issues */
    /* overflow: hidden; */
}
.partners-logo {
    max-width: 100%; /* Ensure it scales */
    height: auto;
    margin: 0 auto;
}

/* --- About Us Section --- */
#about {
    /* --- FIX ADDED HERE --- */
    overflow: hidden; /* Prevents AOS horizontal animations (fade-left/right) from causing overflow */
}
.about-image img {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* --- Services Section --- */
#services {
    color: var(--white);
    /* Add overflow: hidden ONLY if this section uses horizontal animations AND causes issues */
    /* overflow: hidden; */
}
#services .section-title,
#services .lead { color: var(--white); }
#services a { color: var(--light-blue-icon); }
#services a:hover { color: var(--white); }

.services-infographic {
    display: grid;
    /* Responsive grid columns */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-top: 50px;
}
.service-item {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 30px 25px;
    border-radius: 8px;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* overflow: hidden; /* Generally avoid here unless absolutely needed for nested content */
}
.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.service-icon {
    font-size: 2.5rem;
    color: var(--light-blue-icon);
    margin-bottom: 15px;
    line-height: 1; /* Prevent extra space */
}
.service-item h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--white);
}
.service-item p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0; /* Reset bottom margin */
}

/* --- Canada Map Section --- */
#canada-map {
    background-color: var(--white); /* Keep existing styles */
    /* --- FIX REMAINS HERE --- */
    overflow: hidden; /* Prevents AOS horizontal animations (fade-left/right) from causing overflow */
}

.map-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    /* No overflow needed here */
}

/* --- Contact Section --- */
#contact {
    background-color: var(--dark-grey);
    /* Add overflow: hidden ONLY if this section uses horizontal animations AND causes issues */
    /* overflow: hidden; */
}
#contact h2.section-title,
#contact .lead { color: var(--white); }
.contact-details p {
    font-size: clamp(1rem, 4vw, 1.1rem); /* Responsive font size */
    margin-bottom: 15px;
    display: flex; /* Align icon and text */
    align-items: center;
    justify-content: center; /* Center align items */
    flex-wrap: wrap; /* Allow wrapping if needed */
}
.contact-details i {
    margin-right: 10px; /* Reduced margin */
    color: var(--primary-blue);
    width: 20px;
    text-align: center;
    flex-shrink: 0; /* Prevent icon shrinking */
}
.contact-details a { color: var(--white); }
.contact-details a:hover { color: var(--light-blue-icon); }

/* --- Footer --- */
.footer {
    padding: 25px 0;
    background-color: var(--black);
}
.footer p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #aaa;
}

/* --- AOS Base --- */
/* Ensure AOS elements don't cause initial overflow before JS runs */
[data-aos] {
   opacity: 0;
   transition-property: transform, opacity;
   /* overflow: hidden; /* Generally avoid applying globally */
}


/* --- Responsive Design --- */

/* Medium devices (tablets, landscape phones, 768px and up) */
@media (min-width: 768px) {
    .section-padding {
        padding: var(--section-padding-desktop);
    }

    /* Show desktop nav, hide mobile icons */
    .hero-nav { display: block; }
    .hero-menu-icon { display: none; }
    #top-bar .desktop-nav { display: flex; } /* Use flex for desktop nav */
    #top-bar .mobile-menu-icon { display: none; }

    /* Grid for larger screens */
    .grid-2-col {
        grid-template-columns: repeat(2, 1fr);
        gap: 50px;
        text-align: left; /* Reset text align */
        /* Ensure no conflicting overflow here */
    }

    /* Reset ordering if needed */
    #about .grid-2-col .about-image,
    #about .grid-2-col .about-text,
    .grid-2-col.reverse-mobile .map-image,
    .grid-2-col.reverse-mobile .map-text {
        order: initial; /* Reset order */
    }
     #canada-map .map-image {
        margin: 0; /* Reset margin */
    }
}

/* Small devices (phones, less than 768px) */
@media (max-width: 767.98px) {
    /* Mobile-specific styles */
    .grid-2-col {
        grid-template-columns: 1fr; /* Stack columns */
        gap: 40px;
        text-align: center;
         /* Ensure no conflicting overflow here */
    }

    /* Explicitly hide desktop, show mobile icons */
      .hero-nav { display: none; }
      .hero-menu-icon { display: block; } /* Ensure hero icon shows */
      #top-bar .desktop-nav { display: none; }
      #top-bar .mobile-menu-icon { display: block; } /* Ensure sticky icon shows */


    /* Reverse order for map section on mobile */
    .grid-2-col.reverse-mobile .map-image { order: 1; }
    .grid-2-col.reverse-mobile .map-text { order: 2; }

      #canada-map .map-image {
        margin: 0 auto 30px auto; /* Center map image */
        max-width: 400px; /* Limit map size */
    }

    .hero-content .main-logo {
        max-width: 85%; /* Slightly smaller logo on mobile */
    }

    .services-infographic {
        /* Already handles stacking with auto-fit */
         gap: 20px;
    }
    .contact-details p {
        justify-content: center; 
    }
}

.partner-showcase-container {
    margin-top: 80px; 
}

.partner-showcase-img {
    width: 100%;
    max-width: 500px; /* Prevents the square from being huge on desktops */
    aspect-ratio: 1 / 1;/* This forces the element to be a perfect square */
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 15px auto 0; /* Centers the square block on the page */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}