<?php
$formatted_date = format_event_date();

//$class = $full_width ? 'article-item-main__rfo' : 'article-item-rfo';
$class = isset($args['class']) ? $args['class'] : 'article-item-rfo';
$title = isset($args['title']) ? $args['title'] : '';
$has_video = isset($args['has_video']) ? $args['has_video'] : false;


?>
<div class="article-item-wrapper__rfo">
    <?if ( $title !== ''):?>
        <div class="land-cart-title">
            <div class="land-cart-title__text">
                <?if ( isset($args['title_link']) ):?>
                    <a href="<?=$args['title_link']?>"><?php echo esc_html($title); ?></a>
                 <?else:?>    
                    <?php echo esc_html($title); ?>
                <?endif?>
            </div>
            <div class="land-cart-title__arrow"></div>
        </div>
    <?endif?>    
    <div class="<?=$class;?>">
        <div class="article-item__image-container<?=$has_video === true ? ' has-video' : ''; ?>">
            <a href="<?php the_permalink(); ?>">
                <?=render_webp_picture_by_post( null, 'news-list-picture'); ?>
            </a>
        </div>    
        <div class="article-item__text">
            <div class="article-time">
                <img src="<?= get_asset('/icons/time.svg'); ?>" alt="" /><?php echo $formatted_date; ?>
            </div>
            <a href="<?php the_permalink(); ?>" class="subtitle-16 article-item__link"><?php the_title(); ?></a>
        </div>
        <div class="article-rfo-details">
            <div class="article-rfo-details-text"><a href="<?php the_permalink();?>">Подробнее</a></div>
            <div class="article-rfo-details-icon"></div>
        </div>
    </div>
</div>