{% extends "base.html" %}

{% block title %}{{ post.title }}{% endblock %}

{% block content %}

<article class="py-16 pb-28" style="background: #0a0a14;">
    <div class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">

        <!-- Back link -->
        <div class="mb-10">
            <a href="{{ url_for('blog_index') }}" class="inline-flex items-center gap-2 text-sm font-medium text-primary-400 hover:text-primary-300 transition-colors">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16l-4-4m0 0l4-4m-4 4h18"/>
                </svg>
                Back to Blog
            </a>
        </div>

        <!-- Post header -->
        <header class="mb-12">
            <div class="badge badge-primary mb-6">Article</div>
            <h1 class="text-4xl md:text-5xl font-extrabold mb-7 leading-tight" style="font-family: 'Syne', sans-serif; color: #f1f0ff;">
                {{ post.title }}
            </h1>
            <div class="flex items-center gap-4 pb-8" style="border-bottom: 1px solid rgba(255,255,255,0.06);">
                <div class="avatar w-10 h-10 text-sm font-bold">{{ post.author.username[0].upper() }}</div>
                <div>
                    <div class="text-sm font-semibold" style="color: #e8e6f0;">{{ post.author.username }}</div>
                    <div class="text-xs" style="color: #6b6b8a;">{{ post.created_at.strftime('%B %d, %Y') }}</div>
                </div>
            </div>
        </header>

        <!-- Content -->
        <div class="prose-dark leading-relaxed" style="font-size: 1.0625rem; line-height: 1.8;">
            {{ post.content | safe }}
        </div>

        <!-- Footer -->
        <footer class="mt-14 pt-8" style="border-top: 1px solid rgba(255,255,255,0.06);">
            <div class="flex justify-between items-center">
                <div>
                    {% if post.updated_at and post.updated_at != post.created_at %}
                    <p class="text-xs" style="color: #6b6b8a;">Last updated: {{ post.updated_at.strftime('%B %d, %Y') }}</p>
                    {% endif %}
                </div>
                <a href="{{ url_for('blog_index') }}" class="btn btn-outline">
                    <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16l-4-4m0 0l4-4m-4 4h18"/>
                    </svg>
                    Back to Blog
                </a>
            </div>
        </footer>
    </div>
</article>

{% endblock %}
