/* ----------- Barre de navigation ----------- */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(13, 27, 52, 0.96); /* bleu foncé */
    color: #fff;
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Logo dans la barre de navigation --- */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;

    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #ffffff;

    white-space: nowrap; /* évite les sauts de ligne */
}

.nav-logo {
    height: 80px;  /* 2 fois plus gros */
    width: auto;
    display: block;
    filter: drop-shadow(0px 1px 3px rgba(0,0,0,0.25));
}


.nav-brand-highlight {
    font-weight: 700;
    /* si tu veux le laisser blanc, ne touche à rien,
       ou mets une petite couleur si tu veux le faire ressortir */
    /* color: #c62828; */
}

/* Liens du menu (desktop) */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 2px;
}

/* petit trait rouge sous le lien au hover */
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: #c62828;
    transition: width 0.2s ease-out;
}

.nav-links a:hover::after {
    width: 100%;
}

/* élément de menu avec sous-menu */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

/* lien principal dans un nav-item */
.nav-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sous-menu (desktop) */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(13, 27, 52, 0.98);
    padding: 8px 0;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;

    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}

.submenu a {
    padding: 4px 12px;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Affichage du sous-menu au survol (desktop) */
.has-submenu:hover .submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ----------- Bouton burger ----------- */
.nav-toggle {
    display: none; /* caché sur desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    margin: 4px 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* état ouvert du burger */
.nav-toggle.nav-toggle--open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-toggle.nav-toggle--open span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.nav-toggle--open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ----------- Responsive (mobile) ----------- */

@media (max-width: 768px) {

    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(13, 27, 52, 0.98);
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 20px 15px;
        gap: 10px;
        display: none;
    }

    .nav-links.nav-links--open {
        display: flex;
    }

    .nav-links a {
        padding: 4px 0;
        width: 100%;
    }

    /* >>> CORRECTION POUR LE SOUS-MENU SUR MOBILE <<< */

    /* Le bloc "Tournois" devient une colonne */
    .nav-item {
        display: flex;
        flex-direction: column;   /* important */
        align-items: flex-start;  /* important */
        width: 100%;
    }

    /* Le sous-menu se met sous "Tournois" */
    .submenu {
        position: static;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        background: none;
        padding: 4px 0 0 16px;    /* petit retrait vers la droite */
        gap: 4px;
    }

    .submenu a {
        font-size: 0.9rem;
        padding: 2px 0;
        width: 100%;
    }
}
