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

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

<?php if ( get_theme_mod('classic_corporate_topbar', true) != "") { ?>
  <div class="header-top">
    <div class="row m-0">
      <div class="col-lg-6 col-md-3 align-self-center">
        <div class="social-icons">
          <?php if ( get_theme_mod('classic_corporate_fb_link') != "") { ?>
            <a title="<?php echo esc_attr('facebook', 'classic-corporate'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_corporate_fb_link')); ?>"><i class="fab fa-facebook-f"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('classic_corporate_twitt_link') != "") { ?>
            <a title="<?php echo esc_attr('twitter', 'classic-corporate'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_corporate_twitt_link')); ?>"><i class="fab fa-twitter"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('classic_corporate_linked_link') != "") { ?>
            <a title="<?php echo esc_attr('linkedin', 'classic-corporate'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_corporate_linked_link')); ?>"><i class="fab fa-linkedin-in"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('classic_corporate_rss_link') != "") { ?>
            <a title="<?php echo esc_attr('instagram', 'classic-corporate'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_corporate_rss_link')); ?>"><i class="fas fa-rss"></i></a>
          <?php } ?>
          <?php if ( get_theme_mod('classic_corporate_youtube_link') != "") { ?>
            <a title="<?php echo esc_attr('youtube', 'classic-corporate'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_corporate_youtube_link')); ?>"><i class="fab fa-youtube"></i></a>
          <?php } ?>
        </div>
      </div>
      <div class="col-lg-6 col-md-9 p-0 align-self-center">
        <div class="info-box">
          <?php if ( get_theme_mod('classic_corporate_phone_number') != "") { ?>
            <a class="phn" href="tel:<?php echo esc_url( get_theme_mod('classic_corporate_phone_number','' )); ?>"><i class="fas fa-phone"></i><?php echo esc_html(get_theme_mod ('classic_corporate_phone_number','')); ?></a>
          <?php } ?>
          <?php if ( get_theme_mod('classic_corporate_email_address') != "") { ?>
            <a class="mail" href="mailto:<?php echo esc_attr( get_theme_mod('classic_corporate_email_address','') ); ?>"><i class="far fa-envelope"></i><?php echo esc_html(get_theme_mod ('classic_corporate_email_address','')); ?></a>
          <?php } ?>
        </div>
      </div>
    </div>
  </div>
<?php } ?>

<div class="header py-3 <?php echo esc_attr(classic_corporate_sticky_menu()); ?>">
  <div class="container">
    <div class="row m-0">
      <div class="col-lg-3 col-md-8 align-self-center">
        <div class="classic-corporate-logo">
          <?php if (get_theme_mod('classic_corporate_logo_enable', true)) { ?>
            <?php classic_corporate_the_custom_logo(); ?>
          <?php } ?>
          <div class="site-branding-text">
            <?php if ( get_theme_mod('classic_corporate_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 $classic_corporate_description = get_bloginfo( 'description', 'display' );
            if ( $classic_corporate_description || is_customize_preview() ) : ?>
              <?php if ( get_theme_mod('classic_corporate_tagline_enable',false) != "") { ?>
              <span class="site-description"><?php echo esc_html( $classic_corporate_description ); ?></span>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
      </div>
      <div class="col-lg-9 col-md-4 align-self-center">
        <div class="toggle-nav">
          <button role="tab"><?php esc_html_e('MENU','classic-corporate'); ?></button>
        </div>
        <div id="mySidenav" class="nav sidenav">
          <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu','classic-corporate' ); ?>">
            <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','classic-corporate'); ?></a>
          </nav>
        </div>
      </div>
    </div>
  </div>
</div>
