<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Classic Digital Marketing
 */
?>
<!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_digital_marketing_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-digital-marketing' ); ?></a>

<div id="pageholder" <?php if( get_theme_mod( 'classic_digital_marketing_box_layout' ) ) { echo 'class="boxlayout"'; } ?>>
  <div class="mainhead <?php echo esc_attr(classic_digital_marketing_sticky_menu()); ?>">
    <div class="container">
      <div class="row headerbox">
        <div class="col-lg-3 col-md-5 p-0">
          <div class="logo">
            <?php if (get_theme_mod('classic_digital_marketing_logo_enable', true)) { ?>
              <?php classic_digital_marketing_the_custom_logo(); ?>
            <?php } ?>
          <div class="site-branding-text">
            <?php if ( get_theme_mod('classic_digital_marketing_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_digital_marketing_description = get_bloginfo( 'description', 'display' );
            if ( $classic_digital_marketing_description || is_customize_preview() ) : ?>
              <?php if ( get_theme_mod('classic_digital_marketing_tagline_enable',false) != "") { ?>
              <span class="site-description"><?php echo esc_html( $classic_digital_marketing_description ); ?></span>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        </div>
        <div class="col-lg-9 col-md-7 p-0">
          <div class="menu-wrapper">
            <div class="toggle-nav mobile-stick text-center">
                <button role="tab"><?php esc_html_e('Menu','classic-digital-marketing'); ?></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-digital-marketing' ); ?>">
                <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-digital-marketing'); ?></a>
              </nav>
            </div>
            <div class="gap-3 social-icon text-center p-3">
              <?php if ( get_theme_mod('classic_digital_marketing_fb_link') != "") { ?>
                <a title="<?php echo esc_attr('Facebook', 'classic-digital-marketing'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_digital_marketing_fb_link')); ?>" class="text-decoration-none fs-5">
                  <i class="fab fa-facebook" aria-hidden="true"></i>
                </a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_digital_marketing_insta_link') != "") { ?>
                <a title="<?php echo esc_attr('Instagram', 'classic-digital-marketing'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_digital_marketing_insta_link')); ?>" class="text-decoration-none fs-5">
                  <i class="fab fa-instagram" aria-hidden="true"></i>
                </a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_digital_marketing_whatsapp_link') != "") { ?>
                <a title="<?php echo esc_attr('Whatsapp', 'classic-digital-marketing'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_digital_marketing_whatsapp_link')); ?>" class="text-decoration-none fs-5">
                  <i class="fab fa-whatsapp" aria-hidden="true"></i>
                </a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_digital_marketing_linkedin_link') != "") { ?>
                <a title="<?php echo esc_attr('LinkedIn', 'classic-digital-marketing'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_digital_marketing_linkedin_link')); ?>" class="text-decoration-none fs-5">
                  <i class="fab fa-linkedin" aria-hidden="true"></i>
                </a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_digital_marketing_youtube_link') != "") { ?>
                <a title="<?php echo esc_attr('Youtube', 'classic-digital-marketing'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_digital_marketing_youtube_link')); ?>" class="text-decoration-none fs-5">
                  <i class="fab fa-youtube" aria-hidden="true"></i>
                </a>
              <?php } ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>