<?php $__env->startSection('content'); ?>

<div class="request-page">
  <div class="request-page__header">
    <h1 class="request-page__title">資料ダウンロード</h1>
    <p class="request-page__text d-none d-md-block">
    株式会社BitStarが提供するさまざまなサービスの概要から具体的な活用例まで、<br>幅広く資料をご用意しています。ぜひ一度ご覧ください。
    </p>

    <div class="request-page__cat-list">
    <?php 
      $cat_args = get_terms(array('taxonomy' => 'request_cat'));
      foreach ( $cat_args as $cat_arg ) {
        echo '<a class="request-page__cat-btn" href="#'.$cat_arg->slug.'">'.$cat_arg->name.'<svg xmlns="http://www.w3.org/2000/svg" width="12.671" height="12.671" viewBox="0 0 12.671 12.671"><path d="M7.825,8.46a.635.635,0,0,1-.634-.634V1.269H.634A.634.634,0,1,1,.634,0H7.825A.635.635,0,0,1,8.46.634V7.825A.635.635,0,0,1,7.825,8.46Z" transform="translate(12.317 6.335) rotate(135)" fill="#fff" stroke="#fff" stroke-width="0.5"/></svg></a>';
      }
    ?>
    </div>    
  </div>

  <p class="request-page__text d-md-none">
    株式会社BitStarが提供するさまざまなサービスの概要から具体的な活用例まで、幅広く資料をご用意しています。ぜひ一度ご覧ください。
  </p>

  <?php
  $terms = get_terms( 'request_cat' );
  foreach ( $terms as $term ) :
  $args = array(
    'post_type' => 'request',
    'taxonomy' => 'request_cat',
    'term' => $term->slug,
    'posts_per_page' => -1,
  );
  $wp_query = new WP_Query($args);
  ?>
  <div class="request-page__post-wrap" id="<?php echo esc_html( $term->slug ); ?>">
    <div class="request-page__cat-title-wrap">
      <h2 class="request-page__cat-title"><?php echo esc_html( $term->name ); ?></h2>
      <h3 class="request-page__cat-sub-title en"><?php echo esc_html( $term->description ); ?></h3>
    </div>

    <ul class="request-page__post-list">
      <?php
      if ( $wp_query->have_posts() ): 
        while ( $wp_query->have_posts() ): 
          $wp_query->the_post(); 
      ?>
      <li class="request-page__post-list-item">
        <a href="<?php the_permalink(); ?>">
          <figure class="request-page__img-wrap">
            <?php if( has_post_thumbnail() ): ?>
              <?php the_post_thumbnail('large', array('class'=>'request-page__img img-transform')); ?>
            <?php endif; ?>
          </figure>
        </a>
        <p class="request-page__cat"><?php echo esc_html( $term->name ); ?></p>
        <h2 class="request-page__post-list-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <p class="request-page__excerpt"><?php echo mb_substr(get_the_excerpt(), 0, 100); ?></p>
        <a class="request-page__dl-btn" href="<?php the_permalink(); ?>">ダウンロード</a>
      </li>
      <?php endwhile;
      endif;
      wp_reset_postdata();
      ?>
    </ul>
  </div>
  
  <?php endforeach; ?>


</div><!-- /request -->

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>