/* ---------------------------- 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: 100px;
    width: auto;
    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;
}

/*----------------------- Footer --------------------------------- */

.footer {
    display: flex;
    flex-direction: column;
    background-color: var(--color-primary);
    gap: 1rem;
    text-align: center;
    align-items: center;
}

.footer > div:first-child {
    text-align: center;
}

.footer > div:first-child img {
    display: block;
    margin: 0 auto;
}

.footer img {
    height: 120px;
    width: auto;
}

.footer p {
    color: var(--color-secondary);
}

.footer a {
    color: var(--color-accent);
}

.footer a:hover {
    color: var(--color-accent-alt);
}

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


.footer-line {
    display: block;
    height: 1px;
    width: 100%;
    background-color: var(--color-accent-alt);
    margin-bottom: 1rem;
}

.footer-socials {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.footer-socials svg {
    height: 30px;
    width: auto;
    color: var(--color-accent);
}

.footer-ps p{
        color: var(--color-neutral-dark);
    }

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

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

    header.container {
        padding: 0 1rem;
    }

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

    #navMenu a.active {
        color: var(--color-accent); /* Highlight text */
        text-decoration: underline;
        text-underline-offset: 4px;
        font-weight: bold; /* Optional: make active link stand out */
    }

    /* 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%;
    }
}


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

    header {
        position: sticky;
        top: 0;
    }

    header.container {
        padding: 1rem var(--container-padding);
    }

    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);
        color: var(--color-accent);
    }

    nav ul li a.active::after {
        transform: scaleX(1);
        color: var(--color-accent-alt);
    }
}