<?php
/**
 * @package Gazette
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header class="entry-header">
		<?php if ( 'post' == get_post_type() ) : ?>
			<div class="entry-meta">
				<?php gazette_entry_meta(); ?>
			</div><!-- .entry-meta -->
		<?php endif; ?>
		
		<?php if ( has_post_thumbnail() && ( ! has_post_format() || has_post_format( 'aside' ) || has_post_format( 'image' ) || has_post_format( 'gallery' ) ) ) : ?>
			<a class="post-thumbnail" href="<?php echo esc_url( get_permalink() ); ?>">
				<?php
					if ( has_post_format( 'image' ) || has_post_format( 'gallery' ) ) {
						the_post_thumbnail( 'gazette-post-thumbnail-square' );
					} else {
						the_post_thumbnail( 'gazette-post-thumbnail' );
					}
				?>
				<?php if ( is_sticky() ) : ?>
					<span class="sticky-post"><span class="genericon genericon-pinned"><span class="screen-reader-text"><?php _e( 'Sticky post', 'gazette' ); ?></span></span></span>
				<?php endif; ?>
			</a>
		<?php endif; ?>

		<?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>

		<?php if ( 'post' == get_post_type() ) : ?>
		<div class="entry-meta">
			<?php gazette_posted_on(); ?>
		</div><!-- .entry-meta -->
		<?php endif; ?>
	</header><!-- .entry-header -->

	<div class="entry-summary">
		<?php the_excerpt(); ?>
	</div><!-- .entry-content -->
</article><!-- #post-## -->