<?php
/**
 * Archive page template - "Trendy - mix" layout
 *
 * @package Multi
 */

?>
<main class="main">
<?php
get_template_part( 'archive-heading' );

if ( have_posts() ) :
	?>
	<div class="postlist modern trendy columns <?php echo esc_attr( multimagazine_get_post_loading_classes() ); ?>">
	<?php
	$multimagazine_post_args   = multimagazine_postlist_meta_flags();
	$multimagazine_pagenum     = multimagazine_postlist_page_number();
	$multimagazine_post_number = 0;

	while ( have_posts() ) {
		the_post();

		if ( 0 === $multimagazine_post_number && $multimagazine_pagenum < 2 ) {
			$multimagazine_post_args['classes']        = 'col1';
			$multimagazine_post_args['thumbnail-size'] = 'multimagazine-thumbnail-large';
		} elseif ( $multimagazine_post_number < 3 && $multimagazine_pagenum < 2 ) {
			$multimagazine_post_args['classes']        = 'col2';
			$multimagazine_post_args['thumbnail-size'] = 'multimagazine-thumbnail-medium';
		} else {
			$multimagazine_post_args['classes']        = 'col3';
			$multimagazine_post_args['thumbnail-size'] = 'multimagazine-thumbnail-medium';
		}
		$multimagazine_post_number ++;

		get_template_part( 'post-list-parts/post-trendy', null, $multimagazine_post_args );
	}
	?>
	</div>
	<?php get_template_part( 'template-parts/pager' ); ?>
<?php else : ?>
	<?php get_template_part( 'template-parts/archive-empty' ); ?>
<?php endif; ?>
<?php get_template_part( 'archive-description' ); ?>
</main>
