<?php
/**
 * The template part for displaying single post content
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package    Wira
 * @since      1.0.0
 */

?>

<!-- Content Single Main Wrapper -->
<article id="post-<?php the_ID(); ?>" <?php post_class( 'mb-5' ); ?>>
	
	<!-- Post Thumbnail -->
	<?php if ( has_post_thumbnail() ) : ?>
		<figure class="theme-featured-image entry-thumbnail mb-4">
			<?php the_post_thumbnail( 'large', array( 'class' => 'img-fluid' ) ); ?>
		</figure>
	<?php endif; ?>
	
	<!-- Post Header -->
	<header class="entry-header my-4">
		<div class="post-meta theme-color-placeholder mb-2 d-flex flex-wrap gap-3">
			<span>
				<i class="fas fa-calendar theme-color-secondary me-1"></i> <?php echo esc_html( get_the_date() ); ?>
			</span>
			<span>
				<i class="fas fa-comments theme-color-secondary me-1"></i> <span class="theme-color-primary"><?php echo esc_html( number_format_i18n( get_comments_number() ) ); ?></span> <?php esc_html_e( 'Comments', 'wira' ); ?>
			</span>
			<span>
				<i class="fas fa-user-circle theme-color-secondary me-1"></i> <?php echo esc_html( get_the_author() ); ?>
			</span>
		</div>
	</header> <!-- Post Header /End -->
	
	<!-- Post Content -->
	<div class="entry-content theme-body-content mb-4">
		<?php the_content(); ?>

		<?php
		wp_link_pages(
			array(
				'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'wira' ) . '</span>',
				'after'  => '</div>',
			)
		);
		?>
	</div> <!-- Post Content /End -->
	
	<!-- Post Footer -->
	<footer class="entry-footer my-5">
		<?php
		if ( class_exists( 'Wira\Templates\Post_Tags' ) ) {
			$tags = new Wira\Templates\Post_Tags();
			echo wp_kses_post( $tags->render() );
		}
		?>
		<div class="border-top pt-4 mt-5 mb-5">
			<?php
			if ( class_exists( 'Wira\Templates\Post_Navigation' ) ) {
				$post_nav = new Wira\Templates\Post_Navigation();
				$post_nav->render();
			}
			?>

		</div><!-- Post Footer /End -->
	</footer>

</article>

<!-- Comments -->
<?php
if ( comments_open() || get_comments_number() ) {
	comments_template();
}
?>
