{% extends "base.html" %}

{% block title %}Tag Results{% endblock %}

{% block content %}

<!-- Hero Section -->
<section class="text-center py-20 bg-gradient-to-br from-red-800 to-orange-400 text-white">
  <h1 class="text-5xl font-extrabold mb-4">Posts Tagged: <span class="text-white">#{{ tag }}</span></h1>
  <p class="text-lg">Here are all blog posts with this tag.</p>
</section>

<!-- Tag Results Content -->
<section class="py-16 bg-black text-white">
  <div class="max-w-5xl mx-auto px-4">
    {% if blogpost %}
      <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
        {% for blogpost in blogpost %}
        <div class="bg-white rounded-lg shadow p-6 hover:shadow-lg transition">
          <h2 class="text-2xl font-bold text-red-800 mb-2">
            <a href="{{ url_for('view_blog', slug=blogpost.slug) }}" class="hover:underline">
              {{ blogpost.title }}
            </a>
          </h2>
          <p class="text-sm text-orange-500 font-medium">{{ blogpost.category }}</p>
        </div>
        {% endfor %}
      </div>
    {% else %}
      <p class="text-center text-lg text-gray-600">No posts found with this tag.</p>
    {% endif %}
  </div>
</section>

{% endblock %}
