{# ══════════════════════════════════════════════════════════════
   templates/partials/_header.html.twig
   Header principal — inclus depuis base.html.twig
   ══════════════════════════════════════════════════════════════ #}

{% set current_route = app.request.attributes.get('_route') %}

<header data-controller="header-mobile">

    {# ── Gauche : Logo + Navigation ───────────────────────────── #}
    <div class="header-left">
        <button class="hamburger" data-action="click->header-mobile#toggle" aria-label="Menu">
            <span></span>
            <span></span>
            <span></span>
        </button>

        <a href="{{ path('app_accueil') }}" class="logo">
            <img src="{{ asset('images/logo/logo-light.svg') }}" alt="Logo" class="logo-light">
            <img src="{{ asset('images/logo/logo-dark.svg') }}" alt="Logo" class="logo-dark">
        </a>

        <nav data-header-mobile-target="menu">
            <a href="{{ path('app_accueil') }}"
               class="nav-link {{ current_route == 'app_accueil' ? 'active' }}"
               data-action="click->header-mobile#close"
            >
                Accueil
            </a>
            <a href="{{ path('app_modpack') }}"
               class="nav-link {{ current_route == 'app_modpack' ? 'active' }}"
               data-action="click->header-mobile#close"
            >
                Modpack
            </a>
            <a href="{{ path('app_accueil') }}"
               class="nav-link {{ current_route == 'app_home' ? 'active' }}"
               data-action="click->header-mobile#close"
            >
                Statistiques
            </a>
            <a href="{{ path('app_news') }}"
               class="nav-link {{ current_route == 'app_news' ? 'active' }}"
               data-action="click->header-mobile#close"
            >
                Actualité
            </a>
            <a href="{{ path('app_calculator') }}"
               class="nav-link {{ current_route == 'app_calculator' ? 'active' }}"
               data-action="click->header-mobile#close"
            >
                Calculateur
            </a>
            <a href="{{ path('app_maps') }}"
               class="nav-link {{ current_route == 'app_maps' ? 'active' }}"
               data-action="click->header-mobile#close"
            >
                Maps
            </a>
        </nav>

    </div>

    {# ── Droite : Actions (thème + connexion) ─────────────────── #}
    <div class="header-actions">
        {% include 'partials/_theme_toggle.html.twig' %}
        {% if is_granted('ROLE_USER') %}
            {% include 'partials/_logout_dropdown.html.twig' %}
        {% else %}
             {% include 'partials/_login_dropdown.html.twig' %}
        {% endif %}
    </div>

</header>
