<?php
/**
 * Template part for displaying slider section
 *
 * @package HR Staffing Agency
 * @subpackage hr_staffing_agency
 */

$hr_staffing_agency_slider_arrows = get_theme_mod('hr_staffing_agency_slider_arrows', true);
?>

<?php if ($hr_staffing_agency_slider_arrows) : ?>
  <section id="slider">
    <div class="container-fuild">
      <div class="item">
        <div class="row m-0">
          <div class="col-lg-7 col-md-6 col-12 slider-content-col align-self-center">
            <div class="carousel-caption">
              <div class="inner_carousel">
                <?php if (get_theme_mod('hr_staffing_agency_slider_short_heading')) : ?>
                  <p class="slidetop-text mb-3 text-uppercase"><?php echo esc_html(get_theme_mod('hr_staffing_agency_slider_short_heading')); ?></p>
                <?php endif; ?>
                <?php if ($hr_staffing_agency_title = get_theme_mod('hr_staffing_agency_show_slider_title')) : 
                  $hr_staffing_agency_words = explode(' ', $hr_staffing_agency_title);
                  $hr_staffing_agency_last_word = array_pop($hr_staffing_agency_words);
                  $hr_staffing_agency_before_last = implode(' ', $hr_staffing_agency_words);
                  ?>
                  <h1 class="slider-main-title">
                    <?php if ($hr_staffing_agency_before_last) echo esc_html($hr_staffing_agency_before_last) . ' '; ?>
                    <span class="title-last-word"><?php echo esc_html($hr_staffing_agency_last_word); ?></span>
                  </h1>
                <?php endif; ?>
                <?php if (get_theme_mod('hr_staffing_agency_show_slider_content')) : ?>
                  <p class="slide-content"><?php echo esc_html(get_theme_mod('hr_staffing_agency_show_slider_content')); ?></p>
                <?php endif; ?>
                <div class="more-btn mt-lg-5 mt-md-3 mt-2">
                  <?php if(get_theme_mod('hr_staffing_agency_product_btn_text1','Browse Jobs') != '' && get_theme_mod('hr_staffing_agency_product_btn_link1')){ ?>
                    <a class="text-capitalize me-2 mb-md-0 mb-3 slider-btn1" href="<?php echo esc_url(get_theme_mod('hr_staffing_agency_product_btn_link1')); ?>"><span><?php echo esc_html(get_theme_mod('hr_staffing_agency_product_btn_text1','Browse Jobs')); ?><i class="fas fa-shopping-bag ms-2"></i></span><span class="screen-reader-text"><?php echo esc_html(get_theme_mod('hr_staffing_agency_product_btn_text1','Browse Jobs')); ?></span></a>
                  <?php }?>
                  <?php if(get_theme_mod('hr_staffing_agency_product_btn_text2','Request Talent') != '' && get_theme_mod('hr_staffing_agency_product_btn_link2')){ ?>
                    <a class="mb-3 mb-md-0 slider-btn2" href="<?php echo esc_url(get_theme_mod('hr_staffing_agency_product_btn_link2')); ?>"><span class="text-capitalize"><?php echo esc_html(get_theme_mod('hr_staffing_agency_product_btn_text2','Request Talent')); ?><i class="fas fa-handshake ms-2"></i></span><span class="screen-reader-text"><?php echo esc_html(get_theme_mod('hr_staffing_agency_product_btn_text1','Request Talent')); ?></span></a>
                  <?php }?>
                </div>
              </div>
            </div>
          </div>
          <div class="col-lg-5 col-md-6 px-0">
            <div class="slider-img-col">
              <?php
              $hr_staffing_agency_banner_main_img = get_theme_mod( 'hr_staffing_agency_banner_main_img', get_theme_file_uri( '/assets/images/slider-img.png' ) );
              ?>
              <div class="<?php echo empty( $hr_staffing_agency_banner_main_img ) ? 'no-image1' : ''; ?>">
                <img class="main-img-slide" src="<?php echo esc_url( $hr_staffing_agency_banner_main_img ); ?>" alt="<?php esc_attr_e( 'Background Image 1', 'hr-staffing-agency' ); ?>" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="clearfix"></div>
  </section>
<?php endif; ?>