<!doctype html>
<html <?php language_attributes(); ?>>
<head class="no-js">
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="profile" href="http://gmpg.org/xfn/11">
	<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
        <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
	<?php endif; ?>
    <?php wp_head(); ?>

</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
    <div class="site-inner container">
        <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'jenny' ); ?></a>

        <header id="masthead" class="site-header" role="banner">

        <div class="site-header-main">

            <div class="site-branding">
            
            	<div class="row">


				<?php 
					$headerlogocol = ' col-8 col-lg-8';
					$headerwidgetcol = ' col-lg-9';
					
					if( is_active_sidebar( 'sidebar-header' )):
	
						$headerlogocol = ' col-8 col-lg-3';
						if ( has_custom_logo() || display_header_text() ) : 
							$headerwidgetcol = ' col-lg-9';
						else:
							$headerwidgetcol =  ' col-lg-12';
						endif; 
					endif;
				?>

		
            		<div class="col-8 <?php echo $headerlogocol; ?> align-self-center">

	                <?php if( function_exists( 'the_custom_logo' ) ) : ?> 
					<?php if ( has_custom_logo() ) : 
						?>
						<div class="site-logo"><?php the_custom_logo(); ?></div>
					<?php endif; ?>
				<?php endif; ?>

				<?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;
	                $description = get_bloginfo( 'description', 'display' );
	                if( $description || is_customize_preview() ) :
	                ?>
	                    <p class="site-description"><?php echo esc_html( $description ); ?></p>
	                <?php endif; ?>
            		</div>

            		<div class="col-4 d-lg-none align-self-center">
		                <button id="menu-toggle" class="menu-toggle toggled-on" aria-expanded="true" aria-controls="site-navigation"><span class="screen-reader-text"><?php esc_html_e( 'Menu', 'jenny' ) ?></span></button>
		                
            		</div>

				<?php if( is_active_sidebar( 'sidebar-header' )): ?>
	            		<div class="col-12'. <?php echo $headerwidgetcol; ?> .' align-self-center mt-3 mt-lg-0">
						<?php get_sidebar('header'); ?>
	            		</div>
				<?php endif; ?>

            	</div>

            </div><!-- .site-branding -->

          <?php if ( has_nav_menu( 'primary' ) && ( jenny_social_search_check() == 1 )) : ?>
		<div class="menu-wrapper row">

			<div id="site-header-menu" class="site-header-menu col-12 col-lg-8">

                        <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'jenny' ); ?>">
				            <?php
				            wp_nav_menu( array(
					            'theme_location' => 'primary',
					            'menu_class'     => 'primary-menu',
					            'fallback_cb'    =>  false
				            ) );
				            ?>
                        </nav><!-- .main-navigation -->
               </div><!-- .site-header-menu -->

			<div class="col-12 col-lg-4">
	
				<?php jenny_social_icons_output(); ?>
				<span class="btn-search fa fa-search icon-button-search"></span>
	
			</div>
		</div><!-- .menu-wrapper -->

		<?php elseif( has_nav_menu( 'primary' ) ): ?>

            <div class="menu-wrapper row">

                <div id="site-header-menu" class="site-header-menu col-12">

                        <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'jenny' ); ?>">
				            <?php
				            wp_nav_menu( array(
					            'theme_location' => 'primary',
					            'menu_class'     => 'primary-menu',
					            'fallback_cb'    =>  false
				            ) );
				            ?>
                        </nav><!-- .main-navigation -->
                </div><!-- .site-header-menu -->

            </div><!-- .menu-wrapper -->
            <?php endif; ?>

        </div><!-- .site-header-main -->

	    <?php if( has_custom_header() ) : ?>
	        <!-- Header Image -->
	        <div class="header-image">
                   <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
				<img src="<?php header_image() ?>">
				</a>
	        </div>
	    <?php endif; ?>
			

	</header>

     <div id="content" class="site-content">