<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="{{ config.seo.meta_description }}">
    <meta name="keywords" content="{{ config.seo.meta_keywords }}">
    <title>{% block title %}{{ config.seo.site_title }}{% endblock %}</title>
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
</head>
<body>

    <!-- ─── Navigation ──────────────────────────────────────────────────── -->
    <nav class="navbar">
        <div class="nav-container">
            <a href="{% url 'projects:home' %}" class="nav-logo">
                <span class="logo-bracket">&lt;</span>
                {{ config.navbar.logo_text }}
                <span class="logo-bracket">/&gt;</span>
            </a>
            <ul class="nav-links">
                {% for link in config.navbar.links %}
                <li>
                    <a href="{% url link.url_name %}{{ link.anchor }}"
                       class="nav-link {% if request.resolver_match.url_name == 'home' and forloop.first %}active{% endif %}{% if 'projet' in request.path and forloop.counter == 2 %}active{% endif %}">
                        {{ link.label }}
                    </a>
                </li>
                {% endfor %}
            </ul>
            <button class="nav-toggle" id="navToggle" aria-label="Menu">
                <span></span><span></span><span></span>
            </button>
        </div>
    </nav>

    <!-- ─── Contenu principal ────────────────────────────────────────────── -->
    <main class="main-content">
        {% block content %}{% endblock %}
    </main>

    <!-- ─── Footer ──────────────────────────────────────────────────────── -->
    <footer class="footer">
        <div class="footer-container">
            <p class="footer-text">
                <span class="logo-bracket">&lt;</span>
                {{ config.footer.name }} — {{ config.footer.role }}
                <span class="logo-bracket">/&gt;</span>
            </p>
            <p class="footer-sub">{{ config.footer.built_with }} · {{ total_projects }} projet{{ total_projects|pluralize }}</p>
        </div>
    </footer>

    <script src="{% static 'js/main.js' %}"></script>
    {% block extra_js %}{% endblock %}
</body>
</html>
