/* ============================================================
   warcradle-nav.css
   Universal nav styles for all Warcradle brand sites.
   All @media rules are intentionally written as standalone
   blocks (no CSS nesting) for maximum browser compatibility.
   ============================================================ */

/* ── Header wrapper ─────────────────────────────────────────────────────── */

.wc-nav-header {
    background-color: #121216;
    position: relative;
    z-index: 999;

}

/* ── Main nav row ───────────────────────────────────────────────────────── */

.wc-nav {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    font-family: 'Lato', sans-serif;
    box-sizing: border-box;
    gap: 2rem;
    min-height: 80px;
}
/* ── Brand logo ─────────────────────────────────────────────────────────── */

.wc-nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 8px 0;
}

.wc-nav-brand img {
    height: 55px;
    width: auto;
    display: none;
}

/* ── Main link list (desktop) ───────────────────────────────────────────── */

.wc-nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-grow: 1;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-nav-links > li {
    position: relative;
}

/* ── Plain nav link ─────────────────────────────────────────────────────── */

.wc-nav-link {
    display: block;
    padding: 16px 0;
    font-size: 16px !important;
    font-family: 'Lato', "Open Sans", "Helvetica Neue", Arial, sans-serif;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
}

.wc-nav-link:hover {
    opacity: 0.75;
}

/* ── Dropdown toggle ────────────────────────────────────────────────────── */

.wc-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
}

.wc-dropdown-toggle p {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Lato', "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

.wc-dropdown-toggle svg {
    transform: rotate(90deg);
    flex-shrink: 0;
}

/* ── Dropdown menu ──────────────────────────────────────────────────────── */

.wc-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--dropdown-background, #1e1e26);
    min-width: 400px;
    z-index: 1000;
    padding: 20px 0;
    border-radius: 0 0 10px 10px;
}

.wc-dropdown-menu a {
    display: block;
    margin: 10px 16px;
    padding-bottom: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    text-transform: none;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease-in-out;
    width: fit-content;
}

.wc-dropdown-menu a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.wc-nav-links > li.open .wc-dropdown-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

/* ── Browse Full Range CTA button ───────────────────────────────────────── */

.external-cta-button {
    display: inline-block;
    background-color: var(--orange, #e87c2a);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 25px;
    margin-left: auto;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
    text-transform: uppercase;
    text-decoration: none;
}

.external-cta-button:hover {
    background-color: var(--orange-hover, #c9611a);
    color: #fff;
}

/* ── Mobile toggle button ───────────────────────────────────────────────── */

.wc-nav-actions {
    display: none;
    flex-shrink: 0;
}

.wc-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    text-transform: none;
    font-size: inherit;
}

.wc-hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}

/* ── Close button inside sidebar ────────────────────────────────────────── */

.wc-nav-close-item {
    display: none;
    justify-content: flex-end;
    padding-block: 20px;
    width: 100%;
    box-sizing: border-box;
}

.wc-nav-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    position: relative;
    flex-shrink: 0;
    font-size: inherit;
    text-transform: none;
}

.wc-nav-close span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
}

.wc-nav-close span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
}

.wc-nav-close span:nth-child(2) {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ── Mobile overlay (created by JS) ─────────────────────────────────────── */

.wc-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.wc-nav-overlay.open {
    display: block;
}

/* ── Sidebar horizontal rule + socials (hidden on desktop) ─────────────── */

.hl {
    display: none;
}

.wc-socials-container {
    display: none;
}

/* ── Game sub-panels (drill-down, always hidden until JS activates) ─────── */

.wc-game-panel {
    display: none;
    list-style: none;
}

/* Drill-down chevron inside Our Games dropdown (desktop: hidden) */
.wc-drill-icon {
    display: none;
    flex-shrink: 0;
    transform: rotate(0deg) !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   GAME SITE SUB-NAVIGATION (desktop second row)
   ────────────────────────────────────────────────────────────────────────── */

.wc-site-nav {
    background-color: var(--dropdown-background-light, #1a1a22);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 143px;
}

.wc-site-nav-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-site-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-site-nav-link {
    display: block;
    padding: 10px 12px;
    color: var(--grey-300, #b0b0c0);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    text-transform: uppercase;
    text-decoration: none !important;
}

.wc-site-nav-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* Sub-nav dropdown item (e.g. WWX Resources) */

.wc-site-nav-dropdown-item {
    position: relative;
}

.wc-site-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--grey-300, #b0b0c0);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.wc-site-dropdown-toggle svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.wc-site-nav-dropdown-item:hover .wc-site-dropdown-toggle,
.wc-site-nav-dropdown-item.open .wc-site-dropdown-toggle {
    color: #fff;
    border-bottom-color: #fff;
}

.wc-site-nav-dropdown-item.open .wc-site-dropdown-toggle svg {
    transform: rotate(180deg);
}

.wc-site-dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--dropdown-background, #1e1e26);
    min-width: 220px;
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
    z-index: 1000;
}

.wc-site-nav-dropdown-item.open .wc-site-dropdown-menu {
    display: flex;
}

.wc-site-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--grey-300, #b0b0c0);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    text-transform: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.wc-site-dropdown-menu a:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}



/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE — medium screens (1025px – 1280px)
   Nav links wrap naturally; no column-direction stacking.
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
    .wc-nav {
        padding: 0 40px;
    }

    .wc-site-nav {
        padding: 0 40px;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE — mobile (≤ 1024px)
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {

    /* Header */
    .wc-nav {
        padding: 0 20px;
        min-height: 64px;
    }

    /* Protect all nav anchors from brand-CSS element-selector overrides */
    .wc-nav-header a{
        color: #fff;
        text-decoration: none;
        font-family: 'Voltaire', sans-serif;
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
    }


    /* Show hamburger button container */
    .wc-nav-actions {
        display: block;
    }

    /* Show the hamburger icon itself */
    .wc-nav-toggle {
        display: flex;
    }

    /* Sidebar panel */
    .wc-nav-links {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: 75vw;
        max-width: 320px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background-color: #121216;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        pointer-events: none;
        padding: 0;
        box-sizing: border-box;
    }


    .wc-nav-links.open {
        transform: translateX(0);
        pointer-events: auto;
        padding-inline: 30px;
        gap: 0;
    }

    /* Show the close button inside the sidebar */
    .wc-nav-close-item {
        display: flex;
    }

    /* Full-width items in sidebar */
    .wc-nav-links > li {
        width: 100%;
    }

    li.open  .wc-dropdown-toggle p{
        font-size: 22px;
    }

    .wc-nav-link,
    .wc-dropdown-toggle {
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        justify-content: space-between;
        transition: all 0.3s ease-in-out;
    }

    .wc-dropdown-toggle p {
        font-family: 'Voltaire', 'Lato', sans-serif;
        font-size: 16px;
        margin: 0;
    }

    .wc-dropdown-toggle svg {
        transform: rotate(0deg);
    }

    /* Inline dropdown in sidebar */
    .wc-dropdown-menu {
        display: none;
        position: static;
        background-color: #121216;
        min-width: 0;
        padding: 0;
        margin-left: -30px;
        border-radius: 0;
    }

    .wc-nav-links > li.open .wc-dropdown-menu {
        display: grid;
        grid-template-columns: 1fr;
    }

    .wc-dropdown-menu a {
        padding-left: 40px;
        font-family: 'Lato', sans-serif;
        font-size: 16px;
        line-height: 22px;
        font-weight: 700;
        margin: 6px 16px;
    }

    /* When a dropdown is open, hide sibling items (except close btn / socials / CTA) */
    .wc-nav-links:has(li.open) > *:not(li.open):not(.wc-nav-close-item):not(.external-cta-button):not(.wc-socials-container) {
        display: none;
    }

    li.open .wc-dropdown-toggle {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }

    li.open svg {
        transform: rotate(180deg);
    }

    /* Horizontal rule + socials (visible in sidebar) */
    .hl {
        display: block;
        height: 1px;
        background: rgba(255, 255, 255, 0.2);
        width: 100%;
        margin-block: 1.5rem;
    }

    .wc-socials-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin: auto 0;
    }

    .wc-socials {
        display: flex;
        justify-content: space-between;
    }

    /* Browse Full Range button: full-width in sidebar */
    .external-cta-button {
        width: 100%;
        text-align: center;
        margin-left: 0;
        box-sizing: border-box;
        font-family: 'Lato', sans-serif !important;
    }

    /* Desktop sub-nav: hidden on mobile */
    .wc-site-nav {
        display: none;
    }


    /* ── Game entry links: flex row so drill chevron sits on the right ── */
    .wc-dropdown-menu .wc-game-entry-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
    }

    .wc-drill-icon {
        display: block;
    }

    /* ── Panel mode: hide all sidebar items except close btn + active panel ── */
    .wc-nav-links.in-panel > * {
        display: none;
    }

    .wc-nav-links.in-panel > .wc-nav-close-item {
        display: flex;
    }

    .wc-nav-links.in-panel > .wc-game-panel.active {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .wc-nav-links.in-panel > .hl {
        display: block;
    }

    .wc-nav-links.in-panel > .wc-socials-container {
        display: flex;
    }

    /* ── Back button ────────────────────────────────────────────────────── */
    /* Back button doubles as the panel title */
    .wc-panel-back {
        display: flex;
        align-items: center;
        gap: 10px;
        background: none;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        color: #fff;
        font-family: 'Voltaire', "Open Sans", "Helvetica Neue", Arial, sans-serif !important;
        font-size: 22px !important;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        padding: 16px 0 14px;
        margin: 0 0 8px;
        cursor: pointer;
        width: 100%;
        text-align: left;
    }

    .wc-panel-back svg {
        opacity: 0.65;
        flex-shrink: 0;
        transition: opacity 0.2s;
    }

    .wc-panel-back:hover svg {
        opacity: 1;
    }

    /* ── Nav links inside panel ─────────────────────────────────────────── */
    .wc-game-panel .wc-nav-link {
        padding: 10px 0;
        font-family: 'Lato', sans-serif;
    }

    /* Faction drill-down triggers: flex row so chevron sits on the right */
    .wc-game-panel .wc-nav-link[data-panel] {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}