<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Business Incubator
 */
?>
<!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('business_incubator_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', 'business-incubator' ); ?></a>

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

<div class="mainhead<?php if( get_theme_mod( 'business_incubator_stickyheader', false) == 1) { ?> is-sticky-on"<?php } else { ?>close-sticky <?php } ?>">
  <?php if ( get_theme_mod('business_incubator_enable_topbar', false)) { ?>
    <div class="topbar py-2">
      <div class="container">
        <div class="row">
          <div class="col-xl-4 col-lg-4 col-md-3 col-12 align-self-center phone-box text-lg-start text-md-start text-center mb-lg-0 mb-md-0 mb-2">
            <?php if ( get_theme_mod('business_incubator_phone_number')) { ?>
              <i class="fas fa-phone me-2"></i><a class="phone-no" href="tel:<?php echo esc_url( get_theme_mod('business_incubator_phone_number','' )); ?>"><?php echo esc_html(get_theme_mod ('business_incubator_phone_number','')); ?></a>
            <?php } ?>
          </div>
          <div class="col-xl-4 col-lg-4 col-md-4 col-12 align-self-center email-box text-lg-start text-md-start text-center mb-lg-0 mb-md-0 mb-2">
            <?php if ( get_theme_mod('business_incubator_email_address')) { ?>
              <i class="fa-solid fa-envelope-open-text me-2"></i><a class="mail" href="mailto:<?php echo esc_attr( get_theme_mod('business_incubator_email_address','') ); ?>"><?php echo esc_html(get_theme_mod ('business_incubator_email_address','')); ?></a>
            <?php } ?>
          </div>
          <div class="col-xl-4 col-lg-4 col-md-5 col-12 align-items-center d-flex justify-content-lg-end justify-content-md-end justify-content-center gap-3">
            <div class="social-icons d-flex gap-2 justify-content-end">
              <?php if ( get_theme_mod('business_incubator_instagram_link') != "") { ?>
                <a title="<?php echo esc_attr('instagram', 'business-incubator'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('business_incubator_instagram_link')); ?>"><i class="fa-brands fa-instagram"></i></a>
              <?php } ?>
              <?php if ( get_theme_mod('business_incubator_fb_link') != "") { ?>
                <a title="<?php echo esc_attr('facebook', 'business-incubator'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('business_incubator_fb_link')); ?>"><i class="fa-brands fa-facebook-f"></i></a> 
              <?php } ?>
              <?php if ( get_theme_mod('business_incubator_linkedin_link') != "") { ?> 
                <a title="<?php echo esc_attr('linkedin', 'business-incubator'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('business_incubator_linkedin_link')); ?>"><i class="fa-brands fa-linkedin-in"></i></a>
              <?php } ?>
              <?php if ( get_theme_mod('business_incubator_twitter_link') != "") { ?> 
                <a title="<?php echo esc_attr('twitter', 'business-incubator'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('business_incubator_twitter_link')); ?>"><i class="fa-brands fa-x-twitter"></i></a>
              <?php } ?>
            </div>

            <?php if ( get_theme_mod('business_incubator_header_btn_text') || get_theme_mod('business_incubator_header_btn_url')) { ?>  
              <div class="header-btn">
                <a href="<?php echo esc_url(get_theme_mod ('business_incubator_header_btn_url','')); ?>" class="text-capitalize"><?php echo esc_html(get_theme_mod ('business_incubator_header_btn_text','business-incubator')); ?></a>
              </div>
            <?php }?>

          </div>
        </div>
      </div>
    </div>
  <?php }?>
  <div class="main-header">
    <div class="container">
      <div class="menu-header py-3 position-relative">
        <div class="row">
          <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-6 col-sm-6 col-6 align-self-center py-1">
            <div class="business-incubator-logo">
              <?php if (get_theme_mod('business_incubator_logo_enable', false)) { ?>
                <?php business_incubator_the_custom_logo(); ?>
              <?php } ?>
              <div class="site-branding-text">
                <?php if (get_theme_mod('business_incubator_title_enable', true)) { ?>
                  <?php if (is_front_page() && is_home()) : ?>
                    <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></h1>
                  <?php else : ?>
                    <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></p>
                  <?php endif; ?>
                <?php } ?>
                <?php $business_incubator_description = get_bloginfo('description', 'display');
                if ($business_incubator_description || is_customize_preview()) : ?>
                  <?php if (get_theme_mod('business_incubator_tagline_enable', false)) { ?>
                    <span class="site-description"><?php echo esc_html($business_incubator_description); ?></span>
                  <?php } ?>
                <?php endif; ?>
              </div>
            </div>
          </div>
          <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-6 col-sm-6 col-6 align-self-center">
            <div class="menu-sec d-inline-block">
              <div class="toggle-nav text-center">
                <?php if (has_nav_menu('primary')) { ?>
                  <button role="tab"><?php esc_html_e('Menu', 'business-incubator'); ?></button>
                <?php } ?>
              </div>
              <div id="mySidenav" class="nav sidenav">
                <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e('Top Menu', 'business-incubator'); ?>">
                  <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', 'business-incubator'); ?></a>
                </nav>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>