<?php get_header(); ?>

<div class="container">
	<div class="row">
		<div class="col-xs-12">
			<?php get_template_part( 'part-title' ); ?>

			<div class="row">
				<?php
					$cols_class = 'col-md-9 col-sm-8';
					if ( get_theme_mod( 'layout_blog', 'sidebar' ) == 'fullwidth' ) {
						$cols_class = 'col-xs-12';
					}
				?>
				<div class="<?php echo esc_attr( $cols_class ); ?>">
					<?php while ( have_posts() ): the_post(); ?>
						<article id="entry-<?php the_ID(); ?>" <?php post_class( 'entry' ); ?>>
							<div class="row">
								<div class="col-sm-4">
									<?php if ( has_post_thumbnail() ): ?>
										<figure class="entry-thumb">
											<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'roxima_square' ); ?></a>
										</figure>
									<?php endif; ?>
								</div>

								<div class="col-sm-8">
									<?php if ( 'post' == get_post_type() ): ?>
										<div class="entry-meta">
											<time class="entry-time" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
												<i class="fa fa-clock-o"></i> <?php echo esc_html( get_the_date() ); ?>
											</time>
											<span class="entry-categories"><i class="fa fa-tags"></i> <?php the_category( ', ' ); ?></span>
											<span class="entry-comments"><i class="fa-comment fa"></i> <a href="<?php echo esc_url( get_comments_link() ); ?>"><?php comments_number(); ?></a></span>
										</div>
									<?php endif; ?>

									<h1 class="entry-title">
										<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
									</h1>

									<div class="entry-content">
										<?php the_excerpt(); ?>

										<a href="<?php the_permalink(); ?>" class="entry-more btn"><?php esc_html_e( 'read more', 'roxima' ); ?></a>
									</div>
								</div>
							</div>
						</article>
					<?php endwhile; ?>

					<?php roxima_pagination(); ?>
				</div>

				<?php if ( get_theme_mod( 'layout_blog', 'sidebar' ) == 'sidebar' ): ?>
					<div class="col-md-3 col-sm-4">
						<?php get_sidebar(); ?>
					</div>
				<?php endif; ?>
			</div>
		</div>
	</div>
</div>

<?php get_footer(); ?>