<div class="card mb-3">
  <div class="card-body">
    <h5 class="card-title">Related collections</h5>

    <ul class="list-unstyled">
      {% for item in related_collections %}
        <li>
          <a href="{% url 'atlas:collection_detail' item.collection.pk %}">{{ item.collection.name }}</a>
          {% if item.is_author %}<span class="badge bg-primary ms-2">Author</span>{% endif %}
          {% if item.is_marker %}<span class="badge bg-secondary ms-2">Marker</span>{% endif %}
          {% if item.collection.description %}<small class="text-muted"> — {{ item.collection.description }}</small>{% endif %}
        </li>
      {% empty %}
        <li class="text-muted">No related collections.</li>
      {% endfor %}
    </ul>

    <div class="mt-3">
      <a href="{% url 'atlas:collection_view' %}" class="btn btn-sm btn-outline-primary">View all collections</a>
    </div>

  </div>
</div>