{% load static %}
<!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:"Signal" }}{% endblock %}</title>
  <meta name="description" content="{{ meta_description|default:project_description|default:'Signal is a polished startup and tech newsroom with curated RSS feeds and original editorial publishing.' }}">
  <meta name="author" content="Signal Editorial Desk">
  {% if project_image_url %}
  <meta property="og:image" content="{{ project_image_url }}">
  <meta property="twitter:image" content="{{ project_image_url }}">
  {% endif %}
  <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=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600;700&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>
  <div class="page-shell">
    <div class="orb orb-a"></div>
    <div class="orb orb-b"></div>
    <header class="site-header py-3">
      <nav class="navbar navbar-expand-lg navbar-dark newsroom-nav">
        <div class="container">
          <a class="navbar-brand d-flex align-items-center gap-2" href="{% url 'home' %}">
            <span class="brand-mark">S</span>
            <span class="brand-word">Signal</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 'article_list' %}">Stories</a></li>
              <li class="nav-item"><a class="nav-link" href="{% url 'article_submit' %}">Publish</a></li>
              <li class="nav-item"><a class="nav-link" href="/admin/">Admin</a></li>
              <li class="nav-item mt-3 mt-lg-0"><a class="btn btn-signal" href="{% url 'article_submit' %}">Open CMS</a></li>
            </ul>
          </div>
        </div>
      </nav>
    </header>

    <main>
      {% if messages %}
      <div class="container pt-2">
        {% for message in messages %}
        <div class="alert alert-success signal-alert mb-0 mt-2" role="alert">{{ message }}</div>
        {% endfor %}
      </div>
      {% endif %}
      {% block content %}{% endblock %}
    </main>

    <footer class="site-footer py-5">
      <div class="container d-flex flex-column flex-lg-row justify-content-between gap-3 align-items-lg-center">
        <div>
          <p class="footer-brand mb-1">Signal — startup & tech stories with editorial taste.</p>
          <p class="footer-copy mb-0">Built for fast scanning, smart curation, and in-house publishing.</p>
        </div>
        <div class="footer-links d-flex flex-wrap gap-3">
          <a href="{% url 'home' %}">Home</a>
          <a href="{% url 'article_list' %}">Latest stories</a>
          <a href="{% url 'article_submit' %}">Submit a story</a>
          <a href="/admin/">Django admin</a>
        </div>
      </div>
    </footer>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous" defer></script>
  <script src="{% static 'js/newsroom.js' %}?v={{ deployment_timestamp }}" defer></script>
</body>
</html>
