<?php
/**
 * Homepage banner — single image (no slider).
 *
 * @package ttsunsolar
 */

$banner = ttsunsolar_get_banner_data();
if ( empty( $banner['image'] ) ) {
	return;
}
?>
<section class="hero hero--static" aria-label="<?php esc_attr_e( 'Featured solar energy solutions', 'ttsunsolar' ); ?>">
	<article class="hero__slide is-active">
		<img src="<?php echo esc_url( $banner['image'] ); ?>" alt="<?php echo esc_attr( wp_strip_all_tags( $banner['title'] ) ); ?>" />
		<div class="hero__content">
			<?php if ( ! empty( $banner['tagline'] ) ) : ?>
				<p class="section_tagline"><?php echo esc_html( $banner['tagline'] ); ?></p>
			<?php endif; ?>
			<?php if ( ! empty( $banner['title'] ) ) : ?>
				<h1><?php echo esc_html( $banner['title'] ); ?></h1>
			<?php endif; ?>
			<?php if ( ! empty( $banner['button'] ) ) : ?>
				<a class="button button--primary" href="<?php echo esc_url( $banner['url'] ); ?>"><?php echo esc_html( $banner['button'] ); ?></a>
			<?php endif; ?>
		</div>
	</article>
</section>
