<?php



$query =  new WP_Query(array(
	'post_type' => 'revues',
	'orderby' => 'date',
	'order' => 'DESC',
	'offset' => 1,
));


// Enqueue Swiper CSS and JS
// wp_enqueue_style('swiper-css', 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css');
// wp_enqueue_script('swiper-js', 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js', array(), null, true);


?>
<section class="block-revues-precedentes" <?php echo get_block_wrapper_attributes(); ?>>
	<div class="block-revues-precedentes__inner">
		<h2 class="block-title">À découvrir</h2>
		<h3 class="block-subtitle">Lisez nos revues précédentes</h3>

		<?php if ($query->have_posts()) : ?>
			<div class="swiper revues-precedentes-swiper">
				<div class="swiper-wrapper">
					<?php while ($query->have_posts()) : $query->the_post(); ?>
						<div class="swiper-slide">
							<article class="news-card">
								<?php if (has_post_thumbnail()) : ?>
									<div class="news-image">
										<?php the_post_thumbnail('medium'); ?>
									</div>
								<?php endif; ?>
								<div class="news-content">
									<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
									<div class="news-excerpt">
										<?php the_excerpt(); ?>
									</div>
								</div>
							</article>
						</div>

						<div class="swiper-slide">
							<div class="swiper-slide__inner">
								<h3>Revue précédente</h3>
							</div>
						</div>


					<?php endwhile; ?>
				</div>
				<div class="swiper-pagination"></div>
				<div class="swiper-button-next"></div>
				<div class="swiper-button-prev"></div>
			</div>


		<?php endif; ?>
	</div>
</section>