<?php
/**
* Template Name: Header Two
*
*/
$showSocialIcons = true;
$containerClass = 'container';
$showSocialIcons = get_theme_mod('show_social_icon', true);
$getHeaderContainer = get_theme_mod('header_container_size', 'container');
$containerClass = $getHeaderContainer;
if ('container-custom-size' == $getHeaderContainer) {
	$containerClass = 'container container-custom-size';
}
$menuWrapperClass = 'col-xl-7';

if (false == $showSocialIcons || empty(book_author_blog_social_links())) {
	$menuWrapperClass = 'col-xl-9';
}
?>
<header id="masthead" class="site-header header-one" style="background-image: url(<?php echo esc_url( get_header_image() ); ?>);">
	<div class="header_overlay_color"></div>
	<div class="<?php echo esc_attr($containerClass);?>">
		<div class="row justify-content-between">
			<div class="col-md-5 col-lg-5 col-xl-3 align-self-center order-1 order-md-1 order-lg-1">
				<div class="site-branding header-logo">
					<?php
					if ( has_custom_logo() ) :
						the_custom_logo();
					endif;
					?>
					<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
						<?php
						$book_author_blog_description = get_bloginfo( 'description', 'display' );
						if ( $book_author_blog_description || is_customize_preview() ) :
							?>
						<p class="site-description"><?php echo esc_html( $book_author_blog_description ); /* WPCS: xss ok. */ ?></p>
							<?php
					endif;
					?>
				</div><!-- .site-branding -->
			</div>
			<div class="mt-md-3 mt-0 mt-lg-0 mb-lg-0 col-md-12 col-lg-12 <?php echo esc_attr($menuWrapperClass);?> m-auto align-self-center order-3 order-md-3 order-lg-3 order-xl-2 d-flex justify-content-between justify-content-md-end text-right">
				<div class="cssmenu text-right align-self-center" id="cssmenu">
					<?php
					if (has_nav_menu('main-menu')) :
						wp_nav_menu(
							array(
								'theme_location'    => 'main-menu',
								'container'         => 'ul',
								'fallback_cb'    => '__return_false',
							)
						);
					endif;
					?>
				</div>
			</div>
			<?php
			if (true == $showSocialIcons || !empty(book_author_blog_social_links())) :
			?>
			<div class="col-md-7 col-lg-5 col-xl-2 align-self-center justify-content-center justify-content-md-end text-center text-md-right order-2 order-md-2 order-lg-2 order-xl-3">
				<div class="social-links-wrapper header-social-links">
					<?php
						echo book_author_blog_social_links();
					?>
				</div>
			</div>
			<?php
			endif;
			?>
		</div>
	</div>
</header><!-- #masthead -->

