<?php
/**
 * Generic archive template.
 *
 * @package BASCO_UAE
 */

get_header(); ?>

<?php
if ( function_exists( 'elementor_theme_do_location' ) && elementor_theme_do_location( 'archive' ) ) :
	// Elementor rendered the archive.
else :
?>

<header class="page-header">
	<div class="container">
		<h1><?php the_archive_title(); ?></h1>
		<?php the_archive_description( '<p style="color:rgba(255,255,255,.85);">', '</p>' ); ?>
		<?php basco_uae_breadcrumbs(); ?>
	</div>
</header>

<main id="content" class="content-wrap">
	<div class="container">
		<?php if ( have_posts() ) : ?>
			<div class="posts-grid">
				<?php while ( have_posts() ) : the_post(); ?>
					<article id="post-<?php the_ID(); ?>" <?php post_class( 'post-card' ); ?>>
						<?php if ( has_post_thumbnail() ) : ?>
							<a class="post-thumbnail" href="<?php the_permalink(); ?>">
								<?php the_post_thumbnail( 'medium_large' ); ?>
							</a>
						<?php endif; ?>
						<div class="post-body">
							<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
							<div class="entry-meta"><?php basco_uae_posted_on(); ?></div>
							<div class="excerpt"><?php the_excerpt(); ?></div>
							<a class="read-more" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Read more →', 'basco-uae' ); ?></a>
						</div>
					</article>
				<?php endwhile; ?>
			</div>

			<?php the_posts_pagination(); ?>
		<?php else : ?>
			<p><?php esc_html_e( 'Nothing here yet.', 'basco-uae' ); ?></p>
		<?php endif; ?>
	</div>
</main>

<?php endif; // End Elementor archive location check. ?>

<?php get_footer(); ?>
