<?php
/**
 * The Header for our theme.
 * @package Home Tutor
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
  <meta charset="<?php bloginfo( 'charset' ); ?>">
  <meta name="viewport" content="width=device-width">
  <?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('home_tutor_preloader',false) != '' || get_theme_mod( 'home_tutor_display_preloader',false) != ''){ ?>
    <div class="frame w-100 h-100">
      <div class="loader">
        <div class="dot-1"></div>
        <div class="dot-2"></div>
        <div class="dot-3"></div>
      </div>
    </div>
  <?php }?>
<header role="banner" class="header-box">
  <a class="screen-reader-text skip-link" href="#skip_content"><?php esc_html_e( 'Skip to content', 'home-tutor' ); ?></a>
  <?php if ( get_theme_mod( 'home_tutor_topbar_hide', false ) ) { ?>
    <div class="home-tutor-topbar py-2 wow fadeInDown">
      <div class="container">
        <?php if ( get_theme_mod( 'home_tutor_topbar_text') != '' ){ ?>
          <p class="home-tutor-top-text text-center">
            <?php echo esc_html( get_theme_mod( 'home_tutor_topbar_text') ); ?>
          </p>
        <?php } ?>
      </div>
    </div>
  <?php }?>
  <div class="header-bottom py-2 wow fadeInDown">
    <div class="container">
      <div class="row">
        <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-6 col-12 align-self-center logo-box">
          <div class="home-tutor-logo">
            <div class="row">
              <div class="<?php if( get_theme_mod( 'home_tutor_site_logo_inline') != '') { ?>col-lg-5 col-md-5 col-5<?php } else { ?>col-lg-12 col-md-12 align-self-center<?php } ?>">
                <?php if ( has_custom_logo() ) : ?>
                  <div class="site-logo"><?php the_custom_logo(); ?></div>
                <?php endif; ?>
              </div>
              <div class="<?php if( get_theme_mod( 'home_tutor_site_logo_inline') != '') { ?>col-lg-7 col-md-7 col-7 site-logo-inline"<?php } else { ?>col-lg-12 col-md-12 align-self-center<?php } ?>">
                <?php $home_tutor_blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $home_tutor_blog_info ) ) : ?>
                  <?php if( get_theme_mod('home_tutor_site_title_enable',true) != ''){ ?>
                    <?php if ( is_front_page() && is_home() ) : ?>
                      <h1 class="site-title pb-0"><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 }?>
                <?php endif; ?>
                <?php
                $home_tutor_description = get_bloginfo( 'description', 'display' );
                if ( $home_tutor_description || is_customize_preview() ) : ?>
                  <?php if( get_theme_mod('home_tutor_site_tagline_enable',false) != ''){ ?>
                    <p class="site-description"><?php echo esc_html($home_tutor_description); ?></p>
                  <?php }?>
                <?php endif; ?>
              </div>
            </div>
          </div>
        </div>
        <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-6 col-12 align-self-center menu-box">
          <div class="navigation-header">
            <div class="toggle-nav mobile-menu">
              <button onclick="home_tutor_openNav()"><i class="<?php echo esc_attr(get_theme_mod('home_tutor_responsive_menu_open_icon','fas fa-bars')); ?>"></i></button>
            </div>
            <div id="mySidenav" class="nav sidenav">
              <nav id="site-navigation" class="main-navigation navbar navbar-expand-xl" aria-label="<?php esc_attr_e( 'Top Menu', 'home-tutor' ); ?>">
                <?php {
                  wp_nav_menu(
                    array(
                      'theme_location' => 'primary',
                      'menu_class'     => 'menu', 
                      'items_wrap'     => '<ul id="%1$s" class="%2$s">%3$s</ul>',
                      'fallback_cb' => 'wp_page_menu',
                    )
                  );
                } ?>
              </nav>
              <a href="javascript:void(0)" class="closebtn mobile-menu" onclick="home_tutor_closeNav()"><i class="<?php echo esc_attr(get_theme_mod('home_tutor_responsive_menu_close_icon','fas fa-times')); ?>"></i></a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</header>
