{% 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:"NearbyNest" }}{% endblock %}</title>
  <meta name="description" content="{% block meta_description %}{{ meta_description|default:project_description|default:'Mobile-first public property pinboard for nearby sale and rental sightings.' }}{% endblock %}">
  {% if project_description %}
  <meta property="og:description" content="{{ project_description }}">
  <meta property="twitter:description" content="{{ project_description }}">
  {% endif %}
  {% 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=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans: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">
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  {% block head %}{% endblock %}
</head>

<body>
  <header class="site-header sticky-top">
    <nav class="navbar navbar-expand-lg">
      <div class="container py-2">
        <a class="navbar-brand brand-mark" href="{% url 'home' %}" aria-label="NearbyNest home">
          <span class="brand-icon">⌂</span><span>NearbyNest</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 'property_list' %}">Browse</a></li>
            <li class="nav-item"><a class="nav-link" href="{% url 'onboarding' %}">Onboarding</a></li>
            <li class="nav-item"><a class="nav-link" href="{% url 'add_photo_property' %}">Upload photo</a></li>
            <li class="nav-item"><a class="btn btn-nest btn-sm" href="{% url 'add_location_property' %}">Pin property</a></li>
            <li class="nav-item"><a class="nav-link admin-link" href="/admin/">Admin</a></li>
          </ul>
        </div>
      </div>
    </nav>
  </header>

  {% if messages %}
  <div class="container flash-stack" aria-live="polite">
    {% for message in messages %}
    <div class="alert alert-{{ message.tags|default:'info' }} shadow-sm mb-2">{{ message }}</div>
    {% endfor %}
  </div>
  {% endif %}

  {% block content %}{% endblock %}

  <footer class="site-footer">
    <div class="container d-flex flex-column flex-md-row justify-content-between gap-3">
      <span>NearbyNest MVP · Public property sightings</span>
      <span>Built for PWA now, mobile app later</span>
    </div>
  </footer>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  <script src="{% static 'js/pinboard.js' %}?v={{ deployment_timestamp }}" defer></script>
  {% block scripts %}{% endblock %}
</body>

</html>
