<?php
get_header();
?>

<?php
if ( is_home() && is_front_page() ) {
    get_template_part( 'template-parts/content', 'nxt-event-planner-hero' );
}
?>

<?php if ( is_home() && ! is_front_page() ) : ?>
    <header class="page-header">
        <div class="container">
            <h1 class="page-title"><?php single_post_title(); ?></h1>
        </div>
    </header>
<?php endif; ?>

<div class="content-wrapper">
    <main id="main" class="site-main" tabindex="-1">
        <?php if ( have_posts() ) : ?>
            <div class="article-list">
                <?php while ( have_posts() ) : the_post(); ?>
                    <?php get_template_part( 'template-parts/content', 'nxt-event-planner-post-card' ); ?>
                <?php endwhile; ?>
            </div>

            <?php
            the_posts_pagination(
                array(
                    'prev_text' => esc_html__( 'Previous', 'nxt-event-planner' ),
                    'next_text' => esc_html__( 'Next', 'nxt-event-planner' ),
                )
            );
            ?>
        <?php else : ?>
            <p><?php esc_html_e( 'No posts found.', 'nxt-event-planner' ); ?></p>
        <?php endif; ?>
    </main>

    <?php get_sidebar(); ?>
</div>

<?php get_footer(); ?>
