<?php
/**
 * Template Part for displaying Services section in homepage
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package NDesign
 */

if ( get_theme_mod( 'team_title' ) || get_theme_mod( 'team_subtitle' ) || get_theme_mod( 'meet_the_team' ) ) : ?>
<section class="our-team-section grey-section page-section" id="team">
	<div class="container">
		<div class="row">
			<div class="col-12">
				<div class="main-title-blk">
					<!-- Subtitle start -->
					<?php if ( get_theme_mod( 'team_subtitle' ) ) : ?>
						<h4 class="main-subtitle text-center about-subtitle">
							<?php echo esc_html( get_theme_mod( 'team_subtitle' ) ); ?>
						</h4>
					<?php endif ?>
					<!-- Subtitle End -->
					<!-- Title Start -->
					<?php if ( get_theme_mod( 'team_title' ) ) : ?>
						<h2 class="main-title text-center">
							<?php echo esc_html( get_theme_mod( 'team_title' ) ); ?>
						</h2>
					<?php endif ?>
					<!-- Title End -->
				</div>
			</div>
		</div>
		<?php
		$ndesign_team = get_theme_mod( 'meet_the_team' );
		if ( ! empty( $ndesign_team ) ) {
			?>
			<div class="row">
				<div class="col-12 team-slider-wrap">
					<!-- Team Slider Start -->
					<div class="team-slider swiper-container">
						<div class="swiper-wrapper">
							<?php foreach ( $ndesign_team as $ndesign_key => $ndesign_val ) { ?>
								<div class="swiper-slide">
									<div class="team-blk text-center">
										<!-- Team Image Start -->
										<div class="team-image">
											<?php if ( $ndesign_val['team_image'] ) { ?>
												<img src="<?php echo esc_url(wp_get_attachment_url( $ndesign_val['team_image'] )); ?>">
											<?php } else { ?>
												<img src="<?php echo esc_url(get_template_directory_uri() . '/images/ndesign_team_placeholder_grey.png'); ?>">
											<?php } ?>
										</div>
										<!-- Team Image End -->
										<!-- Team Detail Start -->
										<?php if ( $ndesign_val['team_name'] || $ndesign_val['team_designation'] ) { ?>
											<div class="team-detail">
												<?php if ( $ndesign_val['team_name'] ) { ?>
													<h3 class="team-title">
														<?php echo esc_html( $ndesign_val['team_name'] ); ?>
													</h3>
												<?php } ?>
												<?php if ( $ndesign_val['team_designation'] ) { ?>
													<p class="team-description">
														<?php echo esc_html( $ndesign_val['team_designation'] ); ?>
													</p>
												<?php } ?>
											</div>
										<?php } ?>
										<!-- Team Detail End -->
									</div>
								</div>
							<?php } ?>
						</div>
						<!-- Slider Pagination Start -->
						<div class="swiper-pagination"></div>
						<!-- Slider Pagination end -->
					</div>
					<!-- Team Slider End -->
					<!-- Slider Navigation start -->
					<div class="swiper-button-next"></div>
					<div class="swiper-button-prev"></div>
					<!-- Slider Navigation End -->
				</div>
			</div>
		<?php } ?>
	</div>
</section>
<?php endif ?>
<!-- Our Team Section End -->
