<?php
    $posts = get_theme_mod('crt_manage_hero_v1_center_post');
    $ratio = get_theme_mod('crt_manage_hero_v1_thumbnail_size', 'ratio169');
    $one_post = $posts[0];
    unset($posts[0]);
?>

<div class="hero-grid__inner d-flex">
    <div class="hero-grid__left">
        <?php if(!empty($one_post)): ?>
            <?php
                $post = get_post( $one_post );
                $get_permalink = get_permalink( $post );
//                $get_thumbnail_url = get_the_post_thumbnail_url( $post, 'nason-magazine-blog-image-medium');
                $get_thumbnail_url = get_the_post_thumbnail_url( $post);
            ?>
            <div class="hero-grid__left--item">
                <div class="hero-grid__left--inner">
                    <div class="position-relative">
                        <a href="<?php echo esc_attr($get_permalink); ?>">
                            <img class="thumbnail <?php echo esc_attr($ratio); ?> lazy" data-src="<?php echo esc_attr($get_thumbnail_url); ?>" alt="<?php echo esc_attr($post->post_title); ?>" style="" />
                        </a>
                        <div class="entry__cat-read">
                            <?php nason_magazine_blog_entry_options($post, array('class' => 'mt-0 d-flex justify-content-between c-white pd-20', 'entry_date' => false, 'entry_cat' => true, 'entry_author' => false, 'entry_read_time' => true, 'entry_comment' => false, 'entry_view_count' => false, 'entry_date_order' => 1, 'entry_cat_order' => 2, 'entry_author_order' => 3, 'entry_read_time_order' => 4, 'entry_comment_order' => 5, 'entry_view_count_order' => 6)); ?>
                        </div>
                    </div>
                    <div class="hero-grid__left--content">
                        <div class="entry">
                            <?php nason_magazine_blog_entry_options($post, array('class' => 'mb-2', 'entry_date' => true, 'entry_cat' => false, 'entry_author' => true, 'entry_read_time' => false, 'entry_comment' => false, 'entry_view_count' => false)); ?>
                        </div>
                        <h3 class="hero-grid__left--title mb-3"><a href="<?php echo esc_attr($get_permalink); ?>"><?php echo esc_html($post->post_title); ?></a></h3>
                        <div class="post-list__sub">
                            <?php echo nason_magazine_blog_excerpt_custom(30, $one_post); ?>
                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?>
    </div>
    <div class="hero-grid__right">
        <?php if(!empty($posts)): ?>
            <?php $c = 0; foreach ( $posts as $post_id ) : $c++;
                if($c <= 3) :
                $post = get_post( $post_id );
                $get_permalink = get_permalink( $post );
                $get_thumbnail_url = get_the_post_thumbnail_url( $post);
//                $get_thumbnail_url = get_the_post_thumbnail_url( $post, 'nason-magazine-blog-image-medium');
                ?>
                <div class="hero-grid__right--item">
                    <div class="hero-grid__right--inner d-flex">
                        <div class="hero-grid__right--col">
                            <div class="entry">
                                <?php nason_magazine_blog_entry_options($post, array('class' => 'mb-2', 'entry_date' => true, 'entry_cat' => false, 'entry_author' => true, 'entry_read_time' => false, 'entry_comment' => false, 'entry_view_count' => false)); ?>
                            </div>
                            <h3 class="mb-2"><a href="<?php echo esc_attr($get_permalink); ?>"><?php echo esc_html($post->post_title); ?></a></h3>
                            <div class="post-list__sub">
                                <?php echo nason_magazine_blog_excerpt_custom(10, $post_id); ?>
                            </div>
                            <div>
                                <?php nason_magazine_blog_entry_options($post, array('class' => 'mt-0 d-flex justify-content-start c-white mt-2', 'entry_date' => false, 'entry_cat' => true, 'entry_author' => false, 'entry_read_time' => true, 'entry_comment' => false, 'entry_view_count' => false, 'entry_date_order' => 1, 'entry_cat_order' => 2, 'entry_author_order' => 3, 'entry_read_time_order' => 4, 'entry_comment_order' => 5, 'entry_view_count_order' => 6)); ?>
                            </div>
                        </div>
                        <div class="hero-grid__right--col">
                            <div class="position-relative">
                                <a href="<?php echo esc_attr($get_permalink); ?>">
                                    <img class="thumbnail ratio11 lazy" data-src="<?php echo esc_attr($get_thumbnail_url); ?>" alt="<?php echo esc_attr($post->post_title); ?>" style="" />
                                </a>
                                <div class="entry__cat-read">
                                    <?php nason_magazine_blog_entry_options($post, array('class' => 'mt-0 d-flex justify-content-between c-white pd-20', 'entry_date' => false, 'entry_cat' => false, 'entry_author' => false, 'entry_read_time' => true, 'entry_comment' => false, 'entry_view_count' => false, 'entry_date_order' => 1, 'entry_cat_order' => 2, 'entry_author_order' => 3, 'entry_read_time_order' => 4, 'entry_comment_order' => 5, 'entry_view_count_order' => 6)); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endif; endforeach;  ?>
        <?php endif; ?>
    </div>
</div>


