<?php
/**
 * Banner Section
 * 
 * @package architectonic_structure
 */
$architectonic_structure_banner = get_theme_mod( 'architectonic_structure_banner_setting',false );
$architectonic_structure_banner_btn_url  = get_theme_mod( 'architectonic_structure_banner_btn_url' );
$architectonic_structure_banner_btn_text = get_theme_mod( 'architectonic_structure_banner_btn_text' );
$architectonic_structure_social_icon  = get_theme_mod( 'architectonic_structure_social_icon_setting', false);
$architectonic_structure_project      = get_theme_mod( 'architectonic_structure_project_setting', false );
?>
<?php if ( $architectonic_structure_banner ){?>
    <div class="banner wow fadeInDown" data-wow-duration="1.5s">   
      <?php if ( $architectonic_structure_social_icon ){?>
        <span class="social-links">
            <?php 
                $architectonic_structure_social_link1 = get_theme_mod( 'architectonic_structure_social_link_1' );
                $architectonic_structure_social_link2 = get_theme_mod( 'architectonic_structure_social_link_2' );
                $architectonic_structure_social_link3 = get_theme_mod( 'architectonic_structure_social_link_3' );
                $architectonic_structure_social_link4 = get_theme_mod( 'architectonic_structure_social_link_4' );
                $architectonic_structure_social_link5 = get_theme_mod( 'architectonic_structure_social_link_5' );

                if ( ! empty( $architectonic_structure_social_link1 ) ) {
                    echo '<a class="social1" href="' . esc_url( $architectonic_structure_social_link1 ) . '" target="_blank"><i class="fab fa-facebook-f"></i></a>';
                }
                if ( ! empty( $architectonic_structure_social_link3 ) ) {
                    echo '<a class="social3" href="' . esc_url( $architectonic_structure_social_link3 ) . '" target="_blank"><i class="fab fa-instagram"></i></a>';
                }
                if ( ! empty( $architectonic_structure_social_link2 ) ) {
                    echo '<a class="social2" href="' . esc_url( $architectonic_structure_social_link2 ) . '" target="_blank"><i class="fab fa-twitter"></i></a>';
                } 
                if ( ! empty( $architectonic_structure_social_link4 ) ) {
                    echo '<a class="social4" href="' . esc_url( $architectonic_structure_social_link4 ) . '" target="_blank"><i class="fab fa-linkedin-in"></i></a>';
                }
                if ( ! empty( $architectonic_structure_social_link5 ) ) {
                    echo '<a class="social5" href="' . esc_url( $architectonic_structure_social_link5 ) . '" target="_blank"><i class="fab fa-youtube"></i></a>';
                }
            ?>
        </span>
      <?php } ?> 
      <div class="banner_box">
        <div class="container">
            <div class="row">
            <div class="col-lg-6 col-md-12 align-self-center banner-info">
                <?php 
                    $architectonic_structure_banner_text_extra = get_theme_mod('architectonic_structure_banner_text_extra');
                    if ( $architectonic_structure_banner_text_extra ) : ?>
                    <h4>
                        <?php echo esc_html($architectonic_structure_banner_text_extra); ?>
                    </h4>
                <?php endif; ?>
                <?php 
                    $architectonic_structure_banner_title = get_theme_mod('architectonic_structure_banner_title');
                    if ( $architectonic_structure_banner_title ) : ?>
                    <h1>
                        <?php echo esc_html($architectonic_structure_banner_title); ?>
                    </h1>
                <?php endif; ?>
                <?php if ( get_theme_mod('architectonic_structure_banner_content') ) : ?>
                    <p class="slide-extra-content"><?php echo esc_html(get_theme_mod('architectonic_structure_banner_content')); ?></p>
                <?php endif; ?>
                <div class="banner-buttons">
                <div class="slide-btn-green">
                    <?php if ($architectonic_structure_banner_btn_text ) : ?>
                    <a href="<?php echo esc_url( $architectonic_structure_banner_btn_url ); ?>">                   
                        <?php echo esc_html( $architectonic_structure_banner_btn_text ); ?>
                        <i class="fas fa-arrow-right-long"></i>
                    </a>
                    <?php endif; ?>
                </div>
                </div>
            </div>
            <div class="col-lg-6 col-md-12 align-self-end">
            </div>
            </div>
        </div>
      </div>
      <?php if ( $architectonic_structure_project ) : ?>
        <div class="project-section">
          <div class="container">
            <div class="owl-carousel">
                <?php 
                    $architectonic_structure_catergory_name = get_theme_mod( 'architectonic_structure_project_args_' );
                    $architectonic_structure_args = array(
                        'post_type'           => 'post',
                        'category_name'       => $architectonic_structure_catergory_name,
                        'orderby'             => 'post__in',
                        'ignore_sticky_posts' => true,
                    );
                    $architectonic_structure_loop = new WP_Query( $architectonic_structure_args );
                    if ( $architectonic_structure_loop->have_posts() ) :
                        $architectonic_structure_i = 1;
                        while ( $architectonic_structure_loop->have_posts() ) : $architectonic_structure_loop->the_post(); ?>
                        <div class="box wow zoomIn" data-wow-duration="2s">                               
                            <div class="image-blog">
                                <?php 
                                    if ( has_post_thumbnail() ) {
                                        the_post_thumbnail( 'medium' );
                                    } else {
                                ?>
                                <img src="<?php echo esc_url( get_stylesheet_directory_uri() . '/images/default.png' ); ?>" alt="<?php the_title_attribute(); ?>">
                                <?php } ?>
                            </div>                             
                            <div class="box-content mt-3">
                                <h4 class="title mb-2 mt-3">
                                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                </h4>
                                <p class="mb-0"><?php echo wp_trim_words( get_the_content(), 15 ); ?></p>
                            </div>
                        </div>
                        <?php 
                        $architectonic_structure_i++;
                        endwhile;
                    endif;
                ?>
            </div>
          </div>
        </div>
      <?php endif; ?>
    </div>
<?php } ?>