<?php
/**
 * The header for our theme.
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package culinary
 */

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?PHP
if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
} else {
    do_action( 'wp_body_open' );
} ?>
<div id="page" class="site no-js">
	<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'culinary' ); ?></a>
	
	<header id="masthead" class="site-header" role="banner">
	
		<div class="custom-header">
			<?php if ( get_header_image() ) {
					culinary_display_background_header_image();
				} ?>

		<div class="row">
			<div class="large-12 columns site-branding">
				
				<div class="logo">

				<?php 
					$logo = get_theme_mod( 'culinary_logo' ); 
				if ( !$logo ) {

					if ( is_front_page() ) { ?>
						<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
						<h2><?php bloginfo( 'description' ); ?></h2>
						
						<?php } else { ?>
						<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> 
						<p><?php bloginfo( 'description' ); ?></p>
						<?php } 					
				} else { ?>
					<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img logo src="<?php echo esc_url( $logo ); ?>" alt="<?php bloginfo('name'); ?>"></a>
				<?php } // end logo ?>

    			</div><!-- .logo -->

				<!-- Top Nav -->
				<?php if ( has_nav_menu( 'culinary_header_top' ) ) : ?>
					<nav class="top_mini_nav clearfix" data-topbar>
						<section class="top-bar-section">

							<?php wp_nav_menu(array(
									'container'       => false,
						        	'theme_location'  => 'culinary_header_top',
							        'menu_class'      => 'menu medium-horizontal right_top_nav',
							        'fallback_cb'     => 'culinary_demo_top_header_nav',
							        'depth'          => 1,
							        'items_wrap'      => '<ul id="%1$s" class="%2$s" data-dropdown-menu>%3$s</ul>',
			  					));
							?>
			
			   			 </section><!-- .top-bar-section -->
			  		</nav><!-- .top_mini_nav -->
			  	<?php endif; ?>

  			</div><!-- .large-12 -->

  		</div><!-- .row -->
		</div> <!-- .custom-heaeder -->
		<div class="bottom_header_wrap">
			<div class="row">
	
				<div class="large-12 columns">
			
					<div class="title-bar" data-responsive-toggle="primary-menu" data-hide-for="medium">
						<button class="menu-icon" type="button" data-toggle></button>
						<div class="title-bar-title"><?php _e( 'Menu', 'culinary' ); ?></div>
					</div>
					<div class="top-bar" id="primary-menu">
								
			   		<div id="responsive-menu" class="centered-menu">
				  					  		
				  			<?php wp_nav_menu(array(
					  				'container' => false,
					  				'menu_class' => 'menu vertical medium-horizontal left_top_nav',
					  				'theme_location' => 'culinary_main_menu',
					  				'items_wrap'      => '<ul id="%1$s" class="%2$s" data-responsive-menu="accordion medium-dropdown">%3$s</ul>',
					  				'fallback_cb' => 'culinary_demo_main_menu_nav',
					  				'walker' => new Culinary_Main_Topbar_Menu_Walker(),
					  				));
			     			?>
	
					</div><!-- .responisive-menu -->
					</div><!-- .top-bar -->
				</div><!-- .large-12 -->
			</div><!-- .row -->			
		</div><!-- .bottom_header_wrap -->	
	</header><!-- #masthead -->
	
	<div id="content" class="site-content">
