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

?>
<!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="#primary">
		<?php esc_html_e( 'Skip to content', 'dulcie' ); ?>
	</a>
	<?php $preloader = absint(get_theme_mod( 'dulcie-preloader', 0 )); 

	if($preloader == 1 ) { ?>
	<!-- Preload -->
	<div id="preload">
		<div class="ts-bounce">
			<div></div>
			<div></div>
		</div>
	</div>
	<!-- Preload -->
	<?php } ?>
	<!-- Mobile Menu -->
	<div class="container">
		<div class="block-mobile">
			<!-- Logo -->
			<div class="logo">
				<?php the_custom_logo(); ?>
				<span class="site-title">
					<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
				</span>
			</div>
			<!-- End Logo -->
			<!-- Mobile -->
			<div class="menu-mobile">
				<button type="button" aria-expanded="false" aria-controls="dulcie-header-panel">
					<span class="item item-1"></span>
					<span class="item item-2"></span>
					<span class="item item-3"></span>
					<span class="screen-reader-text"><?php esc_html_e( 'Menu', 'dulcie' ); ?></span>
				</button>
			</div>
			<!-- End Mobile -->
		</div>
	</div>

	<div class="hide-menu"></div>
	<!-- End Mobile Menu -->

	<div id="dulcie-header-panel" class="header affix">
		<!-- Logo -->
		<div class="logo">
			<?php
			the_custom_logo();
			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 :
				?>
				<h2 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h2>
				<?php
			endif;
			$dulcie_description = get_bloginfo( 'description', 'display' );
			if ( $dulcie_description || is_customize_preview() ) :
				?>
				<p class="site-description"><?php echo $dulcie_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
			<?php endif; ?>
		</div>
		<!-- End Logo -->
		<!-- Navigation -->
		<div class="main-menu">
			<nav class="custom-nav">
				<?php
					if (has_nav_menu('menu-1')) {
	                    wp_nav_menu( array(
							'theme_location' => 'menu-1',
							'menu_id'        => 'primary-menu',
							'container' => 'ul',
							'menu_class'      => 'menu-list'
						));
	                }
                ?>
            </nav>
        </div>
        <div class="bottom-header">
			<!-- End Navigation -->
			<div class="mx-4 mb-2 d-flex justify-content-between align-items-center">
				<!-- Socials -->
				<div class="socials">
					<?php
					if (has_nav_menu('social')) {
						wp_nav_menu( array(
							'theme_location' => 'social',
							'menu_id'        => 'social-menu',
							'menu_class'     => 'dulcie-social-menu',
						) );
					}
					?>
				</div>
				<?php
					$dulcie_search = absint(get_theme_mod( 'dulcie-search-icon', 1 ));
					?>
				<?php if($dulcie_search == 1) { ?>
					<div class="search-box mr-2">
					  <?php get_search_form();?>
					</div>
				<?php } ?>
			</div>
			<!-- End Socials -->

			<div class="copy-right-box">
				<p>	
					<?php
					$dulcie_copyright_text = get_theme_mod( 'dulcie-copyright-text', __( 'Dulcie @ 2021', 'dulcie' ) );
					?>
					<span class="copyright">
						<?php echo esc_html($dulcie_copyright_text); ?>
					</span>
					<?php
					/* translators: 1: Theme name, 2: Theme author. */
					printf( esc_html__( 'By %1$s : %2$s.', 'dulcie' ), '', '<a href="https://www.templatesell.com/">Template Sell</a>' );
					?>
				</p>
			</div>
			<div class="close-block text-center">
				<button type="button" class="btn-close">
					<span class="screen-reader-text"><?php esc_html_e( 'Close menu', 'dulcie' ); ?></span>
				</button>
			</div>
		</div>
	</div>
	<div class="page-wrapper">
		<?php if (is_home() ) {?>
			<section>
	            <div class="container">
	                <div class="row">
	                    <div class="col-lg-12">
	                        <div class="page-title">
	                            <div class="row">
	                                <div class="col-md-8 col-xs-12">
	                                	<?php
											$header_title_text = get_theme_mod( 'header-title-text', __( 'News and Stories', 'dulcie' ) );
											$header_description_text = get_theme_mod( 'header-description-text', __( 'Enter your header description text here.', 'dulcie' ) );
										?>
	                                    <h2><span><?php echo esc_html($header_title_text); ?></span></h2>
	                                    <p class="subtitle text-muted"><?php echo esc_html($header_description_text); ?></p>
	                                </div>
	                            </div>
	                        </div>
	                    </div>
	                </div>
	            </div>
	        </section>
        <?php
        }else {
			empty('');
		} 
			