<!doctype html>
<html <?php echo get_language_attributes(); ?>>
  <?php echo $__env->make('partials.head', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
  <body <?php body_class() ?>><?php wp_body_open(); ?>
    <div class="wrapper bg-min-height">



<?php if(is_home() && !is_paged()): ?>
      <!-- Today's Pick up movie -->
      <div class="pickup-bg">

        <div class="top-header-wrap">
          <?php do_action('get_header') ?>
          <?php echo $__env->make('partials.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        </div>

        <div class="pickup">
          <div class="container">
            <div class="d-flex justify-content-between align-items-center">
              <div class="line"></div>
              <div class="mx-2 mx-md-4"><img class="title-todays" src="<?= App\asset_path('images/title-todays.png'); ?>"></div>
              <div class="line"></div>
            </div>
            <div id="slider" class="pickup-slider-wrap carousel slide carousel-fade" data-ride="carousel" data-interval="3000">


              <div class="position-relative slider-nav-pos">

                <ul class="pickup-slider carousel-inner">

                <?php $args = array(
                  'posts_per_page'   => 3, //5件表示する
                  'meta_key' => 'recommend', //カスタムフィールドのキー
                  'meta_value' => 1, //カスタムフィールドの値
                  );
                  $my_query = new WP_Query($args);
                if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
                ?>

                <?php if ($my_query->current_post == 0): ?>
                  <li class="carousel-item active">
                <?php else: ?>
                  <li class="carousel-item">
                <?php endif;?>
                    <div class="d-lg-flex">
                      <div class="img-wrap">
                        <div class="thumb-wrap">
                          <a href="<?php echo e(get_permalink()); ?>">
                            <img src="https://i.ytimg.com/vi/<?php $txt = get_field('youtubeid'); if($txt){?><?php echo $txt; }?>/maxresdefault.jpg" class="img-responsive">
                            <svg class="play-btn" x="0" y="0" width="36px" height="36px" viewBox="0 0 36 36">
                              <use class="play-btn-style" fill="#fff" x="0px" y="0" width="36px" height="36px" xlink:href="#play-btn"></use>
                            </svg>
                          </a>
                        </div>
                      </div>

                      <div class="text-wrap">
                        <div class="d-flex d-lg-block justify-content-between">
                          <p class="cat"><?php the_category(' '); ?></p>
                          <time class="date"><?php echo e(get_the_date()); ?></time>
                        </div>
                        <h2 class="title"><a href="<?php echo e(get_permalink()); ?>"><?php the_title(); ?></a></h2>
                        <p class="client"><?php $txt = get_field('企業名'); if($txt){?><?php echo $txt; }?></p>
                        <a class="btn-main-movie" href="<?php echo e(get_permalink()); ?>">記事へ移動する</a>
                      </div>
                    </div>

                    <div class="d-none my-4 d-lg-flex justify-content-between align-items-center mt-5">
                      <div class="d-flex align-items-center mr-4 pickup-share-link">
                        <p class="mr-2">SNSでシェアする：</p>
                        <ul class="d-flex align-items-center">
                          <li><a class="twitter icon-twitter" href="//twitter.com/intent/tweet?text=<?php echo urlencode(the_title("","",0)); ?>&<?php echo urlencode(get_permalink()); ?>&url=<?php echo urlencode(get_permalink()); ?>" target="_blank" title="Twitterでシェアする"><img src="<?= App\asset_path('images/circle-btn-tw.svg'); ?>"></a></li>
                          <li><a class="facebook icon-facebook" href="//www.facebook.com/sharer.php?u=<?php echo urlencode(get_permalink()); ?>&t=<?php echo urlencode(the_title("","",0)); ?>" target="_blank" title="facebookでシェアする"><img src="<?= App\asset_path('images/circle-btn-fb.svg'); ?>"></a></li>
                          <li><a class="icon-line" href="//timeline.line.me/social-plugin/share?url=<?php echo urlencode(get_permalink()); ?>" target="_blank" title="LINEでシェアする"><img src="<?= App\asset_path('images/circle-btn-line.svg'); ?>"></a></li>
                        </ul>
                      </div>
                      <div class="line"></div>
                    </div>
                  </li>

                  <?php endwhile; endif; wp_reset_postdata(); ?>

                </ul>

                <div class="slider-nav-wrap d-none d-lg-flex">
                  <a class="carousel-control-prev" href="#slider" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                  </a>
                  <a class="carousel-control-next" href="#slider" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                  </a>
                </div>

              </div><!-- /position-relative -->

              <ol class="carousel-indicators d-none d-lg-flex">
                <li data-target="#slider" data-slide-to="0" class="active"></li>
                <li data-target="#slider" data-slide-to="1"></li>
                <li data-target="#slider" data-slide-to="2"></li>
              </ol>

            </div><!-- /pickup-slider-wrap -->
          </div><!-- /container -->


        </div><!-- /pickup -->
      </div><!-- /pickup-bg -->

      <div class="bg-red d-sm-none">
        <div class="d-flex">
          <div class="text-left">
            <p class="mr-3">YouTubeチャンネルにて<br>絶賛配信中‼</p>
          </div>
          <div>
            <a class="sp-btn-main-movie" href="https://www.youtube.com/channel/UC_7diiJitkSgMopJrAPzvLQ/featured?view_as=subscriber" target="_blank">チャンネルへ移動する</a>
          </div>
        </div>
      </div>

<?php else: ?>
    <div class="header-wrap">
      <?php do_action('get_header') ?>
      <?php echo $__env->make('partials.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    </div>
<?php endif; ?>


      <!-- LATEST VIDEO -->
      <div class="container">
        <div class="latest-video">
          <div class="title-unit" data-aos="fade-up">
            <h2>LATEST VIDEO</h2>
            <p>最新の動画</p>
          </div>


          <ul class="video-list">
            <?php if(have_posts()): while(have_posts()):the_post();$rankcount++; ?>
            <li data-aos="fade-up">
              <div class="img-wrap">
                <div class="thumb-wrap">
                  <a href="<?php echo e(get_permalink()); ?>">
                    <img src="https://i.ytimg.com/vi/<?php $txt = get_field('youtubeid'); if($txt){?><?php echo $txt; }?>/maxresdefault.jpg" class="img-responsive">
                    <svg class="play-btn" x="0" y="0" width="36px" height="36px" viewBox="0 0 36 36">
                      <use class="play-btn-style" fill="#fff" x="0px" y="0" width="36px" height="36px" xlink:href="#play-btn"></use>
                    </svg>
                  </a>
                </div>
              </div>
              <div class="text-wrap">
                <div class="info">
                  <p class="cat"><?php the_category(' '); ?></p>
                  <time class="date"><?php echo e(get_the_date()); ?></time>
                </div>
                <a href="<?php echo e(get_permalink()); ?>">
                  <h2 class="title"><?php the_title(); ?></a></h2>
                  <p class="client"><?php $txt = get_field('企業名'); if($txt){?><?php echo $txt; }?></p>
                </a>
              </div>
            </li>
          <?php endwhile;endif; ?>
          </ul>

          <div class="pager-wrap">
            <?php
              $prev = get_previous_posts_link();
              $next = get_next_posts_link();
            if($prev): ?>
              <div class="btn-pager">
                <?php previous_posts_link('前のページへ'); ?>
              </div>
            <?php else: ?>
              <div class="btn-pager disabled">
                前のページへ
              </div>
            <?php endif; ?>
            <?php if($next): ?>
              <div class="btn-pager">
                <?php next_posts_link('次のページへ'); ?>
              </div>
            <?php else: ?>
              <div class="btn-pager disabled">
                次のページへ
              </div>
            <?php endif; ?>
          </div>

        </div>
      </div><!-- /container -->
    </div><!-- /wrapper -->

    <div class="back-to-top-wrap d-sm-none">
      <a class="back-to-top" href="#">BACK TO TOP <img src="<?= App\asset_path('images/back-to-top-btn.svg'); ?>"></a>
    </div>

    <div class="wrapper bg-gray">
      <div class="container">
        <!-- RECOMMEND VIDEO -->
        <div class="recommend-video">
          <div class="title-unit2" data-aos="fade-up">
            <h2>RECOMMEND VIDEO</h2>
            <p>おすすめ動画</p>
          </div>

          <ul class="video-list2">
            <?php $args = array(
              'posts_per_page'   => 3, //5件表示する
              'meta_key' => 'recommend', //カスタムフィールドのキー
              'meta_value' => 1, //カスタムフィールドの値
              );
              $my_query = new WP_Query($args);
            if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
            ?>

            <li data-aos="fade-up">
              <div class="img-wrap">
                <div class="thumb-wrap">
                  <a href="<?php echo e(get_permalink()); ?>">
                    <img src="https://i.ytimg.com/vi/<?php $txt = get_field('youtubeid'); if($txt){?><?php echo $txt; }?>/maxresdefault.jpg" class="img-responsive">
                    <svg class="play-btn" x="0" y="0" width="36px" height="36px" viewBox="0 0 36 36">
                      <use class="play-btn-style" fill="#fff" x="0px" y="0" width="36px" height="36px" xlink:href="#play-btn"></use>
                    </svg>
                  </a>
                </div>
              </div>
              <div class="text-wrap">
                <div class="info">
                  <p class="cat"><?php the_category(' '); ?></p>
                  <time class="date"><?php echo e(get_the_date()); ?></time>
                </div>
                <a href="<?php echo e(get_permalink()); ?>">
                  <h2 class="title"><?php the_title(); ?></a></h2>
                  <p class="client"><?php $txt = get_field('企業名'); if($txt){?><?php echo $txt; }?></p>
                </a>
              </div>
            </li>
            <?php endwhile; endif; wp_reset_postdata(); ?>
          </ul>

          <!-- <a class="btn-more mx-auto mx-sm-0" href="#">View More</a> -->

        </div>
      </div><!-- /content -->
    </div><!-- /wrapper -->

  <?php do_action('get_footer') ?>
  <?php echo $__env->make('partials.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
  <?php wp_footer() ?>

  </body>
</html>
