<?php
/**
 * Public hero section.
 *
 * @package Lucrativeit_Subscription_Recurring_Billing
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Included template; variables are local to the including scope.

$instance_id = isset( $instance_id ) ? $instance_id : 'lucrsure-hero';
$heading     = isset( $heading ) ? $heading : '';
$subtitle    = isset( $subtitle ) ? $subtitle : '';
$button_text = isset( $button_text ) ? $button_text : '';
$button_url  = isset( $button_url ) ? $button_url : '#lucrsure-plans';
$image_url   = isset( $image_url ) ? $image_url : '';
?>

<section class="lucrsure-hero<?php echo $image_url ? ' has-image' : ''; ?>" id="<?php echo esc_attr( $instance_id ); ?>">
	<div class="lucrsure-hero-inner">
		<div class="lucrsure-hero-content">
			<?php if ( $heading ) : ?>
				<h1 class="lucrsure-hero-title"><?php echo esc_html( $heading ); ?></h1>
			<?php endif; ?>
			<?php if ( $subtitle ) : ?>
				<p class="lucrsure-hero-subtitle"><?php echo esc_html( $subtitle ); ?></p>
			<?php endif; ?>
			<?php if ( $button_text ) : ?>
				<a class="lucrsure-hero-cta" href="<?php echo esc_url( $button_url ); ?>"><?php echo esc_html( $button_text ); ?></a>
			<?php endif; ?>
		</div>
		<?php if ( $image_url ) : ?>
			<div class="lucrsure-hero-media" aria-hidden="true">
				<img src="<?php echo esc_url( $image_url ); ?>" alt="" loading="eager" />
			</div>
		<?php endif; ?>
	</div>
</section>
