/* =====================================================
   Meniu de mobil — Asociația Călăreții Roșii
   Butonul hamburger + panoul de navigație pe ecrane mici.
   Folosește variabilele CSS definite în <style> din index.php.
   ===================================================== */

/* Butonul hamburger — ascuns implicit (desktop) */
.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 60;
}
.nav__toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.25s ease, background 0.25s ease;
}

@media (max-width: 640px) {
    /* Permite navului să treacă pe rând nou când meniul e deschis */
    .nav {
        flex-wrap: wrap;
    }
    /* Fundal opac când meniul e deschis, ca textul să fie lizibil peste hero */
    .nav--open {
        background: rgba(13, 13, 15, 0.97);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__toggle {
        display: flex;
    }

    /* Panoul de linkuri — dropdown pe toată lățimea */
    .nav__links {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-top: 1rem;
        /* stare inchisă */
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.35s ease, opacity 0.3s ease;
    }
    .nav--open .nav__links {
        max-height: 340px;
        opacity: 1;
        pointer-events: auto;
    }

    .nav__links li {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav__links a {
        display: block;
        padding: 0.9rem 0.25rem;
        color: var(--text);
    }
    /* Dezactivează sublinierea animată de desktop în meniul mobil */
    .nav__links a::after {
        display: none;
    }
    .nav__links a:active {
        color: var(--rosu-neon);
    }

    /* Link extern evidențiat — buton full-width în meniul mobil */
    .nav__links li:has(.nav__ext) {
        border-top: none;
    }
    .nav__links .nav__ext {
        justify-content: center;
        margin: 0.8rem 0 0.2rem;
        padding: 0.85rem 1rem;
        background: var(--rosu);
        color: #fff;
        border-color: var(--rosu-neon);
        border-radius: 10px;
        box-shadow: 0 0 16px var(--rosu-glow);
    }

    /* Hamburger -> X când meniul e deschis */
    .nav--open .nav__toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        background: var(--rosu-neon);
    }
    .nav--open .nav__toggle span:nth-child(2) {
        opacity: 0;
    }
    .nav--open .nav__toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        background: var(--rosu-neon);
    }
}
