/* =========================================================
   HEADER + NARROW DESKTOP LAYOUT
   File: css/shared/header-responsive.css
   Loaded AFTER main_theme so these rules win on small screens.
   Mobile product (/m) uses mobile/css/app.css instead.
   ========================================================= */

/* Hamburger / menu toggle (hidden on wide screens) */
.menu-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.hamburger-icon {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 42px;
    height: 34px;
    padding: 7px 8px;
    box-sizing: border-box;
    cursor: pointer;
    z-index: 10050;
    border: 1px solid var(--primary-green, #09f530);
    background: rgba(0, 0, 0, 0.65);
    box-shadow: var(--neon-glow, 0 0 8px rgba(9, 245, 48, 0.4));
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-icon .bar {
    width: 100%;
    height: 3px;
    background-color: var(--primary-green, #09f530);
    box-shadow: var(--neon-glow, 0 0 5px rgba(9, 245, 48, 0.4));
    transition: transform 0.25s ease, opacity 0.2s ease;
}

#menu-toggle:checked + .hamburger-icon .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
#menu-toggle:checked + .hamburger-icon .bar:nth-child(2) {
    opacity: 0;
}
#menu-toggle:checked + .hamburger-icon .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Soft banner when desktop chrome is too wide for the glass */
.desktop-narrow-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(9, 245, 48, 0.35);
    background: rgba(9, 245, 48, 0.08);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: #c8f5c8;
    text-align: left;
}

.desktop-narrow-banner a {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--primary-green, #09f530);
    white-space: nowrap;
}

.desktop-narrow-banner .dnb-msg {
    flex: 1 1 12rem;
    min-width: 0;
    line-height: 1.35;
}

.site-version-badge {
    margin-left: 12px;
    font-family: var(--crt-font, 'Courier New', monospace);
    font-size: 0.72rem;
    color: #00ff88;
    border: 1px solid #00aa55;
    padding: 2px 8px;
    letter-spacing: 1px;
    white-space: nowrap;
    align-self: center;
    opacity: 0.95;
}

/* ---------- Tablet / narrow desktop window ---------- */
@media screen and (max-width: 960px) {
    header,
    header.header-main {
        padding: 1.1rem 0.85rem 0.9rem !important;
        width: 100%;
        box-sizing: border-box;
        position: relative;
    }

    .desktop-narrow-banner {
        display: flex;
    }

    .hamburger-icon {
        display: flex !important;
        position: absolute;
        top: 0.85rem;
        left: 0.75rem;
    }

    .brand-center {
        width: 100%;
        padding: 0 2.75rem;
        box-sizing: border-box;
        margin-bottom: 0 !important;
    }

    .wizard-logo,
    .logo.wizard-logo,
    .logo,
    header .wizard-logo {
        height: 112px !important;
        width: 112px !important;
        margin-bottom: 0.65rem !important;
        margin-left: 0 !important;
    }

    #main-title,
    .header-main h1,
    header h1 {
        font-size: clamp(1.3rem, 5.2vw, 2.4rem) !important;
        letter-spacing: clamp(2px, 0.3vw, 7px) !important;
        line-height: 1.15 !important;
        max-width: 100%;
        word-break: break-word;
        margin-left: 0 !important;
        padding: 0 0.25rem;
        box-sizing: border-box;
    }

    #flash-overlay {
        width: min(420px, 90vw) !important;
        height: min(420px, 90vw) !important;
    }

    /* Collapsed nav drawer (checkbox sibling pattern) */
    .nav-links {
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0.15rem !important;
        margin-top: 0.85rem !important;
        width: 100% !important;
        max-width: 28rem;
        padding: 0.5rem !important;
        box-sizing: border-box;
        border: 1px solid rgba(9, 245, 48, 0.35);
        background: rgba(0, 0, 0, 0.88);
        box-shadow: 0 0 18px rgba(9, 245, 48, 0.12);
        position: static !important;
        left: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    #menu-toggle:checked ~ .nav-links,
    .menu-toggle:checked ~ .nav-links {
        display: flex !important;
    }

    .nav-links a {
        font-size: 0.95rem !important;
        padding: 0.7rem 0.85rem !important;
        text-align: left;
        border: none !important;
        border-bottom: 1px solid rgba(9, 245, 48, 0.15) !important;
        display: block;
        width: 100%;
        box-sizing: border-box;
        letter-spacing: 1px;
    }

    .nav-links a:last-of-type {
        border-bottom: none !important;
    }

    .nav-links a:hover,
    .nav-links a:active {
        transform: none !important;
        background: rgba(9, 245, 48, 0.1);
        color: var(--primary-green, #09f530) !important;
    }

    .site-version-badge {
        margin: 0.5rem 0 0 !important;
        align-self: flex-start;
        font-size: 0.65rem;
    }

    .back-to-top-btn {
        bottom: 12px;
        right: 12px;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Terminal / auth: don't pin full viewport height on narrow desktop */
    .terminal-main-frame {
        height: auto !important;
        min-height: 50vh;
        max-width: 100%;
        padding: 0.5rem !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
    }

    .ai-terminal-box {
        padding: 1rem 1rem !important;
    }

    .terminal-main-frame.auth-view {
        min-height: auto !important;
        padding-top: 0.5rem !important;
    }
}

/* ---------- Phone-width desktop mode ---------- */
@media screen and (max-width: 560px) {
    header,
    header.header-main {
        padding: 0.85rem 0.6rem 0.75rem !important;
    }

    .hamburger-icon {
        top: 0.7rem !important;
        left: 0.55rem !important;
        width: 40px;
        height: 32px;
    }

    .brand-center {
        padding: 0 2.5rem;
    }

    .wizard-logo,
    .logo.wizard-logo,
    .logo,
    header .wizard-logo {
        height: 84px !important;
        width: 84px !important;
        margin-bottom: 0.45rem !important;
        border-width: 1.5px;
    }

    #main-title,
    .header-main h1,
    header h1 {
        font-size: clamp(1.1rem, 6.5vw, 1.65rem) !important;
        letter-spacing: 2px !important;
        text-shadow:
            0 0 2px #09f530,
            0 0 10px #09f530,
            0 0 18px rgba(9, 245, 48, 0.35) !important;
    }

    .desktop-narrow-banner {
        font-size: 0.72rem;
        padding: 0.45rem 0.55rem;
    }

    .desktop-narrow-banner a {
        font-size: 0.72rem;
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 0.88rem !important;
        padding: 0.65rem 0.7rem !important;
    }

    .query-row,
    .query-sticky-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #ai-input {
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    #ai-submit-btn {
        width: 100%;
    }
}

/* Landscape short screens */
@media screen and (max-height: 480px) and (orientation: landscape) {
    header,
    header.header-main {
        padding: 0.4rem 0.6rem !important;
    }

    .desktop-narrow-banner {
        display: none;
    }

    .wizard-logo,
    header .wizard-logo {
        height: 52px !important;
        width: 52px !important;
        margin-bottom: 0.25rem !important;
    }

    #main-title,
    .header-main h1 {
        font-size: 1.2rem !important;
        letter-spacing: 3px !important;
    }

    .hamburger-icon {
        top: 0.45rem !important;
        left: 0.45rem !important;
    }

    .nav-links {
        max-height: 60vh;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}


/* v0.41 — hamburger opens forge dock; hide unused menu-toggle chrome if present */
.menu-toggle,
.hamburger-icon {
  display: none !important;
}
