<?php

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
/**
 * Template for displaying pages
 * 
 * @package Pawfect
 */

get_header(); ?>

<main id="primary-content" class="pawfect-page" tabindex="-1">
    
    <?php while ( have_posts() ) : the_post(); ?>
        
        <!-- Enhanced Page Header -->
        <?php get_template_part('template-parts/page-header'); ?>

        <!-- Page Content Section -->
        <section class="pawfect-page-content pawfect-py-20">
            <div class="pawfect-container-narrow">
                
                <!-- Featured Image -->
                <?php if ( has_post_thumbnail() ) : ?>
                    <div class="pawfect-featured-image pawfect-mb-12">
                        <div class="pawfect-rounded-2xl pawfect-overflow-hidden pawfect-shadow-lg">
                            <?php the_post_thumbnail( 'large', array( 'class' => 'pawfect-w-full pawfect-object-cover' ) ); ?>
                        </div>
                    </div>
                <?php endif; ?>
                
                <!-- Content -->
                <div class="pawfect-content pawfect-prose pawfect-prose-lg pawfect-max-w-none">
                    <?php the_content(); ?>
                    
                    <?php
                    wp_link_pages( array(
                        'before' => '<div class="pawfect-page-links pawfect-mt-8 pawfect-text-center">',
                        'after'  => '</div>',
                        'link_before' => '<span class="pawfect-page-number pawfect-inline-block pawfect-px-4 pawfect-py-2 pawfect-bg-pawfect-primary pawfect-text-white pawfect-rounded pawfect-mx-1">',
                        'link_after'  => '</span>',
                    ) );
                    ?>
                </div>
                
                <!-- Comments -->
                <?php
                if ( comments_open() || get_comments_number() ) :
                    echo '<div class="pawfect-comments pawfect-mt-16">';
                    comments_template();
                    echo '</div>';
                endif;
                ?>
                
            </div>
        </section>

    <?php endwhile; ?>

</main>

<?php get_footer(); ?>
