<?php
/**
 * The Header for our theme.
 * @package Campus Education
 */
?>
<!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('campus_education_preloader',false) || get_theme_mod('campus_education_preloader_responsive',false)){ ?>
    <?php if(get_theme_mod( 'campus_education_preloader_type','Square') == 'Square'){ ?>
      <div id="overlayer"></div>
      <span class="tg-loader">
        <span class="tg-loader-inner"></span>
      </span>
    <?php }else if(get_theme_mod( 'campus_education_preloader_type') == 'Circle') {?>    
      <div class="preloader text-center">
        <div class="preloader-container">
          <span class="animated-preloader"></span>
        </div>
      </div>
    <?php }?>
  <?php }?>
  <header role="banner">
    <a class="screen-reader-text skip-link" href="#maincontent"><?php esc_html_e( 'Skip to content', 'campus-education' ); ?><span class="screen-reader-text"><?php esc_html_e('Skip to Content','campus-education'); ?></span></a>
    <div class="top-bar text-md-start text-center">
      <div class="container">
        <?php if(get_theme_mod('campus_education_top_header',false) == true || get_theme_mod('campus_education_hide_topbar_responsive',true) == true){ ?>
          <div class="top-header">
            <div class="row">
              <div class="col-lg-3 col-md-6 align-self-center">
                <div class="contact-details p-3">
                  <div class="row">
                    <?php if ( get_theme_mod('campus_education_call_text','') != "" ) {?>
                      <div class="col-lg-2 col-md-2 p-0 conatct-font align-self-center">
                        <i class="<?php echo esc_html(get_theme_mod('campus_education_phone_icon','fas fa-phone'));?> p-2 mb-md-0 mb-2"></i>
                      </div>
                      <div class="col-lg-10 col-md-10 p-0">
                        <?php if ( get_theme_mod('campus_education_call_text','') != "" ) {?>
                          <p class="bold-font px-2"><?php echo esc_html( get_theme_mod('campus_education_call_text','' )); ?></p>
                        <?php }?>
                        <?php if ( get_theme_mod('campus_education_call_number','') != "" ) {?>
                          <p class="px-2 mb-0"><a href="tel:<?php echo esc_attr(get_theme_mod('campus_education_call_number','')); ?>"><?php echo esc_html( get_theme_mod('campus_education_call_number','' )); ?><span class="screen-reader-text"><?php esc_html_e('Phone Number', 'campus-education') ?></span></a></p>
                        <?php }?>
                      </div>
                    <?php }?>
                  </div>
                </div>
              </div>          
              <div class="col-lg-3 col-md-6 p-0 align-self-center">
                <div class="contact-details p-3">
                  <div class="row">
                    <?php if ( get_theme_mod('campus_education_email_text','') != "" ) {?>
                      <div class="col-lg-2 col-md-2 p-0 conatct-font align-self-center">
                        <i class="<?php echo esc_html(get_theme_mod('campus_education_email_icon','fas fa-envelope'));?> p-2 mb-md-0 mb-2"></i>
                      </div>
                      <div class="col-lg-10 col-md-10 p-0">
                        <?php if ( get_theme_mod('campus_education_email_text','') != "" ) {?>
                          <p class="bold-font px-2"><?php echo esc_html( get_theme_mod('campus_education_email_text','') ); ?></p>
                        <?php }?>
                        <?php if ( get_theme_mod('campus_education_email','') != "" ) {?>
                          <p class="px-2 mb-0"><a href="mailto:<?php echo esc_attr(get_theme_mod('campus_education_email','')); ?>"><?php echo esc_html( get_theme_mod('campus_education_email','') ); ?><span class="screen-reader-text"><?php esc_html_e('Email', 'campus-education') ?></span></a></p>
                        <?php }?>
                      </div>
                    <?php }?>
                  </div>
                </div>
              </div>
              <div class="col-lg-4 col-md-8 align-self-center">
                <?php if( get_theme_mod( 'campus_education_show_icons', true) != '') { ?>
                <div class="social-media py-3 text-lg-end text-center">
                  <?php if( get_theme_mod( 'campus_education_facebook' ) != '') { ?>
                    <span class="diamond mx-xl-2 mx-lg-1 mx-md-2 mx-1"><a target="_blank" href="<?php echo esc_url( get_theme_mod( 'campus_education_facebook','' ) ); ?>"><i class="<?php echo esc_html(get_theme_mod('campus_education_facebook_icon','fab fa-facebook-f')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Facebook','campus-education'); ?></span></a></span>
                  <?php } ?>
                  <?php if( get_theme_mod( 'campus_education_twitter' ) != '') { ?>
                    <span class="diamond mx-xl-2 mx-lg-1 mx-md-2 mx-1"><a target="_blank" href="<?php echo esc_url( get_theme_mod( 'campus_education_twitter','' ) ); ?>"><i class="<?php echo esc_html(get_theme_mod('campus_education_twitter_icon','fab fa-twitter')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Twitter','campus-education'); ?></span></a></span>
                  <?php } ?>
                  <?php if( get_theme_mod( 'campus_education_pintrest' ) != '') { ?>
                    <span class="diamond mx-xl-2 mx-lg-1 mx-md-2 mx-1"><a target="_blank" href="<?php echo esc_url( get_theme_mod( 'campus_education_pintrest','' ) ); ?>"><i class="<?php echo esc_html(get_theme_mod('campus_education_pintrest_icon','fab fa-pinterest-p')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Pinterest','campus-education'); ?></span></a></span>
                  <?php } ?>
                  <?php if( get_theme_mod( 'campus_education_insta' ) != '') { ?>
                    <span class="diamond mx-xl-2 mx-lg-1 mx-md-2 mx-1"><a target="_blank" href="<?php echo esc_url( get_theme_mod( 'campus_education_insta','' ) ); ?>"><i class="<?php echo esc_html(get_theme_mod('campus_education_insta_icon','fab fab fa-instagram')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Instagram','campus-education'); ?></span></a></span>
                  <?php } ?>
                  <?php if( get_theme_mod( 'campus_education_linkdin' ) != '') { ?>
                    <span class="diamond mx-xl-2 mx-lg-1 mx-md-2 mx-1"><a target="_blank" href="<?php echo esc_url( get_theme_mod( 'campus_education_linkdin','' ) ); ?>"><i class="<?php echo esc_html(get_theme_mod('campus_education_linkdin_icon','fab fa-linkedin-in')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Linkedin','campus-education'); ?></span></a></span>
                  <?php } ?>
                  <?php if( get_theme_mod( 'campus_education_youtube' ) != '') { ?>
                    <span class="diamond mx-xl-2 mx-lg-1 mx-md-2 mx-1"><a target="_blank" href="<?php echo esc_url( get_theme_mod( 'campus_education_youtube','' ) ); ?>"><i class="<?php echo esc_html(get_theme_mod('campus_education_youtube_icon','fab fa-youtube')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Youtube','campus-education'); ?></span></a></span>
                  <?php } ?>
                </div>
                <?php }?>
              </div>
              <?php if ( get_theme_mod('campus_education_button_text','') != "" ) {?>
                <div class="col-lg-2 col-md-4 align-self-center"> 
                  <div class="donate-link py-1 text-center">            
                    <a href="<?php echo esc_html( get_theme_mod('campus_education_button_link','') ); ?>"><?php echo esc_html( get_theme_mod('campus_education_button_text','') ); ?><span class="screen-reader-text"><?php esc_html_e('Apply Online','campus-education'); ?></span></a>    
                  </div>          
                </div>
              <?php }?>
            </div>
          </div>
        <?php }?>
      </div>  
      <?php ?> 
        <div class="toggle-menu responsive-menu p-2 text-start">
          <button role="tab"><i class="<?php echo esc_html(get_theme_mod('campus_education_menu_open_icon','fas fa-bars')); ?> me-2"></i><?php echo esc_html( get_theme_mod('campus_education_mobile_menu_label', __('Menu','campus-education'))); ?><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('campus_education_mobile_menu_label', __('Menu','campus-education'))); ?></span></button>
        </div> 
      <?php ?>
      <div id="header" class="<?php if( get_theme_mod( 'campus_education_sticky_header') != '') { ?> sticky-header"<?php } else { ?>close-sticky <?php } ?>">
        <div class="container">
          <div class="menu-sec">
            <div class="row">
              <div class="col-lg-3 col-md-5 align-self-center">
                <div class="campus-education-logo p-2">
                  <?php if ( has_custom_logo() ) : ?>
                    <div class="site-logo"><?php the_custom_logo(); ?></div>
                  <?php endif; ?>
                    <?php $blog_info = get_bloginfo( 'name' ); ?>
                    <?php if ( ! empty( $blog_info ) ) : ?>
                      <?php if( get_theme_mod('campus_education_show_site_title',true) != ''){ ?>
                        <?php if ( is_front_page() && is_home() ) : ?>
                          <h1 class="site-title p-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                        <?php else : ?>
                          <p class="site-title m-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                        <?php endif; ?>
                    <?php }?>
                  <?php endif; ?>
                  <?php if( get_theme_mod('campus_education_show_tagline',false) != ''){ ?>
                    <?php
                    $description = get_bloginfo( 'description', 'display' );
                    if ( $description || is_customize_preview() ) :
                    ?>
                      <p class="site-description m-0">
                        <?php echo esc_html($description); ?>
                      </p>
                    <?php endif; ?>
                  <?php }?>
                </div>
              </div>
              <div class="menubox align-self-center <?php if(get_theme_mod('campus_education_show_search',true)) { ?>col-lg-8 col-md-5 p-0" <?php } else { ?>col-lg-9 col-md-7 p-0 <?php } ?>">
                <div id="sidelong-menu" class="nav side-nav">
                  <nav id="primary-site-navigation" class="nav-menu" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'campus-education' ); ?>">
                    <?php 
                      wp_nav_menu( array( 
                        'theme_location' => 'primary',
                        'container_class' => 'main-menu-navigation clearfix' ,
                        'menu_class' => 'clearfix',
                        'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav">%3$s</ul>',
                        'fallback_cb' => 'wp_page_menu',
                      ) ); 
                     ?>
                    <a href="javascript:void(0)" class="closebtn responsive-menu p-2"><?php echo esc_html( get_theme_mod('campus_education_close_menu_label', __('Close Menu','campus-education'))); ?><i class="<?php echo esc_html(get_theme_mod('campus_education_menu_close_icon','fas fa-times-circle')); ?> m-3"></i><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('campus_education_close_menu_label', __('Close Menu','campus-education'))); ?></span></a>
                  </nav>
                </div>
              </div>
              <?php if(get_theme_mod('campus_education_show_search',true) ){ ?>
                <div class="search-box col-lg-1 col-md-2 align-self-center">
                  <span class="diamond1 my-3 mx-xl-2 mx-lg-1 mx-md-2 mx-auto"><div class="wrap"><?php get_search_form(); ?></div></span>
                </div>
              <?php }?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>

  <?php if(get_theme_mod('campus_education_post_featured_image') == 'banner' ){
    if( is_singular() ) {?>
      <div id="page-site-header">
        <div class='page-header'> 
          <?php the_title( '<h1>', '</h1>' ); ?>
        </div>
      </div>
    <?php }
  }?>