/* ---------------------------- HEADER ------------------------------- */
header {
    width: 100%;
    background-color: var(--color-primary);
    color: var(--color-neutral-light);
    padding: 1rem var(--container-padding);

    display: flex;
    justify-content: space-between;
    align-items: center;

    position: relative;
    z-index: 100;
}

/* Logo */
header img {
    height: var(--logo-size);
    width: var(--logo-size);
    object-fit: contain;
}

/* ---------------- NAV ---------------- */
header nav {
    display: flex;
}

/* NAV LIST */
header nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

/* LINKS */
header a {
    color: var(--color-neutral-light);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: color var(--transition-medium);
}

header a:hover,
header a:focus {
    color: var(--color-secondary);
}

#navMenu a.active {
    color: var(--color-secondary);
}


/* ---------------- HAMBURGER BUTTON ---------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--color-secondary);
    display: block;
    transition: var(--transition-medium);
}

/* ACTIVE STATE (hamburger → X) */
.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-toggle {
    position: relative;
    z-index: 110; /* higher than nav */
}

/* ---------------- OVERLAY ---------------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);

    opacity: 0;
    visibility: hidden;

    transition: opacity var(--transition-medium), visibility var(--transition-medium);

    z-index: 90;
}

/* Active overlay */
.overlay.active {
    opacity: 1;
    visibility: visible;
}



/* ---------------- MOBILE MENU ---------------- */
@media (max-width: 767px) {

    /* Stack header */
    header {
        flex-direction: row;
        position: fixed;
        top: 0;
    }

    /* Remove all active/hover/focus highlight from submenu links on mobile */
    #navMenu .submenu a,
    #navMenu .submenu a:active,
    #navMenu .submenu a:focus,
    #navMenu .submenu a:hover {
        color: inherit;       /* keep text color same as normal */
        background: none;     /* remove background highlight */
        transition: none;     /* disable transition easing */
    }

    /* Show hamburger */
    .nav-toggle {
        display: flex;
    }

    /* NAV PANEL */
    header nav {
        position: fixed;
        top: 0;
        right: 0;

        height: 100vh;
        width: 75%;
        max-width: 300px;

        background-color: var(--color-primary);

        flex-direction: column;
        justify-content: center;
        align-items: center;

        transform: translateX(100%);
        transition: transform var(--transition-medium);

        box-shadow: -5px 0 15px rgba(0,0,0,0.2);

        z-index: 100;
    }

    /* ACTIVE STATE */
    header nav.active {
        transform: translateX(0);
    }

    /* Vertical nav */
    header nav ul {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .no-scroll {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* MOBILE SUBMENU */

    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;

        display: none;
        flex-direction: column;
        gap: 1rem;

        margin-top: 0.5rem;
    }

    .has-submenu.open .submenu {
        display: flex;
        margin-top: 1rem;
    }

   
}


/* ---------------------------- NAV (LAPTOP & DESKTOP) ------------------------------- */
@media (min-width: 768px) {

    header {
        position: sticky;
        top: 0;
    }

    nav ul {
        display: flex;
        gap: 2rem;
        list-style: none;
    }

    nav ul li a {
        position: relative;
        text-decoration: none;
        color: inherit;
        padding: 0.25rem 0;
    }

    /* underline */
    nav ul li a::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -4px;
        width: 100%;
        height: 2px;
        background: currentColor;

        transform: scaleX(0);
        transform-origin: center;
        transition: transform 0.3s ease;
    }

    /* hover */
    nav ul li a:hover::after {
        transform: scaleX(1);
    }

    nav ul li a.active::after {
        transform: scaleX(1);
    }

    /* ---------------- SUBMENU (DESKTOP) ---------------- */

    .has-submenu {
        position: relative;
    }

    .has-submenu .submenu {
        position: absolute;
        top: 100%;
        left: 0;

        background: var(--color-primary);
        list-style: none;

        padding: 1rem 0;
        min-width: 240px;

        display: flex;
        flex-direction: column;
        gap: 0;

        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);

        transition: var(--transition-medium);
    }

    .submenu li a {
        padding: 0.5rem 1.5rem;
        display: inline-block;
        margin-bottom: 0.2rem;
    }

    .has-submenu:hover .submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .submenu li a::after {
        left: 1.5rem;        /* align with padding */
        width: calc(100% - 3rem); /* subtract padding */
        bottom: -1px;
    }
}

/* ---------------- SUBMENU BASE ---------------- */

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}



/* ---------------------------- FOOTER ------------------------------- */
footer {
    background-color: var(--color-primary);
    color: var(--color-neutral-light);
    text-align: center;
    font-size: var(--fs-medium);
}

footer a {
    color: var(--color-neutral-light);
    font-size: var(--fs-h5);
}

footer a:hover,
footer a:focus {
    color: var(--color-secondary);
}

footer img {
    height: var(--logo-size);
    width: var(--logo-size);
    object-fit: contain;
    margin: 0 auto;
}

footer h4 {
    color: var(--color-secondary);
}

footer .grid { 
    gap: 4rem;
}

.footer-services-links.flex {
    gap: 0.5rem;
}



@media (min-width: 768px) {
    footer .grid {
        grid-template-columns: 0.6fr 1.2fr 1.2fr;
        align-items: flex-start;
    }

    .footer-contact-info {
        text-align: left;
    }
}

/* ---------------------------- SMALL CTA ------------------------------- */

.small-cta {
    background: linear-gradient(
    135deg,
    #0D2B45 0%,
    #1E4A73 100%
    );
    color: var(--color-neutral-light);
    text-align: center;
    padding: 2rem var(--container-padding);
}

.small-cta h2 {
    color: var(--color-neutral-light);
    margin-bottom: 1rem;
}

.small-cta p {
    padding-bottom: 2rem;
}


/* ---------------------------- GRID SYSTEM ------------------------------- */
.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1440px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------------------------- FLEX SYSTEM ------------------------------- */
.flex {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

/* ---------------------------- SECTIONS ------------------------------- */

section.alt {
    background-color: var(--color-neutral-light);
}

