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

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

<div class="header-top">
  <div class="container">
    <div class="row m-0">
      <div class="col-lg-3 col-md-4 align-self-center">
        <div class="logo text-center">
          <?php smallbiz_startup_the_custom_logo(); ?>
          <?php $blog_info = get_bloginfo( 'name' ); ?>
          <?php if ( ! empty( $blog_info ) ) : ?>
            <div class="site-branding-text">
              <?php if ( get_theme_mod('smallbiz_startup_title_enable',false) != "") { ?>
                <?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 endif; ?>
              <?php $description = get_bloginfo( 'description', 'display' );
              if ( $description || is_customize_preview() ) : ?>
                <?php if ( get_theme_mod('smallbiz_startup_tagline_enable',true) != "") { ?>
                <span class="site-description"><?php echo esc_html( $description ); ?></span>
                <?php } ?>
              <?php endif; ?> 
            </div>
        </div>
      </div>
      <div class="col-lg-4 col-md-4 align-self-center">
        <a class="mailaddress" href="mailto:<?php echo esc_attr(get_theme_mod ('smallbiz_startup_email_address','')); ?>"><?php echo esc_html(get_theme_mod ('smallbiz_startup_email_address','')); ?></a>
      </div>
      <div class="col-lg-5 col-md-4 align-self-center">
        <div class="social-icons">
          <?php if ( get_theme_mod('smallbiz_startup_fb_link') != "") { ?>
            <a title="<?php echo esc_attr('facebook', 'smallbiz-startup'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('smallbiz_startup_fb_link')); ?>"><i class="fab fa-facebook-f"></i></a> 
          <?php } ?>
          <?php if ( get_theme_mod('smallbiz_startup_twitt_link') != "") { ?>
            <a title="<?php echo esc_attr('twitter', 'smallbiz-startup'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('smallbiz_startup_twitt_link')); ?>"><i class="fab fa-twitter"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('smallbiz_startup_linked_link') != "") { ?> 
            <a title="<?php echo esc_attr('linkedin', 'smallbiz-startup'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('smallbiz_startup_linked_link')); ?>"><i class="fab fa-linkedin-in"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('smallbiz_startup_insta_link') != "") { ?> 
            <a title="<?php echo esc_attr('instagram', 'smallbiz-startup'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('smallbiz_startup_insta_link')); ?>"><i class="fab fa-instagram"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('smallbiz_startup_youtube_link') != "") { ?> 
            <a title="<?php echo esc_attr('youtube', 'smallbiz-startup'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('smallbiz_startup_youtube_link')); ?>"><i class="fab fa-youtube"></i></a>
          <?php } ?>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="header <?php echo esc_attr(smallbiz_startup_sticky_menu()); ?>">
  <div class="container">
    <div class="row m-0">
      <div class="col-lg-4 col-md-3">
      </div>
      <div class="col-lg-6 col-md-7 col-5 align-self-center">
        <div class="toggle-nav text-md-right">
            <button role="tab"><?php esc_html_e('MENU','smallbiz-startup'); ?></button>
        </div>
        <div id="mySidenav" class="nav sidenav text-start text-lg-end">
          <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu','smallbiz-startup' ); ?>">
            <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','smallbiz-startup'); ?></a>
          </nav>
        </div>
      </div>
      <div class="col-lg-2 col-md-2 col-7 align-self-center">
        <?php if ( get_theme_mod('smallbiz_startup_contact_us_text') != "" || get_theme_mod('smallbiz_startup_contact_us_url') != "") { ?> 
          <div class="contact-us text-end">
            <a href="<?php echo esc_url(get_theme_mod ('smallbiz_startup_contact_us_url','')); ?>"><?php echo esc_html(get_theme_mod ('smallbiz_startup_contact_us_text','CONTACT US','smallbiz-startup')); ?></a>
          </div>
        <?php }?>
      </div>
    </div>
  </div>
</div>