<?php
/**
 * Featured lead post (Plan A — first post on latest-posts homepage).
 *
 * @package ttsunsolar
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'blog-feature' ); ?>>
	<?php if ( has_post_thumbnail() ) : ?>
		<a class="blog-feature__media" href="<?php the_permalink(); ?>">
			<?php the_post_thumbnail( 'large' ); ?>
		</a>
	<?php else : ?>
		<a class="blog-feature__media blog-feature__media--placeholder" href="<?php the_permalink(); ?>">
			<img src="<?php echo esc_url( ttsunsolar_image_uri( 'slider-1.jpg' ) ); ?>" alt="<?php the_title_attribute(); ?>" />
		</a>
	<?php endif; ?>
	<div class="blog-feature__body">
		<div class="entry-meta">
			<span class="entry-meta__date"><?php echo esc_html( get_the_date() ); ?></span>
			<?php
			$cats = get_the_category();
			if ( ! empty( $cats ) ) :
				?>
				<span class="entry-meta__cat"><?php echo esc_html( $cats[0]->name ); ?></span>
			<?php endif; ?>
		</div>
		<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
		<div class="entry-summary">
			<?php the_excerpt(); ?>
		</div>
		<a class="button button--primary" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Read article', 'ttsunsolar' ); ?></a>
	</div>
</article>
