/* ============================================================
   v2 header + footer overrides for LEGACY pages (US10033).
   Load AFTER style.css. Gives old-theme pages the redesigned
   dark header/nav/mega and dark footer WITHOUT touching their
   body styling. Source of truth for the look: css/v2.css —
   keep these blocks in sync until legacy pages migrate to v2.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --v2-ink: #0e1116;
    --v2-ink-2: #1a1f27;
    --v2-red: #e8304f;
    --v2-red-dark: #c01a34;
    --v2-line-dark: rgba(255, 255, 255, 0.14);
    --v2-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --v2-display: 'Archivo', system-ui, sans-serif;
}

/* ── Header ─────────────────────────────────────────────── */
header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 200;
    background: rgba(14, 17, 22, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--v2-line-dark);
    box-shadow: none;
}
header > .container, header .container {
    max-width: 1280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    padding-top: 0;
    padding-bottom: 0;
}
header .logo-img { height: 46px; width: auto; display: block; filter: none; }

header .nav-links {
    display: flex;
    align-items: center;
    gap: 1.9rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
header .nav-links > li > a {
    font-family: var(--v2-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    padding: 0.4rem 0;
    transition: color 0.15s ease;
}
header .nav-links > li > a:hover { color: #fff; }
header .nav-links a::after { display: none; }   /* kill style.css underline animation */
header .nav-links .caret { font-size: 0.6rem; opacity: 0.6; }

/* nav CTA button */
header .nav-links a.btn, header .nav-links a.btn.btn-primary {
    font-family: var(--v2-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--v2-red);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.55rem 1.1rem;
    box-shadow: none;
}
header .nav-links a.btn:hover { background: var(--v2-red-dark); color: #fff; transform: none; }

/* ── Mega dropdown ──────────────────────────────────────── */
header .has-mega { position: relative; }
header .mega {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--v2-ink-2);
    border: 1px solid var(--v2-line-dark);
    border-radius: 3px;
    padding: 0.5rem;
    min-width: 300px;
    display: grid;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
header .mega::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}
/* 969px matches js/main.js isMobile() — keep them in sync */
@media (min-width: 969px) {
    header .has-mega:hover .mega, header .has-mega:focus-within .mega {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}
header .mega-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    text-decoration: none;
    border-radius: 2px;
    background: transparent;
    transition: background 0.14s ease;
}
header .mega-item:hover { background: rgba(255, 255, 255, 0.06); }
header .mega-ic {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-red);
    background: transparent;
    border: 1px solid var(--v2-line-dark);
    border-radius: 2px;
}
header .mega-ic svg { width: 16px; height: 16px; }
header .mega-tx { display: flex; flex-direction: column; gap: 0.1rem; }
header .mega-tx strong { color: #fff; font-size: 0.88rem; font-weight: 600; letter-spacing: -0.01em; }
header .mega-tx small { color: rgba(255, 255, 255, 0.55); font-size: 0.76rem; }
header .mega-all {
    border-top: 1px solid var(--v2-line-dark);
    margin-top: 2px;
    padding: 0.65rem 0.85rem;
    font-family: var(--v2-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--v2-red);
    text-decoration: none;
}

header .mobile-menu-btn { color: #fff; background: none; border: 0; }

/* ── Footer ─────────────────────────────────────────────── */
footer {
    background: var(--v2-ink);
    color: rgba(255, 255, 255, 0.7);
    padding: 3.5rem 0 2rem;
    border-top: 3px solid var(--v2-red);
}
footer .footer-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
footer .footer-section h4 {
    font-family: var(--v2-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--v2-red);
    margin-bottom: 1rem;
}
footer .footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.68) !important;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.22rem 0;
    transition: color 0.15s ease;
}
footer .footer-section a:hover { color: #fff !important; }
footer .footer-section p { color: rgba(255, 255, 255, 0.55); font-size: 0.9rem; line-height: 1.7; }
footer .social-links { display: flex; gap: 0.7rem; margin-top: 1.1rem; }
footer .social-link {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v2-line-dark);
    border-radius: 2px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.15s ease, border-color 0.15s ease;
}
footer .social-link:hover { color: #fff; border-color: #fff; background: transparent; }
footer .footer-bottom {
    border-top: 1px solid var(--v2-line-dark);
    padding-top: 1.4rem;
    font-family: var(--v2-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
}
footer .footer-bottom a { color: rgba(255, 255, 255, 0.4); }

/* ── Mobile nav — 968px matches js/main.js isMobile() ───── */
@media (max-width: 968px) {
    /* backdrop-filter would make header the containing block for the fixed
       nav panel (collapsing it to the 72px bar) — solid background instead */
    header { backdrop-filter: none; background: rgba(14, 17, 22, 0.98); }
    /* empty <nav> wrapper still takes the middle space-between slot;
       push the hamburger to the right edge */
    header .mobile-menu-btn { display: block; order: 3; }
    header .logo-img { height: 40px; }
    header .nav-links {
        position: fixed;
        z-index: 300;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--v2-ink);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem 1.5rem 2.5rem;
        overflow-y: auto;
        display: none;
        border-top: 1px solid var(--v2-line-dark);
        box-shadow: none;
    }
    header .nav-links.active { display: flex; }
    header .nav-links > li { border-bottom: 1px solid var(--v2-line-dark); }
    header .nav-links > li > a { display: flex; justify-content: space-between; padding: 1rem 0.2rem; font-size: 0.86rem; }
    header .mega {
        position: static;
        transform: none;
        opacity: 1;
        visibility: hidden;
        display: none;
        box-shadow: none;
        border: 0;
        border-left: 2px solid var(--v2-red);
        border-radius: 0;
        margin: 0 0 1rem 0.4rem;
        min-width: 0;
        background: transparent;
    }
    header .has-mega.open .mega { display: grid; visibility: visible; }
    header .nav-cta { margin-top: 1.2rem; border-bottom: 0 !important; }
    header .nav-cta .btn { width: 100%; }
    footer .footer-content { grid-template-columns: 1fr 1fr; }
}
