:root {
    --primary-red: #D90429;
    --dark-blue: #0B132B;
    --white: #FFFFFF;
    --gray-bg: #F8F9FA;
    --text-color: #333;
    --transition: all 0.3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 18px; }
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    text-align: center; /* Centers all text globally */
}

/* Header & Nav */
.announcement-bar {
    background: var(--dark-blue);
    padding: 10px;
    display: flex;
    justify-content: flex-end; /* Aligns content to the right */
    position: relative;
    /* align left content with the main nav left gutter */
    padding-left: 5%;
    border-bottom: 3px solid var(--primary-red);
    align-items: center;
    gap: 15px;
}

.dispatch-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.contact-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.email-small {
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    text-decoration: none;
    margin-top: 3px;
}
.email-small:hover { color: white; text-decoration: underline; }

.navbar {
    display: flex;
    flex-direction: row; /* CHANGED: Aligns items side-by-side */
    justify-content: space-between; /* CHANGED: Pushes Logo left and Menu right */
    align-items: center;
    padding: 10px 5%;
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo { font-size: 1.8rem; font-weight: 900; margin-bottom: 0; /* CHANGED: Removed bottom margin */ }
.logo .united { color: var(--primary-red); }
.logo .messengers { color: var(--dark-blue); }
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.logo img {
    height: 65px;
    /*filter: brightness(1.15);*/
}

.nav-links { list-style: none; display: flex; gap: 20px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--dark-blue); font-weight: 600; }
.nav-links a:hover { color: var(--primary-red); }
.btn-login { background: var(--primary-red); color: white !important; padding: 8px 18px; border-radius: 4px; }

/* Submenu styles for About */
.nav-links li { position: relative; }
.nav-links .submenu { display: none; position: absolute; left: 0; top: 100%; background: white; box-shadow: 0 8px 20px rgba(0,0,0,0.08); padding: 8px 0; border-radius: 6px; min-width: 220px; z-index: 200; text-align: left; }
.nav-links .submenu li { display: block; padding: 0; margin: 0; }
.nav-links .submenu a { display: block; padding: 10px 16px; color: var(--dark-blue); font-weight: 600; }
.nav-links .submenu a:hover { background: #f7f7f7; color: var(--primary-red); }
.nav-links .has-submenu:hover .submenu, .nav-links .has-submenu:focus-within .submenu { display: block; }

/* Add dropdown arrow to About link */
.nav-links .has-submenu > a::after {
    content: "\f0d7";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.3s ease;
}
.nav-links .has-submenu:hover > a::after {
    transform: rotate(180deg);
}

/* Hero */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.0)),
    url('images/masthead.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hero h1 { font-size: 2.6rem; margin-bottom: 20px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.hero p { max-width: 600px; margin: 0 auto 30px; font-size: 1.1rem; text-shadow: 0 1px 3px rgba(0,0,0,0.8); font-weight: 500; }

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin: 10px;
    display: inline-block;
}
.btn-primary { background: var(--primary-red); color: white; }
.btn-secondary { background: white; color: var(--dark-blue); }

/* About Section */
.intro-section { padding: 80px 5%; max-width: 1000px; margin: 0 auto; }
.intro-grid { display: block; }
.intro-grid::after { content: ""; display: table; clear: both; }

.video-container { width: 100%; max-width: 700px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.intro-grid .video-container { margin-bottom: 30px; }

.benefit-list { list-style: none; margin-top: 20px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.benefit-list i { color: var(--primary-red); margin-right: 8px; }

@media (min-width: 900px) {
    .intro-section { text-align: left; }
    .intro-grid .video-container {
        float: right;
        width: 50%;
        margin-left: 40px;
        margin-bottom: 20px;
    }
    .intro-grid .benefit-list { justify-content: flex-start; }
}

/* Phishing Alert Box */
.phishing-alert {
    background-color: #fff3cd;
    color: #856404;
    padding: 12px 20px;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

/* Technology Section */
.technology-section { padding: 60px 5%; background: var(--white); }
.technology-container { max-width: 900px; margin: 0 auto; text-align: center; }
.technology-container h3 { color: var(--dark-blue); margin-bottom: 20px; font-size: 1.3rem; }
.technology-container p { font-size: 1.1rem; margin-bottom: 15px; }

/* Team Section - Centered & Optimized */
.team-section { padding: 60px 5%; background: var(--white); }
.team-container { max-width: 850px; margin: 0 auto; } /* Narrowed container to make images look smaller */
.section-title { font-size: 2.2rem; margin-bottom: 40px; }

.category-header {
    font-size: 1.2rem;
    color: var(--dark-blue);
    margin: 50px 0 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--primary-red);
    display: inline-block;
    padding-bottom: 5px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 People Wide */
    gap: 20px; /* Tighter gap */
    justify-content: center;
}

.team-card {
    background: var(--white);
    padding: 15px; /* Less padding to keep it compact */
    border-radius: 10px;
    border: 1px solid #f1f1f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

.team-card img {
    width: 85%; /* Shrank images to 85% of the card width */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%; /* Circle looks great for smaller profile shots */
    margin-bottom: 12px;
    border: 3px solid #f9f9f9;
}

.team-card h3 {
    color: var(--dark-blue);
    font-size: 0.95rem;
    margin-top: auto;
    margin-bottom: 4px;
}

.team-card p {
    color: var(--primary-red);
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Services */
.services { padding: 80px 2%; background: var(--gray-bg); }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; max-width: 100%; margin: 0 auto; }
.service-card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); scroll-margin-top: 110px; }
.card-img { height: 140px; background-size: cover; background-position: center; border-radius: 5px; margin-bottom: 15px; }

/* Service Link Wrapper for Homepage Grid */
a.service-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
a.service-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
a.service-link h3 {
    color: var(--dark-blue);
    margin-top: 10px;
}

/* Wide service card: span two columns and layout image left / text right */
.service-card--wide {
    /* span the full width of the grid (equivalent to 4 services) */
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    align-items: center; /* center image vertically beside text */
}
.service-card--wide .card-img {
    flex: 0 0 320px;
    width: 320px;
    height: 220px;
    margin-bottom: 0;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}
.service-card--wide .service-content { flex: 1 1 auto; text-align: left; }
.service-card--wide h3 { font-size: 1.4rem; margin-bottom: 8px; }
.service-card--wide p { margin: 0; line-height: 1.7; }

@media (max-width: 900px) {
    .service-card--wide { grid-column: span 1; flex-direction: column; }
    .service-card--wide .card-img { flex: 0 0 auto; width: 100%; height: 160px; }
}

/* Testimonials */
.testimonials-section {
    background: var(--dark-blue);
    color: white;
    padding: 80px 5%;
    text-align: center;
}
.testimonials-section .section-title {
    color: white;
    border-bottom-color: var(--primary-red);
}
.testimonial-carousel {
    position: relative;
    max-width: 800px;
    margin: 40px auto 0;
    overflow: hidden;
}
.testimonial-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.testimonial-card {
    background: rgba(255,255,255,0.05);
    padding: 30px;
    border-radius: 10px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.1);
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 40px 60px; /* More padding for a focused view */
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
    transition: color 0.3s ease;
}
.carousel-btn:hover {
    color: white;
}
.prev-btn { left: 15px; }
.next-btn { right: 15px; }

.carousel-dots {
    text-align: center;
    margin-top: 25px;
}
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.dot.active {
    background-color: white;
}
.stars {
    color: #FFD700;
    margin-bottom: 15px;
}
.testimonial-quote {
    font-size: 1rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 20px;
    border-left: 3px solid var(--primary-red);
    padding-left: 15px;
}
.testimonial-author {
    font-weight: bold;
    color: var(--primary-red);
    text-align: right;
}

/* Facts Carousel */
.facts-section {
    padding: 60px 0;
    background: var(--gray-bg);
    text-align: center;
    overflow: hidden;
}
.facts-carousel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
}
.facts-viewport {
    overflow: hidden;
    flex: 1 1 auto;
}
.facts-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(.22,.9,.32,1);
    will-change: transform;
}
.fact-card {
    min-width: 300px;
    max-width: 300px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.fact-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}
.fact-text {
    font-size: 1rem;
    color: var(--dark-blue);
    font-weight: 600;
}

/* Carousel controls */
.fact-nav {
    background: transparent;
    border: 1px solid rgba(11,19,43,0.08);
    color: var(--dark-blue);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 1.6rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(11,19,43,0.06);
}
.fact-nav:hover { transform: translateY(-2px); }
.facts-dots { margin-top: 14px; text-align: center; }
.facts-dots .dot { display:inline-block; width:10px; height:10px; background:#ddd; border-radius:50%; margin:0 6px; cursor:pointer; }
.facts-dots .dot.active { background:var(--primary-red); }

@media (max-width: 900px) {
    .fact-card { min-width: 260px; max-width: 260px; }
}

@media (max-width: 520px) {
    .fact-card { min-width: 220px; max-width: 220px; }
    .fact-nav { width:36px; height:36px; }
}

/* Footer */
footer { padding: 40px 5%; background: #111; color: white; border-top: 3px solid var(--primary-red); }
footer .footer-content p:last-child {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 20px;
}

/* Content Page Styles */
.content-page {
    padding: 60px 5%;
    max-width: 900px;
    margin: 0 auto;
}

.content-page p {
    margin-bottom: 15px;
}

/* Contact form layout: stack label and input on their own lines */
.contact-form form label {
    display: block;
    text-align: left;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark-blue);
}
.contact-form form input,
.contact-form form select,
.contact-form form textarea,
.contact-form form .btn,
.contact-form form button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    font-size: 1rem;
}
.contact-form form textarea { min-height: 120px; resize: vertical; }

/* Make the image stack above the form on small screens */
@media (max-width: 700px) {
    .contact-grid { flex-direction: column; }
    .contact-image { order: -1; width: 100%; max-width: 100%; }
    .contact-image img { width: 100%; height: auto; }
}

/* Facebook link icon styling */
.facebook-link img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}
.facebook-link { display: inline-flex; align-items: center; gap:8px; color: var(--dark-blue); font-weight:600; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.data-table thead {
    background-color: var(--dark-blue);
    color: var(--white);
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--gray-bg);
}

/* Member Benefits Page Styles */
.split-section {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    text-align: left;
}

.split-content { flex: 1; }
.split-image { flex: 1; text-align: center; }
.split-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.benefit-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease;
    border-top: 4px solid var(--primary-red);
}

.benefit-card:hover { transform: translateY(-5px); }

.benefit-icon {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 20px;
}

.benefit-card h3 {
    color: var(--dark-blue);
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .split-section {
        flex-direction: column;
    }
    .split-section.reverse {
        flex-direction: column-reverse;
    }
}

/* Parallax Banner "We Love What We Do" */
.parallax-banner {
    background-image: url('images/we-love-what-we-do.jpg'); /* Ensure this image exists */
    min-height: 400px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.parallax-content h2 {
    color: white;
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
    margin: 0;
    letter-spacing: 2px;
}

.parallax-content p {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    margin-top: 10px;
}

/* Construction Banner */
.construction-banner {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 1.3rem;
}

/* Query CTA Section */
.query-section {
    background-color: var(--gray-bg);
    padding: 60px 10%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--dark-blue);
    flex-wrap: wrap;
    gap: 30px;
}

.query-text {
    flex: 1;
    text-align: left;
    min-width: 280px;
}

.query-text h2 {
    color: var(--dark-blue);
    font-size: 2.2rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.query-text p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
}

.query-btn {
    background: transparent;
    border: 2px solid var(--dark-blue);
    color: var(--dark-blue);
    padding: 15px 35px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.query-btn:hover {
    background: var(--dark-blue);
    color: white;
}

@media (max-width: 768px) {
    .query-section {
        flex-direction: column;
        text-align: center;
        padding: 50px 5%;
    }
    .query-text {
        text-align: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.2rem; }
    .hero {
        background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
        url('images/masthead.jpg') center/cover;
    }
    .parallax-banner {
        background-attachment: scroll; /* Better performance on mobile devices */
    }
}

@media (max-width: 480px) {
    .team-grid { grid-template-columns: 1fr; }
    /* Mobile nav: hide desktop horizontal menu and show toggle */
    .nav-toggle { display: block; }
    .nav-links { display: none; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; left: 0; right: auto; top: 100%; width: 280px; max-width: 85%; background: white; box-shadow: 0 10px 30px rgba(0,0,0,0.12); border-radius: 8px; padding: 8px 0; z-index: 1500; align-items: flex-start; text-align: left; }
    .nav-links.open li { width: 100%; }
    /* Left-align top-level links in the popup */
    .nav-links.open a { display: block; padding: 12px 18px; color: var(--dark-blue); font-weight: 700; background: white; text-align: left; width: 100%; }
    /* Make About appear open and add caret */
    .nav-links.open .has-submenu > a { font-weight: 800; }
    .nav-links.open .has-submenu > a::after { content: "\f0d7"; float: right; color: #777; margin-left: 8px; transform: none; }
    /* Show nested submenu items when mobile menu is opened and indent them */
    .nav-links.open .has-submenu .submenu { display: block; position: static; box-shadow: none; background: white; padding: 0; min-width: auto; }
    .nav-links.open .has-submenu .submenu a { padding-left: 34px; background: white; font-weight: 600; }
    /* Slight divider between top-level items */
    .nav-links.open li + li { border-top: 1px solid #f1f1f1; }

    /* Place Order CTA pinned to bottom of mobile popup */
    .nav-links.open .order-cta {
        display: block;
        position: absolute;
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        padding: 0;
        z-index: 1600;
    }
    /* Hide the order CTA in desktop nav; only show in mobile popup when opened */
    .nav-links .order-cta { display: none; }
    .nav-links.open .order-cta a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        border-radius: 6px;
    }

    /* Make Members Login readable in the mobile popup */
    .nav-links.open .btn-login {
        background: transparent !important;
        color: var(--dark-blue) !important;
        font-weight: 800;
        padding: 10px 18px;
        text-align: left;
        display: block;
        width: 100%;
    }

    /* Larger hamburger for easier tapping */
    .nav-toggle {
        font-size: 2rem;
        width: 52px;
        height: 52px;
        padding: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        touch-action: manipulation;
    }
}

/* Nav toggle (hidden on larger screens) */
.nav-toggle {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--dark-blue);
    padding: 6px 8px;
    z-index: 1101;
    position: relative;
}
.nav-toggle:focus { outline: 2px solid var(--primary-red); border-radius: 6px; }
.nav-toggle.active { color: var(--primary-red); }

/* Make nav-links vertical on small widths when opened via toggle */
@media (max-width: 768px) {
    .nav-links { gap: 10px; }
}

@media (min-width: 481px) {
    .nav-toggle { display: none; }
}

/* Modal styles */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    padding: 20px;
}
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 10px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    text-align: left;
}
.modal-close {
    position: absolute;
    right: 10px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--dark-blue);
    cursor: pointer;
}
.modal input[type="text"], .modal input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.btn.btn-cta {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

/* Contact Page Details Box */
.contact-info-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: var(--gray-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-top: 15px;
}

.info-item {
    display: flex;
    gap: 15px;
}

.info-item .icon-box {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.info-item h4 {
    margin: 0 0 5px;
    color: var(--dark-blue);
    font-size: 1.1rem;
}

.info-item p {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}
