<?php
if ( ! get_theme_mod( 'online_school_courses_enable_banner_section', false ) ) {
	return;
}

/**
 * Render Banner Section.
 */ 

$online_school_courses_banner_section_heading = get_theme_mod( 'online_school_courses_banner_section_heading');
$online_school_courses_banner_section_content = get_theme_mod( 'online_school_courses_banner_section_content');
$online_school_courses_button_label = get_theme_mod( 'online_school_courses_banner_button_label_');
$online_school_courses_button_link  = get_theme_mod( 'online_school_courses_banner_button_link_');
$online_school_courses_button_label_2 = get_theme_mod( 'online_school_courses_banner_button_label_2');
$online_school_courses_button_link_2  = get_theme_mod( 'online_school_courses_banner_button_link_2');

$online_school_courses_banner_section_image = get_theme_mod( 'online_school_courses_banner_section_image');

?>

<section id="online_school_courses_banner_section primary" class="banner-section banner-style-1">
	<?php
	if ( is_customize_preview() ) :
		online_school_courses_section_link( 'online_school_courses_banner_section' );
	endif;
	?>
	<div class="banner-section-wrapper">
		<div class="asterthemes-wrapper">
			<div class="banner-single-outer">
				<div class="banner-single">
					<div class="banner-caption">
						<div class="banner-catption-wrapper wow fadeInUp" data-wow-duration="1.5s">
							<h1 class="banner-caption-title">
								<a href="<?php the_permalink(); ?>"><?php echo esc_html( $online_school_courses_banner_section_heading ); ?></a>
							</h1>
							<p class="banner-caption-content">
								<?php echo esc_html( $online_school_courses_banner_section_content ); ?>
							</p>
							<div class="banner-btn">
								<?php if ( ! empty( $online_school_courses_button_label ) ) { ?>
									<span class="banner-slider-btn">
										<a href="<?php echo esc_url( $online_school_courses_button_link ); ?>" class="asterthemes-button"><?php echo esc_html( $online_school_courses_button_label ); ?></a>
									</span>
								<?php } ?>
								<?php if ( ! empty( $online_school_courses_button_label_2 ) ) { ?>
									<span class="banner-slider-btn-1">
										<a href="<?php echo esc_url( $online_school_courses_button_link_2 ); ?>" class="asterthemes-button"><?php echo esc_html( $online_school_courses_button_label_2 ); ?></a>
									</span>
								<?php } ?>
							</div>
							<?php if ( get_theme_mod( 'online_school_courses_enable_banner_icon_section', false ) === true ) { ?>
								<div class="social-icons">
									<?php if ( get_theme_mod('online_school_courses_banner_facebook_link')) { ?>
										<a target="_blank" href="<?php echo esc_url(get_theme_mod('online_school_courses_banner_facebook_link')); ?>">
											<i class="<?php echo esc_attr(get_theme_mod('online_school_courses_banner_facebook_icon', 'fab fa-facebook-f')); ?>"></i>
											<span class="screen-reader-text"><?php esc_html_e('Facebook', 'online-school-courses'); ?></span>
										</a>
									<?php } ?>
									<?php if ( get_theme_mod('online_school_courses_banner_twitter_link')) { ?>
										<a target="_blank" href="<?php echo esc_url(get_theme_mod('online_school_courses_banner_twitter_link')); ?>">
											<i class="<?php echo esc_attr(get_theme_mod('online_school_courses_banner_twitter_icon', 'fab fa-twitter')); ?>"></i>
											<span class="screen-reader-text"><?php esc_html_e('Twitter', 'online-school-courses'); ?></span>
										</a>
									<?php } ?>
									<?php if ( get_theme_mod('online_school_courses_banner_linkedin_link')) { ?>
										<a target="_blank" href="<?php echo esc_url(get_theme_mod('online_school_courses_banner_linkedin_link')); ?>">
											<i class="<?php echo esc_attr(get_theme_mod('online_school_courses_banner_linkedin_icon', 'fab fa-linkedin')); ?>"></i>
											<span class="screen-reader-text"><?php esc_html_e('Linkedin', 'online-school-courses'); ?></span>
										</a>
									<?php } ?>
									<?php if ( get_theme_mod('online_school_courses_banner_instagram_link')) { ?>
										<a target="_blank" href="<?php echo esc_url(get_theme_mod('online_school_courses_banner_instagram_link')); ?>">
											<i class="<?php echo esc_attr(get_theme_mod('online_school_courses_banner_instagram_icon', 'fab fa-instagram')); ?>"></i>
											<span class="screen-reader-text"><?php esc_html_e('Instagram', 'online-school-courses'); ?></span>
										</a>
									<?php } ?>
								</div>
							<?php } ?>
						</div>
					</div>
					<div class="banner-img wow fadeInDown delay-1000">
						<?php $online_school_courses_default_image_url = get_template_directory_uri() . '/resource/img/default.png';

						if ( ! empty( $online_school_courses_banner_section_image ) ) { ?>
							<img src="<?php echo esc_url( $online_school_courses_banner_section_image ); ?>"/>
						<?php } else { ?>
							<img src="<?php echo esc_url( $online_school_courses_default_image_url ); ?>"/>
						<?php } ?>
					</div>
				</div>
			</div>		
		</div>
	</div>
</section>