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

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

<div class="mainhead">
  <div class="main-header">
    <div class="container">
      <div class="row">
        <?php if (get_theme_mod('educational_university_topbar_text_title') != "") { ?>
          <div class="col-xxl-6 col-xl-6 col-lg-7 col-md-9 col-12 p-0">
            <div class="top-header px-4 py-2 d-flex align-items-center">
                <i class="<?php echo esc_attr(get_theme_mod('educational_university_top_text_icon', 'fa-solid fa-volume-high')); ?>"></i><p class="top-text ms-2 mb-0"><?php echo esc_html(get_theme_mod('educational_university_topbar_text_title')); ?></p>
            </div>
          </div>
        <?php } ?>
        <div class="col-xxl-6 col-xl-6 col-lg-5 col-md-3 col-12"></div>
      </div>
    </div>
  <div class="<?php if( get_theme_mod( 'educational_university_sticky_header', false) == 1 ) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
    <div class="container">
      <div class="header-sec">
        <div class="row">
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-12 col-12 align-self-center">
            <div class="educational-university-logo">
              <?php if (get_theme_mod('educational_university_logo_enable', true)) { ?>
                <?php educational_university_the_custom_logo(); ?>
              <?php } ?>
              <div class="site-branding-text">
                <?php if (get_theme_mod('educational_university_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 $educational_university_description = get_bloginfo('description', 'display');
                if ($educational_university_description || is_customize_preview()) : ?>
                  <?php if (get_theme_mod('educational_university_tagline_enable', false)) { ?>
                    <span class="site-description"><?php echo esc_html($educational_university_description); ?></span>
                  <?php } ?>
                <?php endif; ?>
              </div>
            </div>
          </div>
          <div class="col-xxl-8 col-xl-7 col-lg-7 col-md-4 col-sm-5 col-5 align-self-center">
            <div class="toggle-nav text-center">
              <?php if (has_nav_menu('primary')) { ?>
                <button role="tab"><?php esc_html_e('Menu', 'educational-university'); ?></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', 'educational-university'); ?>">
                <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', 'educational-university'); ?></a>
              </nav>
            </div>
          </div>
          <div class="col-xxl-2 col-xl-3 col-lg-3 col-md-5 col-sm-7 col-7 align-items-center d-flex justify-content-end topbar-btn">
            <div class="top-search">
              <div class="main-search d-inline-block">
                <span class="search-box text-center me-3">
                  <button type="button" class="search-open"><i class="fas fa-search"></i></button>
                </span>
              </div>
              <div class="search-outer">
                <div class="serach_inner w-100 h-100">
                  <?php get_search_form(); ?>
                </div>
                <button type="button" class="search-close"><span>X</span></button>
              </div>
            </div>
            <div class="header-btn">
              <?php if ( get_theme_mod('educational_university_header_btn_text') || get_theme_mod('educational_university_header_btn_url')) { ?> 
                <a href="<?php echo esc_url(get_theme_mod ('educational_university_header_btn_url','')); ?>" class="text-capitalize"><?php echo esc_html(get_theme_mod ('educational_university_header_btn_text','educational-university')); ?></a>
              <?php }?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
    <?php if (get_theme_mod('educational_university_enable_topbar_section', true)) { ?>
      <div class="topbar">
        <div class="container">
          <div class="row">
            <div class="col-xxl-6 col-xl-6 col-lg-5 col-md-3 col-12"></div>
            <div class="col-xxl-6 col-xl-6 col-lg-7 col-md-9 col-12 p-0">
              <div class="top-content py-2 px-4">
                <div class="row m-0">
                  <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12 d-flex email justify-content-center align-items-center">
                    <?php if ( get_theme_mod('educational_university_email_address')) { ?>
                      <i class="fa-solid fa-envelope me-2"></i><a class="mail" href="mailto:<?php echo esc_attr( get_theme_mod('educational_university_email_address','') ); ?>"><?php echo esc_html(get_theme_mod ('educational_university_email_address','')); ?></a>
                    <?php } ?>
                  </div>
                  <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12 d-flex phone justify-content-center align-items-center">
                    <?php if ( get_theme_mod('educational_university_phone_number')) { ?>
                      <i class="fas fa-phone me-2"></i><a class="phone-no" href="tel:<?php echo esc_attr( get_theme_mod('educational_university_phone_number','' )); ?>"><?php echo esc_html(get_theme_mod ('educational_university_phone_number','')); ?></a>
                    <?php } ?>
                  </div>
                  <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12 align-self-center social-top-icons">
                    <div class="social-icons d-flex gap-4 justify-content-end">
                      <?php if ( get_theme_mod('educational_university_fb_link') != "") { ?>
                        <a title="<?php echo esc_attr('facebook', 'educational-university'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('educational_university_fb_link')); ?>"><i class="fa-brands fa-facebook"></i></a> 
                      <?php } ?>
                      <?php if ( get_theme_mod('educational_university_instagram_link') != "") { ?>
                        <a title="<?php echo esc_attr('instagram', 'educational-university'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('educational_university_instagram_link')); ?>"><i class="fa-brands fa-instagram"></i></a>
                      <?php } ?>
                      <?php if ( get_theme_mod('educational_university_twitter_link') != "") { ?> 
                        <a title="<?php echo esc_attr('twitter', 'educational-university'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('educational_university_twitter_link')); ?>"><i class="fa-brands fa-twitter"></i></a>  
                      <?php } ?>
                      <?php if ( get_theme_mod('educational_university_youtube_link') != "") { ?> 
                        <a title="<?php echo esc_attr('youtube', 'educational-university'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('educational_university_youtube_link')); ?>"><i class="fa-brands fa-youtube"></i></a>
                      <?php } ?>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    <?php } ?>
  </div>
</div>