<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package educrap
 */

?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">

	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
	<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'educrap' ); ?></a>

	 <!-- header area start -->
      <header>
         <div id="header-sticky" class="header__area header__transparent header__padding" style="position:relative;">
            <?php if ( get_header_image() ) : ?>
                <div class="custom-header-bg" style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;overflow:hidden;">
                    <img src="<?php echo esc_url( get_header_image() ); ?>" alt="<?php bloginfo('name'); ?>" style="width:100%;height:100%;object-fit:cover;opacity:0.7;" />
                </div>
            <?php endif; ?>
            <div class="container-fluid" style="position:relative;z-index:1;">
               <div class="row align-items-center">
                  <div class="col-xxl-3 col-xl-3 col-lg-4 col-md-2 col-sm-4 col-6">
                     <div class="header__left d-flex">
                        <div class="logo">
                           <?php
                           $custom_logo_id = get_theme_mod( 'custom_logo' );
                           $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
                           if ( has_custom_logo() ) { ?>
                              <a class="navbar-brand" href="<?php echo esc_url( home_url() ); ?>">
                                 <img src="<?php echo esc_url( $logo[0] ); ?>" alt="logo">
                              </a>
                           <?php 
                           } 
                           if (display_header_text()==true){ ?>
                              <a class="navbar-brand" href="<?php echo esc_url( home_url() ); ?>">
                                 <span class="site-title"><?php bloginfo('name'); ?></span>
                              </a>
                              <p><span class="site-description"><?php  bloginfo('description'); ?></span></p>
                           <?php  } ?>
                        </div>
                     </div>
                  </div>
                  <div class="col-xxl-9 col-xl-9 col-lg-8 col-md-10 col-sm-8 col-6">
                     <div class="header__right d-flex justify-content-end align-items-center">
                        <div class="main-menu">
                           <nav id="mobile-menu">
                              
                              <?php
                              wp_nav_menu( 
                                 array(
                                    'theme_location' => 'primary',
                                    'container'      => '',
                                    'menu_class'     => 'navi-bar',
                                    'menu_id'        => 'primary-menu',
                                 ) 
                              );
                              ?>
                           </nav>
                        </div>
                        
                        <?php $custom_logo_id = get_theme_mod( 'custom_logo' ); 
                        $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
                        if ( has_custom_logo() ) { 
                        ?>
                            <div class="mobile-menu" data-type="logo" data-link="<?php echo esc_attr( home_url('/') ); ?>" data-logo="<?php echo esc_attr( $logo[0] ); ?>"> </div>
                        <?php } else{ ?>
                            <div class="mobile-menu" data-type="text" data-link="<?php echo esc_attr( home_url('/') ); ?>" data-logo="<?php bloginfo( 'name' ); ?>"> </div>
                        <?php } ?>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </header>
      <?php if(!(is_404() || is_page_template( 'educrap-home.php' ) || is_home() || is_front_page())){ ?>
         <main class="main-div home-slider">
            <div class="blog-bg ">
               <div class="hero-slider-content blog_bg">
                  <div class="container">
                     <div class="row">
                        <div class="blog_now p-relative z-index-1">
                           <?php if (is_home() || is_front_page()) { ?>
                              <h3 class="hero__title"><?php echo esc_html__('blog', 'educrap') ?></h3>
                           <?php } elseif(is_search()){?>
                              <h3 class="hero__title"><?php   
                              /* translators: %s: search term */             
                              printf( esc_html__( 'Search Results for: %s', 'educrap' ), '<span>' . get_search_query() . '</span>' ); ?>
                              </h3>
                           <?php }else if(is_archive()){ ?>
                              <h3 class="hero__title"><?php the_archive_title(); ?></h3>
                           <?php }else{  ?>                      
                              <h3 class="hero__title"><?php the_title(); ?></h3>
                           <?php } ?>
                        </div>
                     </div>
                  </div>
               </div>
            </div>   
         </main>
      <?php } ?>
      <div id="content" class="site-content">