<?php
/**
 * The template part for displaying slider
 *
 * @package Sauna Lite 
 * @subpackage sauna_lite
 * @since Sauna Lite 1.0
 */
?>
<?php
  $content = apply_filters( 'the_content', get_the_content() );
  $video = false;
  // Only get video from the content if a playlist isn't present.
  if ( false === strpos( $content, 'wp-playlist-script' ) ) {
    $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
  }
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('inner-service'); ?>>
  <div class="page-box wow zoomInLeft delay-2000 mb-4">
    <div class="box-image">
     <?php
        if ( ! is_single() ) {
          // If not a single post, highlight the video file.
          if ( ! empty( $video ) ) {
            foreach ( $video as $video_html ) {
              echo '<div class="entry-video">';
                echo $video_html;
              echo '</div>';
            }
          };
        }; 
      ?>
    </div>
    <div class="box-content p-3">
      <div class="tc-category">
      <?php the_category(); ?>
      </div>
      <h2 class="py-2 mb-2"><a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?><span class="screen-reader-text"><?php the_title(); ?></span></a></h2>
      <?php if(get_theme_mod('sauna_lite_post_content') == 'Full Content'){ ?>
        <?php the_content(); ?>
      <?php }
      if(get_theme_mod('sauna_lite_post_content', 'Excerpt Content') == 'Excerpt Content'){ ?>
        <?php if(get_the_excerpt()) { ?>
          <p class="mb-2"><?php $sauna_lite_excerpt = get_the_excerpt(); echo esc_html( sauna_lite_string_limit_words( $sauna_lite_excerpt, esc_attr(get_theme_mod('sauna_lite_post_excerpt_length','20')))); ?><?php echo esc_html( get_theme_mod('sauna_lite_button_excerpt_suffix','[...]') ); ?></p>
        <?php }?>
      <?php }?>
      <?php if ( get_theme_mod('sauna_lite_post_button_text','Read More...') != '' ) {?>
        <a class="r_button hvr-sweep-to-right read-more"  href="<?php echo esc_url( get_permalink() ); ?>"><?php echo esc_html( get_theme_mod('sauna_lite_post_button_text',__( 'Read More...','sauna-lite' )) ); ?><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('sauna_lite_post_button_text',__( 'Read More...','sauna-lite' )) ); ?></span></a>
      <?php }?>
    </div>
    <div class="clearfix"></div>
  </div>
</article>