<?php
/**
 * The header for our theme
 *
 * @subpackage Wood House Construction
 * @since 1.0
 * @version 0.1
 */

?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

<?php if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
} else {
    do_action( 'wp_body_open' );
}?>

<a class="screen-reader-text skip-link" href="#skip-content"><?php esc_html_e( 'Skip to content', 'wood-house-construction' ); ?></a>

<div id="header">
	<div class="main-header">
		<div class="top-head">
			<div class="container">
				<div class="row mr-0">
					<!-- <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-6 col-12"> -->
					<div class="s-media">
						<li>
							<?php 
								$fb_link = get_theme_mod('luzuk_wood_house_construction_fblink', '#');
								if ($fb_link) { 
								?>
									<a href="<?php echo esc_url($fb_link); ?>">
										<i class="fab fa-facebook-f"></i>
									</a>
							<?php } ?>
						</li>
						
						<li>
							<?php 
								$instagram_link = get_theme_mod('luzuk_wood_house_construction_instagramlink', '#');
								if ($instagram_link) { 
								?>
									<a href="<?php echo esc_url($instagram_link); ?>">
										<i class="fa-brands fa-instagram"></i>
									</a>
							<?php } ?>
						</li>

						<li>
							<?php 
								$twitter_link = get_theme_mod('luzuk_wood_house_construction_twitterlink', '#');
								if ($twitter_link) { 
								?>
									<a href="<?php echo esc_url($twitter_link); ?>">
										<i class="fa-brands fa-x-twitter"></i>
									</a>
							<?php } ?>
						</li> 

						<li>
							<?php 
								$linkedin_link = get_theme_mod('luzuk_wood_house_construction_linkedinlink', '#');
								if ($linkedin_link) { 
								?>
									<a href="<?php echo esc_url($linkedin_link); ?>">
										<i class="fa-brands fa-linkedin"></i>				
									</a>
							<?php } ?>
						</li>
					
					</div>
		
					<!-- </div> -->
					<div class="mailbx">
						
						<div class="mail">
							<?php
								$mail_number = get_theme_mod( 'luzuk_wood_house_construction_header_mail', 'info@example.example' );

								if ( ! empty( $mail_number ) ) :
							?>
								<a href="<?php echo esc_attr( 'mailto:' . $mail_number ); ?>">
									<i class="far fa-envelope"></i>
									<span class="tooltiptext">
										<?php echo esc_html( $mail_number ); ?>
									</span>
								</a>
							<?php endif; ?>
						</div>

						<div class="address">				
							<?php
								$address_number = get_theme_mod( 'luzuk_wood_house_construction_header_address', 'JI. Raya Puputan No 142, NY - 80234' );

								if ( ! empty( $address_number ) ) :
							?>
								<p>
									<i class="fa-solid fa-location-dot"></i>
									<span class="tooltiptext">
										<?php echo esc_html( $address_number ); ?>
									</span>
								</p>
							<?php endif; ?>
						</div>
					</div>
					<div class="chlpbx">
						<?php
							$help_link    = get_theme_mod( 'luzuk_wood_house_construction_headerhelplink', '#' );
							$support_link = get_theme_mod( 'luzuk_wood_house_construction_headersupportlink', '#' );
							$contact_link = get_theme_mod( 'luzuk_wood_house_construction_headercontactlink', '#' );
						?>

						<a class="acbtn" href="<?php echo esc_url( $help_link ); ?>">
							<?php esc_html_e( 'Help', 'wood-house-construction' ); ?>
						</a>

						<a class="acbtn" href="<?php echo esc_url( $support_link ); ?>">
							<?php esc_html_e( '/ Support', 'wood-house-construction' ); ?>
						</a>

						<a class="acbtn" href="<?php echo esc_url( $contact_link ); ?>">
							<?php esc_html_e( '/ Contact', 'wood-house-construction' ); ?>
						</a>
					</div>
				</div>
			</div>
		</div>
		<div class="bott-head">
			<div class="container">
				<div class="row mr-0">
					<div class="logobx">
						<div class="logo">
							<?php if ( has_custom_logo() ) : ?>
								<?php the_custom_logo(); ?>
							<?php endif; ?>
							<?php if (get_theme_mod('luzuk_wood_house_construction_show_site_title',true)) {?>
								<?php $blog_info = get_bloginfo( 'name' ); ?>
								<?php if ( ! empty( $blog_info ) ) : ?>
									<?php if ( is_front_page() && is_home() ) : ?>
										<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
									<?php else : ?>
										<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
									<?php endif; ?>
								<?php endif; ?>
							<?php }?>
							<?php if (get_theme_mod('luzuk_wood_house_construction_show_tagline',true)) {?>
								<?php $description = get_bloginfo( 'description', 'display' );
								if ( $description || is_customize_preview() ) : ?>
									<p class="site-description"><?php echo esc_html($description); ?></p>
								<?php endif; ?>
							<?php }?>
						</div>
					</div>
					<div class=" m-headbox">
						<div class="m-head">
							<div class="header-inner section-inner">
								<div class="header-titles-wrapper">
									<button class="toggle nav-toggle mobile-nav-toggle" data-toggle-target=".menu-modal"  data-toggle-body-class="showing-menu-modal" aria-expanded="false" data-set-focus=".close-nav-toggle">
										<span class="toggle-inner">
											<span class="toggle-icon">
												<i class="fas fa-bars"></i>
											</span>
										</span>
									</button><!-- .nav-toggle -->
								</div><!-- .header-titles-wrapper -->

								<div class="header-navigation-wrapper">
									<?php
									if ( has_nav_menu( 'primary' ) || ! has_nav_menu( 'expanded' ) ) {
										?>
										<nav class="primary-menu-wrapper" aria-label="<?php echo esc_attr_x( 'Horizontal', 'menu', 'wood-house-construction' ); ?>">
											<ul class="primary-menu reset-list-style">
												<?php
												if ( has_nav_menu( 'primary' ) ) {

													wp_nav_menu(
														array(
															'container'  => '',
															'items_wrap' => '%3$s',
															'theme_location' => 'primary',
														)
													);

												} elseif ( ! has_nav_menu( 'expanded' ) ) {

													wp_list_pages(
														array(
															'match_menu_classes' => true,
															'show_sub_menu_icons' => true,
															'title_li' => false,
															'walker'   => new Wood_House_Construction_Walker_Page(),
														)
													);
												}
												?>
											</ul>
										</nav><!-- .primary-menu-wrapper -->
									<?php } ?>
								</div><!-- .header-navigation-wrapper -->
							</div><!-- .header-inner -->
							<?php
								// Output the menu modal.
								get_template_part( '/inc/modal-menu' );
							?>
							<!-- </div> -->
						</div>
					</div>

					<div class="h-btnbox">
						<div class="headerbtn">
							<div class="h-phbx">					
								<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone text-wood-600">
									<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
								</svg> 

								<?php
									$phone = get_theme_mod( 'luzuk_wood_house_construction_headerphonenum', '+1 (234) 567-890' );
									$phone_clean = preg_replace( '/[^0-9+]/', '', $phone ); // clean for tel link
								?>

								<a class="phonenum" href="<?php echo esc_attr( 'tel:' . $phone_clean ); ?>">
									<?php echo esc_html( $phone ); ?>
								</a>
							</div>

							<?php
								$btn_link = get_theme_mod( 'luzuk_wood_house_construction_headerbtnlink', '#' );
								$btn_text = get_theme_mod( 'luzuk_wood_house_construction_headerbtntext', 'Get Quote' );
							?>

							<a class="gsbtn" href="<?php echo esc_url( $btn_link ); ?>">
								<?php echo esc_html( $btn_text ); ?>
							</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<?php if(is_singular()) {?>
	<div id="inner-pages-header">
		<div class="header-overlay"></div>
	    <div class="header-content">
		    <div class="container"> 
		      	<h1><?php single_post_title(); ?></h1>
		      	<div class="innheader-border"></div>
		      	<div class="theme-breadcrumb mt-2">
					<?php luzuk_wood_house_construction_breadcrumb();?>
				</div>
		    </div>
		</div>
	</div>
<?php } ?>