<?php
/**
 * Template for displaying content in the loop.
 */

global $eisai_delay;

$entry_header_animation_delay_class  = ' animation-delay-' . ( $eisai_delay + 200 );
$entry_content_animation_delay_class = ' animation-delay-' . ( $eisai_delay + 300 );
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="article-content">
        <?php
        if ( ! is_search() ) {
            get_template_part( 'partials/featured-image' );
        }
        ?>

        <header class="entry-header <?php echo esc_attr( $entry_header_animation_delay_class ); ?>" role="banner" data-uk-scrollspy="cls: uk-animation-slide-bottom-small" style="visibility: hidden;">
            <?php
            the_title( sprintf( '<h2 class="uk-h2 entry-title"><a class="uk-link-text" href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );

            /**
        	 * Check whether the 'show_post_meta' is activated in the Customizer. Default is false.
             */
            $show_post_meta = get_theme_mod( 'show_post_meta', true );

        	if ( true === $show_post_meta ) {
                eisai_the_post_meta( get_the_ID(), 'archive' );
            }

            if ( is_sticky() && is_home() && ! is_paged() ) {
                printf( '<span class="sticky-post">%s</span>', esc_attr_x( 'Featured', 'post', 'eisai' ) );
            }
            ?>
        </header>

        <?php
        /**
    	 * Check whether the 'show_excerpt' option is activated in the Customizer.
         */
    	$show_excerpt = get_theme_mod( 'show_excerpt', true );

    	if ( true === $show_excerpt ) { ?>
            <div class="entry-content <?php echo esc_attr( $entry_content_animation_delay_class ); ?>" data-uk-scrollspy="cls: uk-animation-slide-bottom-small" style="visibility: hidden;">
                <?php the_excerpt(); ?>
            </div>
        <?php } ?>

    </div>
</article> <!-- #post-<?php the_ID(); ?> -->
