/*
 *  FILE: header-style.css
 *  DESCRIPTION:
 *  - Styles the header, including mobile and desktop navigation.
 *  - Uses a mobile-first approach.
 */

/* =================================================================
   MOBILE HEADER & NAVIGATION (Default)
   ================================================================= */

/* Initially hide desktop-only navigation elements */
.desktop-nav,
.secondary-nav {
    display: none;
}

/* --- Mobile Header Bar --- */
.mobile-header {
    position: relative; /* For z-index to work */
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    padding: 1.1rem;
    background-color: #ffffff;
    transition: background-color 0.3s ease;
}

/* Style for when the mobile menu is active/open */
.mobile-header.is-menu-active {
    background-color: #0000ff;
}

/* --- Mobile Menu Button --- */
#menu-btn {
    border: none;
    background-color: transparent;
    font-size: 1.45rem;
    font-weight: 500;
    color: black;
    transition: color 0.3s ease;
}

/* White text color when the menu is open */
#menu-btn.is-menu-open {
    color: white;
}

/* Arrow icon for the menu button */
#menu-btn::after {
    content: "▼";
    position: absolute;
    top: 2.1rem;
    margin-left: 0.7rem;
    font-size: 0.45rem;
    color: inherit;
    transition: transform 0.3s ease;
}

/* Rotate arrow when menu is open */
#menu-btn.is-menu-open::after {
    transform: rotate(180deg);
}

/* --- Mobile Slide-Down Menu --- */
.mobile-menu {
    position: absolute;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1.5rem 1.5rem 0 1.5rem;
    background-color: #0000ff;
    /* Animation properties */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
}

/* Class to trigger the slide-down animation */
.mobile-menu.is-visible {
    max-height: 1000px; /* A large value to allow full expansion */
    opacity: 1;
}

/* All text inside the mobile menu is white */
.mobile-menu a,
.mobile-menu h3,
.mobile-menu p {
    color: #ffffff;
}

/* Spacing for sections within the mobile menu */
.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding-bottom: 0.8rem;
}

.mobile-menu-section:first-child {
    gap: 1.5rem;
}

/* --- Horizontal Scrolling Section --- */
.mobile-menu-horizontal-scroll {
    display: flex;
    gap: 0.5rem;
    padding-block: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.scroll-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 0 0 auto; /* Prevent items from shrinking or growing */
    width: 15em;
    border-radius: 8px;
}

.scroll-item p {
    font-size: 0.8rem;
    color: #ffffff;
}

/* --- Navigation Logo --- */
.nav-logo {
    width: 35px;
}

/* =================================================================
   DESKTOP HEADER & NAVIGATION (Large Screens)
   ================================================================= */
@media screen and (min-width: 1000px) {
    /* Hide mobile elements */
    .mobile-header,
    .mobile-menu {
        display: none;
    }

    /* Show desktop navigation */
    .desktop-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 2.3rem;
    }
    
    /* Make header text black again on desktop */
    header a,
    header h3,
    header p {
        color: #000000;
    }

    /* --- Primary Desktop Nav --- */
    .desktop-nav-section-left,
    .desktop-nav-section-right {
        display: flex;
        align-items: center;
        gap: 1.25rem;
    }

    .desktop-nav .primary-link {
        font-size: 1.15rem;
    }

    /* --- "More" Button State --- */
    #mega-menu-btn::after {
        content: " +";
    }

    #mega-menu-btn.is-open::after {
        content: " -";
    }

    /* --- Secondary Desktop Nav ("Mega Menu") --- */
    .secondary-nav {
        /* display is toggled by JS from none to flex */
        flex-direction: column;
        gap: 2rem;
        padding: 1rem 2.5rem 2.5rem 2.5rem;
    }
    
    .secondary-nav.is-open {
        display: flex;
    }

    .secondary-menu-section a {
        margin-right: 2rem;
    }

    .secondary-menu-grid {
        display: flex;
        gap: 3rem;
    }

    /* Typography for secondary nav */
    .secondary-nav h2 {
        margin-bottom: 0.5rem;
        font-weight: 500;
    }
    .secondary-nav a {
        font-size: 1.25rem;
        font-weight: 400;
    }
    .secondary-nav p {
        font-size: 1.25rem;
    }
    .secondary-menu-grid a {
        font-weight: 500;
    }
}