<?php
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
?>

<article class="post-wrapper">
    <?php
    if($settings['link_wrapper']) {
        echo '<a class="item-link rivax-position-cover" aria-label="Item Link" href="' . get_permalink() . '"></a>';
    }
    ?>
    <?php if($settings['author_position'] == 'top' || $settings['terms_position'] == 'top'): ?>
        <div class="top-content-wrapper rivax-position-top">
            <?php if($settings['terms_position'] == 'top') { $this->render_terms(); }; ?>
            <?php if($settings['author_position'] == 'top') { $this->render_author(); }; ?>
        </div>
    <?php endif; ?>
    <div class="content-wrapper rivax-position-<?php echo esc_attr($settings['content_position']) . ' ' . esc_attr($settings['content_style']); ?>">
        <div class="content-wrapper-inner">
            <?php if($settings['terms_position'] != 'top') { $this->render_terms(); }; ?>
            <?php $this->render_title(); ?>
            <?php $this->render_excerpt(); ?>
            <div class="meta-wrapper">
                <?php if($settings['author_position'] != 'top') { $this->render_author(); }; ?>
                <?php $this->render_date(); ?>
                <?php $this->render_comments(); ?>
                <?php $this->render_views_count(); ?>
                <?php $this->render_reading_time(); ?>
            </div>
            <?php if($settings['content_style'] == 'style-3'): ?>
                <div class="read-more-wrap">
                    <a href="<?php the_permalink(); ?>" class="read-more"><?php echo esc_html($settings['read_more_text']) ?></a>
                </div>
            <?php endif; ?>
        </div>
    </div>
</article>
