<?php get_header(); ?>
<div class="container-fluid  p-2 p-lg-5" >
    <div class="container p-2 p-lg-5">
        <div class="row">
            <div class="col-12 col-xl-5 post_content">
                <?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
                <h1 class="h2 montserrat brown suptitle_arrow"><?php echo get_field('actualite_archive_title','options');?></h1>
                <p><?php echo get_field('actualite_archive_description','options');?></p>
            </div>
            <div class="col-12 col-xl-7">
                <div class="mosaic_bloc row">
                <?php
                if(get_field('actualite_archive_gallery','options')){
                    $gallery = get_field('actualite_archive_gallery','options');
                    foreach ($gallery as $img){

                        ?>
                        <div class="item pentagon" style="background: url(<?php echo $img['sizes']['c_medium_false'];?>) no-repeat center center / cover;">
                        </div>
                <?php
                    }
                }
                ?>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container-fluid p-2 p-lg-5">
    <div class="container p-4 p-lg-5">
        <div id="content" class="clearfix row">

                <?php
                $nb = 1;
                if (have_posts()) : while (have_posts()) : the_post(); ?>
                    <?php
                    $thumb_id = get_post_thumbnail_id();
                    $thumb_url = wp_get_attachment_image_src($thumb_id,'large', true);
                    if($nb%2!=0){
                        $order1 = ' order-1 txt';
                        $order2 = ' order-2';
                    }else{
                        $order2 = ' order-1';
                        $order1 = ' order-2 txt';
                    }

                    ?>
                        <a href="<?php echo get_permalink();?>" class="actu_item col-12  col-lg-6 p-2 p-lg-5 mb-5 mb-lg-0">
                        <div class="row">
                            <div class="col-4 relative <?php echo $order1;?>">
                                <div class="actu_title bg-brown white">
                                    <h2 class="h3"><?php echo get_the_title();?></h2>
                                    <p class="news_link">Lire la suite</p>
                                </div>
                            </div>
                            <div class="col-8 actu_img <?php echo $order2;?>" style="background:url(<?php echo $thumb_url[0];?>) no-repeat center center / cover">
                                <img src="<?php echo $thumb_url[0];?>" alt="<?php echo get_the_title();?>" class="img-fluid d-none">
                            </div>
                        </div>
                        </a>

                <?php
                $nb++;
                endwhile; ?>
                <?php endif; ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>
