<?php if ($WHERE_AM_I == 'home'): ?>
  <?php
    $featured = array_slice($content, 0, 1);
    $content = array_slice($content, 1);
    foreach ($featured as $page):
  ?>
<div class="bg-dark text-secondary px-3 py-5 border-start border-info border-5" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%,rgba(0,0,0,0.9) 100%), url(<?php echo ($page->coverImage()?$page->coverImage():Theme::src('img/noimage.png')) ?>);background-size: cover;background-repeat:none;background-position: center;">
    <div class="py-5">
        <div class="container">
          <div class="row">
            <div class="col-md-7 align-self-bottom">
            <p class="fw-bold text-info">Feature Post</p>
            <h1 class="display-5 text-white py-2 fw-bold"><a class="text-decoration-none text-light" href="<?php echo $page->permalink(); ?>"><?php echo $page->title(); ?></a></h1>
            <p><span class="text-white"><?php echo $page->date(); ?>&nbsp;&nbsp;&#183;&nbsp;&nbsp;<?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>&nbsp;&nbsp;&#183;&nbsp;&nbsp;<a class="btn rounded-pill btn-info text-white" href="#" role="button" style="font-size: 13px;"><?php echo $page->category() ?></a></span></p>
          </div>
          </div>
        </div>
    </div>
</div>
<?php endforeach ?>
<?php endif; ?>
<div class="container-fluid">
  <div class="row">
    <div class="col-md-8 p-4 mt-5">
      <?php foreach ($content as $page): ?>
    <div class="row mb-5">
      <div class="col-md-8 align-self-center">
        <h1 class="fs-4 fw-bold"><a class="text-decoration-none text-dark" href="<?php echo $page->permalink(); ?>"><?php echo $page->title(); ?></a></h1>
        <p class="text-dark fw-light"><?php echo (empty($page->description())?$language->p('Complete the description of the article'):$page->description()) ?></p>
         <p><span class="text-secondary" style="font-size: 13px;"><?php echo $page->date(); ?>&nbsp;&nbsp;&#183;&nbsp;&nbsp;<?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>&nbsp;&nbsp;&#183;&nbsp;&nbsp;<a class="btn rounded-pill btn-light text-secondary" href="#" role="button" style="font-size: 13px;"><?php echo $page->category() ?></a></span></p>
      </div>
      <div class="col-md-4 order-sm-last order-first mb-3">
        <img class="img-fluid rounded" src="<?php echo ($page->coverImage()?$page->coverImage():Theme::src('img/noimage.png')) ?>" style="width: 600px; height: 180px; object-fit: cover; ">
      </div>
    </div>
    <?php endforeach ?>
    <?php if (Paginator::numberOfPages()>1): ?>
    <div class="container mb-4">
      <div class="row">
        <div class="col-md-12 text-center">
            <?php if (Paginator::showPrev()): ?>
                <a class="btn btn-sm rounded-pill btn-light text-dark mt-2 fw-light" href="<?php echo Paginator::previousPageUrl() ?>" role="button">&larr; <?php $language->p('Previous page') ?></a>
            <?php endif ?>
            <?php if (Paginator::showNext()): ?>
                <a class="btn btn-sm rounded-pill btn-light text-dark mt-2 fw-light" href="<?php echo Paginator::nextPageUrl() ?>" role="button"><?php $language->p('Next page') ?> &rarr;</a>
            <?php endif ?>
        </div>
      </div>
    </div>
        <?php endif ?>
    </div>
<?php include ('sidebar.php'); ?>