<?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 BlogZ
 */

?>
<!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', 'blogz' ); ?></a>
	<?php get_template_part( 'template-parts/topbar' ); ?>
	<header id="masthead" class="site-header">
		<div class="container">
			<div class="site-branding">
				<?php
				the_custom_logo();
				$blog_info = get_bloginfo( 'name' );
				if ( ! empty( $blog_info ) ) {
					if ( is_front_page() && is_home() ) :
						?>
						<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
						<?php
					else :
						?>
						<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
					<?php endif;
				}
				?>
			</div><!-- .site-branding -->

			<nav id="site-navigation" class="main-navigation">
				<?php
				wp_nav_menu(
					array(
						'theme_location' => 'menu-1',
						'menu_id'        => 'primary-menu',
						'menu_class'     => 'primary-menu',
						'container'      => 'ul',
					)
				);
				?>
			</nav><!-- #site-navigation -->

			<div class="header-icons">
				<?php
				$searchform = get_theme_mod( 'searchform_style', 'searchform-1' );

				if ( 'searchform-1' === $searchform ) {
					blogz_searchform_modal();
				} elseif ( 'searchform-2' === $searchform ) {
					if ( function_exists( 'blogz_searchform_dropdown' ) ) {
						blogz_searchform_dropdown();
					}
				} else {
					if ( function_exists( 'blogz_searchform_toggle' ) ) {
						blogz_searchform_toggle();
					}
				}
				?>
				<button class="menu-toggle" aria-expanded="false"> <span class="screen-reader-text"><?php esc_html_e( 'Slide Out Sidebar', 'blogz' ); ?></span><i class="icofont-navigation-menu"></i></button>
			</div>
		</div>
	</header><!-- #masthead -->

	<?php get_template_part( 'template-parts/hero' ); ?>
	<?php if ( ! is_home() && is_front_page() ) : ?>
		<div id="content" class="site-content">
	<?php else : ?>
		<div id="content" class="site-content container">
	<?php endif; ?>
