<?php
/**
 * The template for displaying team content
 *
 * @package SimClick
 */
?>

<?php
$enable_content = get_theme_mod( 'signify_team_option', 'disabled' );

if ( ! signify_check_section( $enable_content ) ) {
	// Bail if team content is disabled.
	return;
}

$type       = get_theme_mod( 'signify_team_type', 'category' );
$layout     = get_theme_mod( 'signify_team_layout', 'layout-four' );
$text_align = get_theme_mod( 'signify_team_text_align', 'text-align-center' );

$classes[] = 'team-section';
$classes[] = 'section';
$classes[] = $text_align;
$classes[] = $type;

$signify_sub_title   = get_theme_mod( 'signify_team_sub_title' );
$signify_title       = get_theme_mod( 'signify_team_title' );
$signify_description = get_theme_mod( 'signify_team_description' );

if ( ! $signify_sub_title && ! $signify_title && ! $signify_description ) {
	$classes[] = 'no-section-heading';
}

?>

<div id="team-content-section" class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
	<div class="wrapper">
		<?php signify_section_header( $signify_sub_title, $signify_title, $signify_description ); ?>

		<div class="team-content-wrapper section-content-wrapper <?php echo esc_attr( $layout ); ?>">

			<?php
			if ( 'custom' === $type ) {
				get_template_part( 'template-parts/team/content', 'custom' );
			} else {
				get_template_part( 'template-parts/team/content', 'team' );
			}

			$target = get_theme_mod( 'signify_team_target' ) ? '_blank': '_self';
			$signify_link   = get_theme_mod( 'signify_team_link', '#' );
			$text   = get_theme_mod( 'signify_team_text', esc_html__( 'View All', 'signify-pro' ) );

			if ( $text ) :
			?>

			<p class="view-more">
				<a class="button" target="<?php echo $target; ?>" href="<?php echo esc_url( $signify_link ); ?>"><?php echo esc_html( $text ); ?></a>
			</p>
			<?php endif; ?>

		</div><!-- .team-wrapper -->
	</div><!-- .wrapper -->
</div><!-- #team-section -->
