<?php

/**
 * 
 * Neatnote search.php
 *
 **/
?>
<?php get_header(); ?>

<section id="mainContent" class="NeatNote-BlogListingSection NeatNote-p70-0">
    <div class="NeatNote-wrapper">
        <div class="NeatNote-relatedBlogSectionInner">

            <?php if (have_posts()) : ?>
                <header class="neatnote-page-header">
                    <h1 class="main-search-title">
                        <?php
                        // Corrected printf with text-domain for translation
                        printf(
                            esc_html__('Search Results for: %s', 'neatnote'),
                            '<span>' . esc_html(get_search_query()) . '</span>'
                        );
                        ?>
                    </h1>
                </header>
                <div class="NeatNote-relatedBlogRow searchReasultArea">
                    <!-- Start the Loop -->
                    <?php while (have_posts()) : the_post(); ?>
                        <article id="post-<?php the_ID(); ?>" <?php post_class('search-result'); ?>>
                            <header class="neatnoteSearchTitle NeatNote-pt20">
                                <h3 class="search-posts-title">
                                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                </h3>
                            </header>
                            <div class="neatnoteExcerpt neatnote-pt15">
                                <?php the_excerpt(); ?>
                                <a href="<?php the_permalink(); ?>" class="neatnote-font20 neatnote-pt15 neatnote-lh1 NeatNote-semibold">
                                    <?php
                                    // Corrected esc_html_e with proper text-domain
                                    esc_html_e('Read More', 'neatnote');
                                    ?>
                                    <span class="NeatNote-BtnArrow">
                                        <i class="fa-solid fa-arrow-right"></i>
                                    </span>
                                </a>
                            </div>
                        </article>
                    <?php endwhile; ?>
                </div>
            <?php else : ?>
                <?php get_template_part('template-parts/content/content', 'none'); ?>
            <?php endif; ?>

            <?php if (is_paged() || paginate_links()) : ?>
                <div class="NeatNote-paginationparent NeatNote-pt100">
                    <?php neatnote_the_posts_navigation(); ?>
                </div>
            <?php endif; ?>

        </div>
    </div>
</section>

<?php get_footer(); ?>