<?php 
/**
 * Template part for displaying Featured Slider Section
 *
 *@package Super Business
 */

    $number_of_featured_slider_items         = super_business_get_option( 'number_of_featured_slider_items' ); ?>

    <div class="section-content" data-slick='{"slidesToShow": 1, "slidesToScroll": 1, "infinite": false, "speed": 1000, "dots": true, "arrows": true, "autoplay": false, "draggable": true, "fade": false }'>

        <?php for( $i=1; $i<=$number_of_featured_slider_items; $i++ ) : 
            $featured_slider_slide_image[$i]            = super_business_get_option( 'featured_slider_slide_image_'.$i );

            $featured_slider_subtitle[$i]               = super_business_get_option( 'featured_slider_subtitle_'.$i );

            $featured_slider_title[$i]                  = super_business_get_option( 'featured_slider_title_'.$i );

            $featured_slider_btn_text_one[$i]           = super_business_get_option( 'featured_slider_btn_text_one_'.$i );

            $featured_slider_btn_url_one[$i]            = super_business_get_option( 'featured_slider_btn_url_one_'.$i );     
        ?>

        <article class="<?php echo esc_attr($class); ?>" style="background-image: url('<?php echo esc_url( $featured_slider_slide_image[$i] ); ?>');">
            <div class="overlay"></div>
            <div class="wrapper">
                <div class="featured-content-wrapper">
                    <?php if( !empty($featured_slider_subtitle[$i]) || !empty($featured_slider_title[$i]) ): ?>
                        <header class="entry-header">
                            <?php if( !empty($featured_slider_subtitle[$i]) ): ?>
                                <h3 class="entry-subtitle"><?php echo esc_html($featured_slider_subtitle[$i]); ?></h3>
                            <?php endif; ?>

                            <?php if( !empty($featured_slider_title[$i]) ): ?>
                                <h2 class="entry-title"><?php echo esc_html( $featured_slider_title[$i] ); ?></h2>
                            <?php endif; ?>
                        </header>
                    <?php endif; ?>

                    <?php if( !empty($featured_slider_btn_text_one[$i]) ): ?>
                        <div class="read-more">
                            <?php if( !empty($featured_slider_btn_text_one[$i]) ): ?>
                                <a href="<?php echo esc_attr($featured_slider_btn_url_one[$i]);?>" class="btn"><?php echo esc_html($featured_slider_btn_text_one[$i]);?></a>
                            <?php endif; ?>
                        </div><!-- .read-more -->
                    <?php endif; ?>
                </div><!-- .featured-content-wrapper -->
            </div><!-- .wrapper -->
        </article>
        <?php endfor; ?>
    </div><!-- .section-content -->