<?php   
if(get_theme_mod('project_area_disable') != 'on' ){ ?>
	<?php 
		if( get_theme_mod('project_areaTpadding',true) ) {
			$project_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('project_areaTpadding')).';';
		}
		if( get_theme_mod('project_areaBpadding',true) ) {
			$project_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('project_areaBpadding')).';';
		}
	?>	

<div id="project" class="project-area ">
	<div class="container">
	  	<div class="row"> 
			<div class="project-single-area"> 
			<?php
			
			$project_maintitle = get_theme_mod('project_maintitle', 'OUR LATEST PROJECTS');
			$project_subtitle = get_theme_mod('project_subtitle', 'OUR WORK');
			?>
				<div class="row justify-content-center">
					<?php if($project_maintitle || $project_subtitle ){ ?>	
					<div class="section-title">
						<h2><?php echo ($project_maintitle); ?></h2>
						<h3><?php echo ($project_subtitle); ?></h3>
					</div>
					<?php }?>
				</div>
			
			 	<div class="row "> 
				<?php 
				$showStatic = true;
				$cols = get_theme_mod('project_npp_count', 3);
				$cols++;
				switch($cols){
					case 1:
					$colCls = 'col-lg-12 col-md-12 col-sm-12';
					break;
					case 2:	
					$colCls = 'col-lg-6 col-md-6 col-sm-6';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					case 13:
					case 15:
					$colCls = 'col-lg-4 col-md-6 col-sm-6';
					break;
					default: 
					$colCls = 'col-lg-3 col-md-6 col-sm-6';
					break;
				}
				for( $i = 1; $i <= $cols; $i++ ){
					$project_page_id = get_theme_mod('project_page'.$i); 
					$project_page_icon = get_theme_mod('project_page_icon'.$i);
					$project_page_icon1 = get_theme_mod('project_page_icon1'.$i);
					if($project_page_id){
						$showStatic = false;
						echo projectshortCode($project_page_id, $isCustomizer=true, $i);
					}
				}
				if($showStatic === true){
					for( $i = 1; $i <= $cols; $i++ ){ ?>
					<div class="<?php echo $colCls;?> single-project-bx ">
						<div  class="single-project">
							<div project-match-height="groupName" class="project-icon">
								<a href="<?php echo esc_url(get_permalink()); ?>">
								 	<img class="img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/project1.jpg');?>" alt="project" />
								 	<div class="oly"></div>
								</a>
							</div>
							<div class="project-title-box">
								<a href="<?php echo esc_url(get_permalink()); ?>">
								  	<h2>Sink Installation</h2>
								</a>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has industrys standerd dummy text ever since the 1500s.</p> 
								
								<div class="clearfix"></div>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>
						<?php 
					}
				} ?>
				<div class="clearfix"></div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	var matchHeight = function () {
	
	function init() {
		eventListeners();
		matchHeight();
	}
	
	function eventListeners(){
		$(window).on('resize', function() {
			matchHeight();
		});
	}
	
	function matchHeight(){
		var groupName = $('[project-match-height]');
		var groupHeights = [];
		
		groupName.css('min-height', 'auto');
		
		groupName.each(function() {
			groupHeights.push($(this).outerHeight());
		});
		
		var maxHeight = Math.max.apply(null, groupHeights);
		groupName.css('min-height', maxHeight);
	};
	
	return {
		init: init
	};
	
} ();

$(document).ready(function() {
	matchHeight.init();
});
</script>
<?php }
