{% extends 'public_frontend/base.html' %}
{% block title %}Listing {{ listing.id }}{% endblock %}
{% block content %}
<article class="bg-white rounded shadow p-6">
  <h1 class="text-2xl font-semibold mb-1">{{ listing.title }}</h1>
  <div class="text-sm text-gray-500 mb-4">Status: {{ listing.status }}{% if listing.ends_at %} • Ends {{ listing.ends_at }}{% endif %}</div>
  <p class="prose max-w-none">{{ listing.description|linebreaks }}</p>
  <h2 class="font-semibold mt-6 mb-2">Items</h2>
  <ul class="list-disc ml-6 text-sm text-gray-700">
  {% for it in listing.items.all %}
    <li>{{ it.material.name }} — {{ it.quantity_estimate }} {{ it.get_unit_display }}</li>
  {% empty %}
    <li>No items listed</li>
  {% endfor %}
  </ul>
</article>
{% endblock %}
