/* CCL Landing — Primary Navigation */

/* -----------------------------------------------------------------------
   SITE HEADER
   ----------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Gold accent stripe at very top */
.branding-bar {
    height: 4px;
    background-color: var(--color-tertiary);
}

/* Inner flex container */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    min-height: var(--header-height);
}

/* -----------------------------------------------------------------------
   LOGO
   ----------------------------------------------------------------------- */
.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.site-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}
.site-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* -----------------------------------------------------------------------
   SOCIAL ICONS (header)
   ----------------------------------------------------------------------- */
.header-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.header-social a {
    color: var(--color-white);
    font-size: 1rem;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
}
.header-social a:hover,
.header-social a:focus {
    opacity: 1;
    color: var(--color-tertiary);
}

/* -----------------------------------------------------------------------
   HAMBURGER (mobile only)
   ----------------------------------------------------------------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
}
.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-white);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Animated X when open */
body.nav-open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .hamburger-line:nth-child(2) { opacity: 0; }
body.nav-open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -----------------------------------------------------------------------
   NAV LIST — desktop
   ----------------------------------------------------------------------- */
.primary-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list > li {
    position: relative;
}

.nav-list > li > a {
    display: block;
    color: var(--color-white);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    text-decoration: none;
}

.nav-list > li > a:hover,
.nav-list > li > a:focus,
.nav-list > li:hover > a {
    color: var(--color-tertiary);
    background-color: rgba(255,255,255,0.08);
}

/* -----------------------------------------------------------------------
   STANDARD DROPDOWN
   ----------------------------------------------------------------------- */
.nav-list li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: var(--color-white);
    border-top: 3px solid var(--color-tertiary);
    box-shadow: var(--shadow-dropdown);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    z-index: var(--z-dropdown);
}

/* Show on hover (desktop) and focus-within */
.nav-list li:hover > ul,
.nav-list li:focus-within > ul {
    display: block;
}

.nav-list li ul li a {
    display: block;
    color: var(--color-dark);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-list li ul li a:hover,
.nav-list li ul li a:focus {
    color: var(--color-primary);
    background-color: rgba(0, 51, 161, 0.06);
}

/* -----------------------------------------------------------------------
   MEGAMENU  (applies when Teams parent li has class "has-megamenu")
   The structure expected:
     li.has-megamenu
       a  (Teams link)
       ul.sub-menu
         li.division-label  (North Division)
           a
           ul.sub-menu
             li > a  (team link)
         li.division-label  (South Division)
           a
           ul.sub-menu
             li > a  (team link)
   ----------------------------------------------------------------------- */
.nav-list li.has-megamenu > ul {
    width: 100vw;
    display: none;
    flex-direction: row;
    gap: 0;
    padding: 2rem;
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--header-height) + 20px);
    background-color: var(--color-primary);
    /* border-top: 4px solid var(--color-tertiary); */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin: 0;
}

.nav-list li.has-megamenu:hover > ul,
.nav-list li.has-megamenu:focus-within > ul {
    display: flex;
}

/* Each division column */
.nav-list li.has-megamenu > ul > li.division-label {
    flex: 1;
    padding: 0 3rem;
    border-right: 1px solid var(--color-grey-light);
}
.nav-list li.has-megamenu > ul > li.division-label:last-child {
    border-right: none;
}

/* Division header */
.nav-list li.has-megamenu > ul > li.division-label > a {
    color: var(--color-white);
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0 0 1rem 0;
    cursor: default;
    pointer-events: none;
    border-bottom: 3px solid var(--color-tertiary);
    margin-bottom: 0.75rem;
    display: block;
    background: none;
}
.nav-list li.has-megamenu > ul > li.division-label > a:hover {
    background: none;
    color: var(--color-white);
}

/* Inner team list (depth 2) — static, not absolute */
.nav-list li.has-megamenu > ul > li.division-label > ul {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    display: block;
    background: none;
}

.nav-list li.has-megamenu > ul > li.division-label > ul > li > a {
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 0;
    white-space: normal;
    text-decoration: none;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.5;
}
.nav-list li.has-megamenu > ul > li.division-label > ul > li > a:hover,
.nav-list li.has-megamenu > ul > li.division-label > ul > li > a:focus {
    color: var(--color-tertiary);
    background: none;
}

/* Team action icons */
.team-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 0.75rem;
}

/* Text action links (schedule, roster, stats) */
.team-action-text {
    color: var(--color-white) !important;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.team-action-text:hover,
.team-action-text:focus {
    color: var(--color-tertiary);
    text-decoration: underline;
}

/* Separator pipes */
.action-separator {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0.3rem;
}

/* Social icon links */
.team-action-icon {
    color: var(--color-white);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    transition: color var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
}

.team-action-icon:hover,
.team-action-icon:focus {
    color: var(--color-tertiary);
    transform: scale(1.15);
}

/* -----------------------------------------------------------------------
   MOBILE OVERLAY (< 992px)
   ----------------------------------------------------------------------- */
@media (max-width: 991px) {
    .nav-toggle {
        display: flex;
    }

    .header-social {
        display: none; /* hide on mobile to save space */
    }

    .primary-nav {
        position: fixed;
        inset: 0;
        background-color: var(--color-secondary);
        z-index: var(--z-nav-overlay);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
        padding: 5rem 2rem 2rem;
        display: flex;
        flex-direction: column;
    }

    body.nav-open .primary-nav {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }

    .nav-list > li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    .nav-list > li > a {
        font-size: var(--font-size-sm);
        padding: 0.9rem 0;
        color: var(--color-white);
    }

    /* All dropdowns: static and visible when expanded */
    .nav-list li ul {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: rgba(0,0,0,0.15);
        padding: 0 0 0 1rem;
        width: 100%;
    }

    /* JS toggles .is-open on li to show submenu */
    .nav-list li.is-open > ul {
        display: block;
    }

    .nav-list li ul li a {
        color: rgba(255,255,255,0.9);
        font-size: var(--font-size-xs);
        padding: 0.5rem 0;
    }

    /* Megamenu on mobile: flat list, no columns */
    .nav-list li.has-megamenu > ul {
        flex-direction: column;
        min-width: 0;
    }
    .nav-list li.has-megamenu > ul > li.division-label {
        border-right: none;
        padding: 0;
    }
    .nav-list li.has-megamenu > ul > li.division-label > a {
        pointer-events: auto;
        cursor: pointer;
    }
    .nav-list li.has-megamenu > ul > li.division-label > ul {
        background: rgba(0,0,0,0.1);
        padding-left: 1rem;
    }
    .nav-list li.has-megamenu > ul > li.division-label > ul > li > a {
        color: rgba(255,255,255,0.85);
    }
}
