<?php
$flip = false;
$flipclass = array("awsm-figcaption");
if(in_array($options['preset'], array('style-2'))){
	$flip = true;	
	$flipclass = array("awsm-flip-back");
}
?>
<div id="<?php echo esc_attr( $this->add_id( array( 'awsm-team',$id ) ) ) ;?>" class="awsm-grid-wrapper">	<?php
		echo $this->show_team_filter( $team, $id );
	?>

	<?php if ($team->have_posts()): ?>
		<div class="awsm-grid <?php echo esc_attr( $this->item_style($options) );?>">
		<?php
			while ($team->have_posts()): $team->the_post();

    		$teamdata = $this->get_options('awsm_team_member', $team->post->ID);
    		$member_terms = 'awsm-all';
    		$terms = get_the_terms( $team->post->ID, 'awsm_team_filters' );
    		if( !empty( $terms ) ){
	    		foreach ($terms as $member_term) {
	    			$member_terms .= ' awsm-'.str_replace( ' ', '-', $member_term->slug );
	    		}
	    	}
    		?>
				<div id="<?php echo esc_attr( $this->add_id(array('awsm-member',$id,$team->post->ID)));?>" class="awsm-grid-card awsm-team-item awsm-scale-anm <?php echo esc_attr( $member_terms ); ?>">
				   <figure>
				      	<?php $this->checkprint('<div class="awsm-flip-front">',$flip);?>
				         <?php echo $this->get_team_thumbnail( $team->post->ID );?>
				        <?php if($flip):?>
				         <div class="awsm-personal-info">
				            <h3><?php esc_html( the_title() );?></h3>
				            <span><?php echo esc_html( $teamdata['awsm-team-designation'] );?></span>
				         </div>
				     	<?php endif;?>
				        <?php $this->checkprint('</div>',$flip);?>
				         <figcaption class="<?php echo esc_attr( $this->addclass($flipclass) );?>">
				         	<?php $this->checkprint('<div class="awsm-flip-back-inner">',$flip);?>
				            <div class="awsm-personal-info">
				               <h3><?php esc_attr( the_title() );?></h3>
				               <span><?php echo esc_html( $teamdata['awsm-team-designation'] );?></span>
				            </div>
				            <div class="awsm-contact-info">
				                <?php
							    $this->checkprint('<p>%s</p>', esc_html( $teamdata['awsm-team-short-desc'] ) );
							    include( $this->get_template_path( 'social.php', 'partials' ) );
    							?>
				            </div>
				            <?php $this->checkprint('</div>',$flip);?>
				         </figcaption>
				   </figure>
				</div>
			<?php endwhile; wp_reset_postdata();?>
		</div>
	<?php endif;?>
</div>