/* =============================================
   NAV.CSS — Responsive Accessible Navigation
   Multiply Ventures
   Brand Colors: #1a2e4a (navy), #f5a623 (gold)
   ============================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #1a2e4a;
    border-bottom: 3px solid #f5a623;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo img {
    height: 48px;
    width: auto;
    display: block;
}

.nav-logo:focus-visible {
    outline: 3px solid #f5a623;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #d6e0ee;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.1);
}

/* CTA Button in Nav */
.nav-cta {
    background: #f5a623;
    color: #1a2e4a !important;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    margin-left: 0.5rem;
}

.nav-cta:hover {
    background: #e09518;
    color: #1a2e4a !important;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 2px solid #f5a623;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
}

.hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: #f5a623;
    border-radius: 2px;
    transition: transform 0.3s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        /* FIX hidden-content: use visibility+clip instead of display:none
           so axe can analyze menu contents even when closed */
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #1a1a2e;
        padding: 1rem;
        gap: 0.25rem;
        border-bottom: 3px solid #fe9a4f;
        /* Hidden state — visually hidden but DOM-present */
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: visibility 0s linear 0.15s, opacity 0.15s ease, transform 0.15s ease;
        z-index: 998;
    }

    .nav-menu.open {
        /* Open state */
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 0s;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .nav-cta {
        text-align: center;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* ---- SEBI Accessibility Toolbar ---- */
.a11y-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(245,166,35,0.3);
    margin-left: 0.5rem;
}

.a11y-label {
    color: #9aa0b8;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.1rem;
    display: none; /* hidden visually, present for context */
}

.a11y-btn {
    background: transparent;
    color: #d6e0ee;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
}

.a11y-btn:hover,
.a11y-btn:focus-visible {
    background: rgba(254,110,0,0.2);
    color: #fe6e00;
    border-color: #fe6e00;
}

.a11y-btn[aria-pressed="true"] {
    background: #fe6e00;
    color: #ffffff;
    border-color: #fe6e00;
}

.contrast-btn svg {
    display: block;
}

/* High Contrast Mode styles */
body.high-contrast {
    filter: contrast(1.5) saturate(0);
}

body.high-contrast .navbar {
    background: #000000 !important;
    border-bottom: 3px solid #ffff00 !important;
}

body.high-contrast .nav-link { color: #ffffff !important; }
body.high-contrast .nav-link:hover { color: #ffff00 !important; }

/* Font size scale classes */
body.font-large  { font-size: 112% !important; }
body.font-xlarge { font-size: 125% !important; }

@media (max-width: 768px) {
    .a11y-toolbar {
        display: none; /* Hidden in mobile — accessible via settings */
    }
}
/* =============================================
   FIX hidden-content audit issue:
   Replace display:none with visibility-based hiding
   so axe can analyze nav menu contents on mobile
   ============================================= */
@media (max-width: 768px) {
    .nav-menu {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #1a1a2e;
        padding: 1rem;
        gap: 0.25rem;
        border-bottom: 3px solid #fe9a4f;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: visibility 0s linear 0.15s,
                    opacity 0.15s ease,
                    transform 0.15s ease;
        z-index: 998;
    }

    .nav-menu.open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 0s;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .nav-cta {
        text-align: center;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* =============================================
   FIX hidden-content: Complete mobile nav fix
   WCAG + axe compliant approach:
   - Never use display:none or visibility:hidden
   - Menu always in accessibility tree
   - Visual hiding via transform + clip only
   - JS toggles .open class
   ============================================= */
@media (max-width: 768px) {

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        /* Always in DOM and accessibility tree — axe can analyze ✓ */
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #1a1a2e;
        padding: 0;
        gap: 0;
        border-bottom: 3px solid #fe9a4f;
        z-index: 998;

        /* Visual hiding — does NOT remove from accessibility tree
           Uses max-height + overflow:hidden for smooth animation
           Combined with pointer-events:none so hidden links
           cannot be accidentally clicked while menu appears closed */
        max-height: 0;
        overflow: hidden;
        pointer-events: none;

        /* Smooth open/close animation */
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .nav-menu.open {
        /* Open state — fully visible and interactive */
        max-height: 400px;
        padding: 0.75rem;
        pointer-events: auto;
        overflow: visible;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu .nav-link {
        display: block;
        font-size: 1rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .nav-cta {
        text-align: center;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .a11y-toolbar {
        display: none;
    }
}

/* ---- A11y Button Active State ---- */
.a11y-btn-active {
    background: #fe6e00 !important;
    color: #ffffff !important;
    border-color: #fe6e00 !important;
}

/* Ensure A/A+/A++ text inside button displays correctly */
.a11y-btn-text {
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    pointer-events: none;
}
