<?php
/**
 * Main index template
 *
 * @package Kutby
 */

declare(strict_types=1);

get_header();
?>

<div class="kutby-container kutby-layout">
	<div class="kutby-content">
		<?php if ( have_posts() ) : ?>
			<?php while ( have_posts() ) : ?>
				<?php the_post(); ?>
				<article <?php post_class( 'kutby-card kutby-mb-4' ); ?>>
					<h2 class="entry-title">
						<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
					</h2>
					<div class="entry-summary">
						<?php the_excerpt(); ?>
					</div>
				</article>
			<?php endwhile; ?>

			<nav class="kutby-pagination" aria-label="تصفح المقالات">
				<?php the_posts_pagination(); ?>
			</nav>
		<?php else : ?>
			<p>لا توجد مقالات.</p>
		<?php endif; ?>
	</div>

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

<?php
get_footer();
