<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Cooking Classes
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<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' );
} ?>

<?php if ( get_theme_mod('cooking_classes_preloader', false) != "") { ?>
  <div id="preloader">
    <div id="status">&nbsp;</div>
  </div>
<?php }?>

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

<div id="pageholder" <?php if( get_theme_mod( 'cooking_classes_box_layout', false) != "" ) { echo 'class="boxlayout"'; } ?>>

<header id="header" class="w-100 left-0">
  <div class="container cont-padding0">
    <div class="headerbgimg">

    <div class="w-100">
      <div class="row justify-content-between align-items-center">

        <div class="col-lg-3 col-md-2 text-white align-self-center">
          <div class="logo-bg1">
            <div class="logo-bg2">
            <?php if (get_theme_mod('cooking_classes_logo_enable', true)) { ?>
              <?php cooking_classes_the_custom_logo(); ?>
            <?php } ?>
          <?php $blog_info = get_bloginfo( 'name' ); ?>
          <?php if ( ! empty( $blog_info ) ) : ?>
            <?php if ( get_theme_mod('cooking_classes_title_enable',false) != "") { ?>
              <?php if ( is_front_page() && is_home() ) : ?>
                <h1><a class="text-white" href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></h1>
              <?php else : ?>
                <p class="text-white"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></p>
              <?php endif; ?>
            <?php } ?>
          <?php endif; ?>
            </div>
          </div>
        </div>
        <div class="col-lg-8 col-md-8 pd-0">
          <div class="menubox <?php echo esc_attr(cooking_classes_sticky_menu()); ?>">
            <div class="row md-0">
          <div class="menus col-lg-10 col-md-8 align-self-center">
            <div class="toggle-nav text-center text-md-end py-2">
              <button role="tab"><?php esc_html_e('MENU','cooking-classes'); ?></button>
            </div>
            <div id="mySidenav" class="nav sidenav text-end">
              <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu','cooking-classes' ); ?>">
                <ul class="mobile_nav">
                  <?php 
                    wp_nav_menu( array( 
                      'theme_location' => 'primary',
                      'container_class' => 'main-menu' ,
                      'items_wrap' => '%3$s',
                      'fallback_cb' => 'wp_page_menu',
                    ) ); 
                   ?>
                </ul>
                <a href="javascript:void(0)" class="close-button"><?php esc_html_e('CLOSE','cooking-classes'); ?></a>
              </nav>
            </div>
        </div>

        <div class="socialicon col-lg-2 col-md-4 pd-0 align-self-center">
            <a title="<?php echo esc_attr('facebook', 'cooking-classes'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('cooking_classes_fb_link')); ?>" class="text-decoration-none fs-5 ">
              <i class="fab fa-facebook" aria-hidden="true"></i>
            </a>
            <a title="<?php echo esc_attr('twitter', 'cooking-classes'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('cooking_classes_twitt_link')); ?>" class="text-decoration-none fs-5" >
              <i class="fab fa-twitter" aria-hidden="true"></i>
            </a>
            <a title="<?php echo esc_attr('instagram', 'cooking-classes'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('cooking_classes_insta_link')); ?>" class="text-decoration-none fs-5 ">
              <i class="fab fa-instagram" aria-hidden="true"></i>
            </a>
        </div>
      </div>
    </div>
        </div>

      </div>
    </div>
  </div><!-- header bg img -->
  </div>
</header>