<?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 ethrik
 */
 
$ethrik_preloader = ethrik_get_option('preloader_enable', false);

$title_typo_enable = ethrik_get_customize_option('title_typo_enable', false);
 
?>
<!DOCTYPE html>
  <html <?php language_attributes(); ?>> 
    <head>
        <meta charset="<?php bloginfo('charset'); ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<?php wp_head(); ?>
    </head>
	
	
    <body <?php body_class(); ?> >
		
		<?php wp_body_open(); ?>

		<!-- Theme Preloader -->
		<?php if($ethrik_preloader == true) :?>
		<?php require ETHRIK_THEME_DIR . '/template-parts/theme-preloader.php'; ?>
		<?php endif; ?>


		<div class="body-inner-content <?php if($title_typo_enable == true ) { echo "enable-lib-font"; } else { echo "enable-custom-font"; } ?>">
      
		<?php
		
		// Select Header Style
		
		$ethrik_nav_global = ethrik_get_option( 'nav_menu' ); // Global
		$ethrik_nav_style =  get_post_meta( get_the_ID(), 'ethrik_post_meta', true ); // Post Metabox

		if( is_page() && !empty( $ethrik_nav_style  ) ) {
		 
			get_template_part( 'template-parts/headers/'.$ethrik_nav_style['nav_menu'].'' ); 
		
		} elseif ( class_exists( 'CSF' ) && !empty( $ethrik_nav_global ) ) {
			
			get_template_part( 'template-parts/headers/'.$ethrik_nav_global.'' ); 
			
		} else {
			
			get_template_part( 'template-parts/headers/nav-style-one' ); 
			
		}
	
		?>
		