<?php
/**
 * Template Name: Default Home Page
 */

get_header();
?>

<main id="primary">
    <?php if (get_theme_mod('home_gardening_banner_section_on_off_setting', false)) { ?>
        <section id="main-banner-wrap">
            <div id="banner-area">
                <div class="owl-carousel owl-theme">
                    <?php
                        $home_gardening_banner = get_theme_mod( 'home_gardening_slider');
                        for ( $i = 1; $i <= $home_gardening_banner; $i++ ){ ?>
                        <div class="item">
                            <div class="main-banner-inner-box">
                                <?php
                                $home_gardening_banner_image = get_theme_mod( 'home_gardening_banner_image'.$i, '' );
                                if ( ! empty( $home_gardening_banner_image ) ) { ?>
                                    <img src="<?php echo esc_url( $home_gardening_banner_image ); ?>">
                                <?php } ?>
                            </div>
                            <div class="main-banner-content-box">
                                <?php
                                    $home_gardening_banner_heading_text = get_theme_mod( 'home_gardening_banner_heading_text'.$i, '' );
                                    if ( ! empty( $home_gardening_banner_heading_text ) ) { ?>
                                    <h4><?php echo esc_html( $home_gardening_banner_heading_text ); ?></h4>
                                <?php } ?>
                                <?php
                                    $home_gardening_banner_heading = get_theme_mod( 'home_gardening_banner_heading'.$i, '' );
                                    if ( ! empty( $home_gardening_banner_heading ) ) { ?>
                                    <h3><?php echo esc_html( $home_gardening_banner_heading ); ?></h3>
                                <?php } ?>
                                <?php
                                    $home_gardening_banner_content = get_theme_mod( 'home_gardening_banner_content'.$i, '' );
                                    if ( ! empty( $home_gardening_banner_content ) ) { ?>
                                    <p><?php echo esc_html( $home_gardening_banner_content ); ?></p>
                                <?php } ?>
                                <?php
                                    $home_gardening_banner_btn = get_theme_mod( 'home_gardening_banner_btn'.$i, '' );
                                    $home_gardening_banner_button_link = get_theme_mod( 'home_gardening_banner_button_link'.$i, '' );
                                    if ( ! empty( $home_gardening_banner_btn ) ) { ?>
                                    <a href="<?php echo esc_url( $home_gardening_banner_button_link ); ?>"><?php echo esc_html( $home_gardening_banner_btn ); ?><i class="fas fa-arrow-right ml-2"></i></a>
                                <?php } ?>
                            </div>
                        </div>
                    <?php }?>
                </div>
            </div>
        </section>

        <section id="main-video-wrap">
            <div class="container">
                <div class="row">
                    <div class="col-xl-3 col-lg-4 col-md-5 p-0">
                        <div class="video-section">
                            <?php
                                $home_gardening_video_count = get_theme_mod( 'home_gardening_video_count', '' );
                                if ( ! empty( $home_gardening_video_count ) ) { ?>
                                <h4 class="mb-0"><?php echo esc_html( $home_gardening_video_count ); ?></h4>
                            <?php } ?>
                            <?php
                                $home_gardening_video_count_text = get_theme_mod( 'home_gardening_video_count_text', '' );
                                if ( ! empty( $home_gardening_video_count_text ) ) { ?>
                                <p><?php echo esc_html( $home_gardening_video_count_text ); ?></p>
                            <?php } ?>
                            <?php
                                $home_gardening_video_embed_url = get_theme_mod( 'home_gardening_video_embed_url', '' );
                                if ( ! empty( $home_gardening_video_embed_url ) ) { ?>
                                <embed src="<?php echo esc_url( $home_gardening_video_embed_url ); ?>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></embed>
                            <?php } ?>
                        </div>
                    </div>
                    <div class="col-xl-3 col-lg-4 col-md-5 p-0">
                        <div class="right-side-content">
                            <?php
                                $home_gardening_video_rightside_text = get_theme_mod( 'home_gardening_video_rightside_text', '' );
                                if ( ! empty( $home_gardening_video_rightside_text ) ) { ?>
                                <p class="mb-0"><i class="fas fa-tree"></i> <?php echo esc_html( $home_gardening_video_rightside_text ); ?></p>
                            <?php } ?>
                        </div>
                    </div>
                    <div class="col-xl-6 col-lg-4 col-md-2">
                    </div>
                </div>
            </div>
        </section>
    <?php } ?>

    <?php if (get_theme_mod('home_gardening_services_section_on_off_setting', false)) { ?>
        <section class="services py-5">
            <div class="container">
                <?php
                    $home_gardening_services_short_title = get_theme_mod( 'home_gardening_services_short_title', '' );
                    if ( ! empty( $home_gardening_services_short_title ) ) { ?>
                    <div class="main-heading mb-3">
                        <h4 class="mb-0"><?php echo esc_html( $home_gardening_services_short_title ); ?></h4>
                    </div>
                <?php } ?>
                <?php
                    $home_gardening_services_title = get_theme_mod( 'home_gardening_services_title', '' );
                    if ( ! empty( $home_gardening_services_title ) ) { ?>
                    <div class="main-heading mb-5">
                        <h3 class="mb-0"><?php echo esc_html( $home_gardening_services_title ); ?></h3>
                    </div>
                <?php } ?>            
                <div class="row">
                    <?php
                        $home_gardening_services = get_theme_mod( 'home_gardening_services_count');
                        for ( $i = 1; $i <= $home_gardening_services; $i++ ){ ?>
                        <div class="col-lg-4 col-md-6">
                            <div class="services-box mb-4">
                                <?php
                                    $home_gardening_services_image = get_theme_mod( 'home_gardening_services_image'.$i, '' );
                                    if ( ! empty( $home_gardening_services_image ) ) { ?>
                                        <img src="<?php echo esc_url( $home_gardening_services_image ); ?>">
                                <?php } ?>
                                <div class="inner-service-box">
                                    <div class="service-box-button">
                                        <?php
                                            $home_gardening_service_btn = get_theme_mod( 'home_gardening_service_btn'.$i, '' );
                                            $home_gardening_service_button_link = get_theme_mod( 'home_gardening_service_button_link'.$i, '' );
                                            if ( ! empty( $home_gardening_service_btn ) ) { ?>
                                            <a href="<?php echo esc_url( $home_gardening_service_button_link ); ?>"><?php echo esc_html( $home_gardening_service_btn ); ?><i class="fas fa-arrow-right ml-2"></i></a>
                                        <?php } ?>
                                    </div>
                                    <div class="inner-content-box">
                                        <?php
                                            $home_gardening_services_icon = get_theme_mod( 'home_gardening_services_icon'.$i, '' );
                                            if ( ! empty( $home_gardening_services_icon ) ) { ?>
                                            <i class="<?php echo esc_attr( $home_gardening_services_icon ); ?>"></i>
                                        <?php } ?>
                                        <?php
                                            $home_gardening_services_heading = get_theme_mod( 'home_gardening_services_heading'.$i, '' );
                                            if ( ! empty( $home_gardening_services_heading ) ) { ?>
                                            <h3 class="mb-0"><?php echo esc_html( $home_gardening_services_heading ); ?></h3>
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php }?>
                </div>
            </div>
        </section>
    <?php } ?>

</main>

<?php
get_footer();