<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package go_mechanic
 */

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="post-container">
        <header class="entry-header">
            <?php
		

		if ( 'post' === get_post_type() ) :
			?>
            <div class="entry-meta d-flex">
                <div class="post-date">
                    <i class="fa-regular fa-calendar"></i> <a
                        href="<?php the_permalink();?>"><?php echo esc_html(get_the_date('d M Y')); ?></a>

                </div>

                <div class="post-category">
                    <i class="fa-regular fa-folder"></i>
                    <a href="<?php echo esc_url(get_category_link(get_the_category()[0]->term_id)); ?>">
                        <?php echo esc_html(get_the_category()[0]->name); ?>
                    </a>
                </div>

                <div class="post-time">
                    <i class="fa-regular fa-clock"></i>
                    <a href="#" class="read-only-link">
                        <?php echo esc_html(go_mechanic_get_reading_time()); ?>
                    </a>
                </div>                
            </div><!-- .entry-meta -->
            <?php endif; ?>
			<?php
			if ( is_singular() ) :
			the_title( '<h1 class="entry-title">', '</h1>' );
		else :
			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
		endif;
		?>
        </header><!-- .entry-header -->
        <div class="entry-content">
            <?php
		the_content(
			sprintf(
				wp_kses(
					/* translators: %s: Name of current post. Only visible to screen readers */
					__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'go-mechanic' ),
					array(
						'span' => array(
							'class' => array(),
						),
					)
				),
				wp_kses_post( get_the_title() )
			)
		);

		wp_link_pages(
			array(
				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'go-mechanic' ),
				'after'  => '</div>',
			)
		);
		?>
        </div><!-- .entry-content -->
    </div>

</article><!-- #post-<?php the_ID(); ?> -->