<div id="chic_lifestyle_slider_sections" class="banner-news banner-news-1 banner-news-slider text-center px-8">
<?php if ($title) : ?><div class="container"><h2 class="text-start"><?php echo esc_html($title); ?></h2></div><?php endif; ?>
<section id="owl-slider" class="owl-carousel">
  <?php while ($query->have_posts()) : $query->the_post(); ?>
    <div class="item">
      <div class="banner-news-list">
        <?php if (has_post_thumbnail()) : ?>
          <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
          <img src="<?php echo esc_url($image[0]); ?>" alt="<?php echo esc_attr($title); ?>" class="img-responsive w-p100 h-280 object-fit-cover object-position-center">
        <?php else : ?>
          <div class="w-p100 h-280 bg-info bg-opacity-50"></div>
        <?php endif; ?>
        <div class="position-relative text-black bottom w-p100 bg-transparent mt-16">
          <?php
          if (in_array('categories', $post_details)) :
            $categories = get_the_category();
            $separator = ' ';
            $output = '';
            if (! empty($categories)) :
              foreach ($categories as $cat) {
                $output .= '<h5 class="mb-16"><a class="text-secondary text-uppercase" href="' . esc_url(get_category_link($cat->term_id)) . '">' . esc_html($cat->name) . '</a></h5>' . $separator;
              }
              echo trim($output, $separator);
            endif;
          endif
          ?>
          <h3 class="fs-5"><a href="<?php echo esc_url(get_the_permalink($post->ID)); ?>"><?php the_title(); ?></a></h3>
          <?php if (in_array('date', $post_details)) : ?>
            <div class="info text-info mb-16 fs-85">
              <i class="fa fa-clock-o" aria-hidden="true"></i>
              <?php echo get_the_date(); ?>
            </div>
          <?php endif; ?>
          <?php
          if (in_array('summary', $post_details)) : ?>
            <div class="mb-16">
              <?php echo esc_html(chic_lifestyle_custom_excerpt(250)); ?>
            </div>
          <?php endif; ?>
          <?php if (in_array('readmore', $post_details)) : ?>
            <a href="<?php echo esc_url(get_the_permalink($post->ID)); ?>" class="text-secondary ls-3 text-uppercase fs-85"><?php esc_html_e('Read More', 'chic-lifestyle'); ?></a>
          <?php endif; ?>
        </div>
      </div>
    </div>
  <?php endwhile;
  wp_reset_postdata(); ?>
</section>
</div>