<?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 class="project-area " id="project" style="<?php echo esc_attr($project_areaTpadding); ?>" "<?php echo esc_attr($project_areaBpadding); ?>">
	  <div class="row"> 
		<div class="project-single-area col-md-12 pd-0"> 
			<?php
				$project_page_id = get_theme_mod('project_page');	
				$project_subtitle = get_theme_mod('project_subtitle', 'Latest Project');
				$project_maintitle = get_theme_mod('project_maintitle', 'Our Recent Project');
				
			?>

			<div class="container">
				<div class="row justify-content-center">
					  <div class="section-title">
					    <div class="sub-title">
					    	<?php echo ($project_subtitle);  ?>
					    </div>
					    <?php if($project_maintitle ){ ?>
						    <h2><?php echo ($project_maintitle);  ?></h2> 
				      
			         <?php }?>
			      </div>
				</div>
			</div>

			<div class="container">
				<?php 
				$showStatic = true;
				$cols = get_theme_mod('project_npp_count', 2);
				$cols++;
				switch($cols){
					case 1:
					$colCls = 'col-md-12 col-sm-12';
					break;
					case 2:	
					$colCls = 'col-md-6 col-sm-6';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					$colCls = 'col-md-4 col-sm-6';
					break;
					default: 
					$colCls = 'col-md-4 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="ovrly"></div>
										</a>
								</div>
								<div class="project-title-box">
									<p class="pk-text">Design Industry</p>
									<a href="<?php echo esc_url(get_permalink()); ?>">
									  <h4>Oil & Gas Engineering</h4>
									</a>
									
									
									 

									<div class="clearfix"></div>
								</div>
								<div class="clearfix"></div>
							</div>
						</div>
						<?php 
					}
				} ?>
			<div class="clearfix"></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 }
