<!-- Get Header -->
<?php get_header(); ?>

<section class="h-full overflow-scroll no-scrollbar bg-white pt-16 pb-24">

  <div class="flex flex-col justify-center">

    <div class="flex flex-col items-center py-8 justify-center">
      <!-- Logo -->
      <a class="flex flex-col items-center space-x-4" href="<?php echo get_site_url(); ?>">
        <p class="px-4 py-2 bg-red-500 text-white shadow-md rounded-md">Error 404</p>
        <div class="flex items-center justify-center">
          <img width="40px" src="<?php echo get_template_directory_uri(); ?>/assets/images/logos/header__logo.png" alt="NAN Logo">
          <h1 class="text-2xl p-4">Page not found...</h1>
        </div>
      </a>
    </div>

    <!-- Category Pages Section -->
    <div class="px-2 pt-4 pb-8 bg-cadet-200">
      <div class="flex items-center justify-center">
        <h1 class="font-medium text-2xl p-4">Visit category pages</h1>
        <i class="bi-arrow-down inline font-medium text-2xl p-4"></i>
      </div>
      <ul class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-2 max-w-7xl mx-auto">

        <?php $pages = get_pages_as_array();
        foreach ($pages as $page) {
          $pageID = $page['page']->ID;
          $pageTitle = $page['page']->post_title;
          $pageSlug = $page['page']->post_name;
          $pageBG = $page['page']->post_name . '.png';
          $pageBootstrapIcon = get_field('bootstrap_icon', $page['page']->ID);
        ?>
          <li class="category-cards flex rounded-md shadow-md relative overflow-hidden w-full" style="background-image: url('<?php echo get_template_directory_uri(); ?>/assets/images/bgs/<?php echo $pageBG ?>');">
            <a class="relative w-full text-center py-10 space-y-2 flex items-center flex-col justify-center" href="<?php echo $pageSlug ?>">
              <div class="absolute inset-0 flex items-center justify-center bg-blue-500 bg-opacity-50 rounded-md py-2 px-2">
                <!-- <i class="<?php echo $pageBootstrapIcon ?> text-2xl" aria-hidden="true"></i> -->
                <h2 class="text-sm font-medium text-white"><?php echo $pageTitle ?></h2>
                <!-- <p class="font-medium lg:text-center"><?php echo get_field('description', $pageID); ?></p> -->
              </div>
            </a>
          </li>
        <?php } ?>
      </ul>
    </div>

    <div class="flex items-center justify-center my-4">
      <a class="flex flex-col items-center space-x-4" href="<?php echo get_site_url(); ?>">
        <div class="flex items-center justify-center">
          <h1 class="font-medium text-2xl p-4">Go home</h1>
          <i class="bi-house-fill inline font-medium text-2xl p-4"></i>
        </div>
      </a>
    </div>

  </div>

</section>



<!-- Get Footer -->
<?php get_footer(); ?>