<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}{{ page_title|default:"Dijon Job Aggregator" }}{% endblock %}</title>
  <meta name="description" content="{% block meta_description %}{{ meta_description|default:project_description|default:'Pilot dashboard for aggregating job offers around Dijon.' }}{% endblock %}">
  {% if project_image_url %}
  <meta property="og:image" content="{{ project_image_url }}">
  <meta property="twitter:image" content="{{ project_image_url }}">
  {% endif %}
  {% load static %}
  <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=Space+Grotesk:wght@600;700&display=swap" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  {% block head %}{% endblock %}
</head>

<body>
  <a class="skip-link" href="#main-content">Skip to content</a>
  <nav class="navbar navbar-expand-lg app-nav sticky-top" aria-label="Main navigation">
    <div class="container">
      <a class="navbar-brand brand-lockup" href="{% url 'home' %}">
        <span class="brand-mark">DJA</span>
        <span>Dijon Job Aggregator</span>
      </a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="mainNav">
        <ul class="navbar-nav ms-auto align-items-lg-center gap-lg-2">
          <li class="nav-item"><a class="nav-link" href="{% url 'job_list' %}">Jobs</a></li>
          <li class="nav-item"><a class="nav-link" href="{% url 'ops_dashboard' %}">Ops</a></li>
          <li class="nav-item"><a class="nav-link" href="{% url 'source_create' %}">Add source</a></li>
          <li class="nav-item"><a class="nav-link" href="{% url 'job_create' %}">Add offer</a></li>
          <li class="nav-item"><a class="btn btn-sm btn-outline-dark rounded-pill px-3" href="/admin/">Admin</a></li>
        </ul>
      </div>
    </div>
  </nav>

  {% if messages %}
  <div class="container message-stack" aria-live="polite">
    {% for message in messages %}
    <div class="alert alert-{{ message.tags|default:'info' }} alert-dismissible fade show shadow-sm" role="alert">
      {{ message }}
      <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
    </div>
    {% endfor %}
  </div>
  {% endif %}

  <main id="main-content">
    {% block content %}{% endblock %}
  </main>

  <footer class="app-footer">
    <div class="container d-flex flex-column flex-md-row justify-content-between gap-3">
      <span>Built for a progressive Dijon scraping platform pilot.</span>
      <span class="text-muted">Next: connectors, dedupe, metrics, and scheduler.</span>
    </div>
  </footer>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" defer></script>
</body>

</html>
