<?php 
/**
 * Template part for displaying Our Team Section
 *
 *@package Rock Studio
 */
    $our_team_section_title           = rock_studio_get_option( 'our_team_section_title' );
    $number_of_our_team_items         = rock_studio_get_option( 'number_of_our_team_items' ); ?>

    <?php if( !empty($our_team_section_title) ): ?>
        <div class="section-header">
            <h2 class="section-title"><?php echo esc_html($our_team_section_title);?></h2>
        </div><!-- .section-header -->
    <?php endif; ?>

    <div class="section-content col-3 clear">
        <?php for( $i=1; $i<=$number_of_our_team_items; $i++ ) : 
            $our_team_image[$i]             = rock_studio_get_option( 'our_team_image_'.$i );
            $our_team_name[$i]              = rock_studio_get_option( 'our_team_name_'.$i );
            $our_team_name_url[$i]          = rock_studio_get_option( 'our_team_name_url_'.$i );
            $our_team_position[$i]          = rock_studio_get_option( 'our_team_position_'.$i );
            $our_team_social_link_one[$i]   = rock_studio_get_option( 'our_team_social_link_one_'.$i );
            $our_team_social_link_two[$i]   = rock_studio_get_option( 'our_team_social_link_two_'.$i );
            $our_team_social_link_three[$i] = rock_studio_get_option( 'our_team_social_link_three_'.$i );
            $our_team_social_link_four[$i]  = rock_studio_get_option( 'our_team_social_link_four_'.$i );
        ?>          
            
        <article>
            <div class="team-item">
                <div class="featured-image" style="background-image: url('<?php echo esc_url($our_team_image[$i]); ?>');">
                </div><!-- .featured-image -->

                <div class="entry-container">
                    <?php if( !empty($our_team_name[$i]) || !empty($our_team_position[$i]) ):?>
                        <header class="entry-header">
                            <?php if( !empty($our_team_name[$i]) ):?>
                                <h2 class="entry-title"><a href="<?php echo esc_html( $our_team_name_url[$i] ); ?>"><?php echo esc_html( $our_team_name[$i] ); ?></a></h2>
                            <?php endif; ?>

                            <?php if( !empty($our_team_position[$i]) ): ?>
                                <p class="position"><?php echo esc_html( $our_team_position[$i] ); ?></p>
                            <?php endif; ?>
                        </header>
                    <?php endif; ?>

                    <div class="social-icons">
                        <ul>
                            <?php if( !empty($our_team_social_link_one[$i]) ):?>
                                <li><a href="<?php echo esc_url($our_team_social_link_one[$i]);?>" target="_blank"></a></li>
                            <?php endif;?>

                            <?php if( !empty($our_team_social_link_two[$i]) ):?>
                                <li><a href="<?php echo esc_url($our_team_social_link_two[$i]);?>" target="_blank"></a></li>
                            <?php endif;?>

                            <?php if( !empty($our_team_social_link_three[$i]) ):?>
                                <li><a href="<?php echo esc_url($our_team_social_link_three[$i]);?>" target="_blank"></a></li>
                            <?php endif;?>

                            <?php if( !empty($our_team_social_link_four[$i]) ):?>
                                <li><a href="<?php echo esc_url($our_team_social_link_four[$i]);?>" target="_blank"></a></li>
                            <?php endif;?>
                        </ul>
                    </div><!-- .social-icons -->
                </div><!-- .entry-container -->
            </div><!-- .team-item -->
        </article>
        <?php endfor; ?>
    </div><!-- .section-content -->