{% load static %}
<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}{{ page_title|default:project_name|default:"RJL Resaka" }}{% endblock %}</title>
  <meta name="description" content="{{ page_description|default:project_description|default:'Messagerie privée moderne pour échanges rapides et notifications de lecture.' }}">
  <meta name="author" content="Flatlogic">
  <meta name="keywords" content="chat privé, messagerie, discussion, RJL Resaka, messenger">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  {% block head %}{% endblock %}
</head>
<body class="resaka-body">
  <div class="resaka-shell">
    <header class="site-header py-3">
      <div class="container-xl">
        <nav class="navbar navbar-expand-lg navbar-dark p-0">
          <a class="navbar-brand brand-mark" href="{% url 'home' %}">RJL <span>Resaka</span></a>
          <button class="navbar-toggler border-0 shadow-none" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Basculer la navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse justify-content-end" id="mainNav">
            <ul class="navbar-nav align-items-lg-center gap-lg-2">
              <li class="nav-item"><a class="nav-link" href="{% url 'home' %}{{ profile_query|default:'' }}">Accueil</a></li>
              <li class="nav-item"><a class="nav-link" href="#workflow">Discussion</a></li>
              <li class="nav-item"><a class="nav-link" href="/admin/">Admin</a></li>
              {% if active_profile %}
              <li class="nav-item profile-pill ms-lg-3">Actif : @{{ active_profile.handle }}</li>
              {% endif %}
            </ul>
          </div>
        </nav>
      </div>
    </header>

    <main>
      {% if messages %}
      <div class="container-xl flash-stack">
        {% for message in messages %}
        <div class="alert alert-{{ message.tags|default:'info' }} shadow-sm border-0" role="alert">{{ message }}</div>
        {% endfor %}
      </div>
      {% endif %}
      {% block content %}{% endblock %}
    </main>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
  <script src="{% static 'js/app.js' %}?v={{ deployment_timestamp }}" defer></script>
  {% block scripts %}{% endblock %}
</body>
</html>
