<!-- Get Header -->
<?php

get_header(); ?>

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

  <?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);

    if (is_page($pageSlug)) { ?>

      <?php get_template_part('/templates/partials/page_header'); ?>

      <div class="p-4 text-center">
        <h2 class="font-medium underline uppercase">Overview</h2>
      </div>

      <p class="font-medium px-4 lg:text-center"><?php echo get_field('description', $pageID); ?></p> 
      <?php get_template_part('/templates/partials/subcategory_cards'); ?>

      <?php }

    foreach ($page['subpages'] as $subpage) {

      $pageID = $subpage->ID;
      $pageTitle = $subpage->post_title;
      $pageSlug = $subpage->post_name;
      $pageBG = $subpage->post_name . '.png';
      $pageBootstrapIcon = get_field('bootstrap_icon', $subpage->ID);

      if (is_page($pageSlug)) {
        get_template_part('/templates/partials/page_header'); ?>

        <div class="max-w-7xl mx-auto">
          <?php get_template_part('/templates/internal/' . $pageSlug); ?> 
          <?php /**  the_content();  */ ?>
        </div>
    
  <?php }
    }
  }

  ?>



</section>

<?php get_footer();
