{% extends "base.html" %}

{% block title %}{{ page.title }} - {{ site_name() }}{% endblock %}

{% block content %}
<article>
    <header>
        <h1>{{ page.title }}</h1>
        {% if page.published_at %}
        <time datetime="{{ page.published_at.isoformat() }}">
            Published: {{ page.published_at.strftime('%B %d, %Y') }}
        </time>
        {% endif %}
    </header>

    <div class="page-content">
        {{ page.content | safe }}
    </div>

    {% if not page.is_published %}
    <aside style="background: #fff3cd; padding: 1rem; border-left: 4px solid #ffc107; margin-top: 2rem;">
        <strong>Draft:</strong> This page is not published and only visible to logged-in users.
    </aside>
    {% endif %}
</article>
{% endblock %}
