<?php
/**
 * The header for this theme.
 *
 * @package Maskitto Light
 */

global $maskitto_light;

$enable_javascript = 'http://www.enable-javascript.com';
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<?php if( isset( $maskitto_light['responsive-status'] ) && $maskitto_light['responsive-status'] == 1 ) : ?>
		<meta name="viewport" content="width=device-width, initial-scale=1">
	<?php endif; ?>
	<title><?php wp_title( '|', true, 'right' ); ?></title>
	<?php if( isset($maskitto_light['favicon-image']['url']) && $maskitto_light['favicon-image']['url'] ) : ?>
		<link rel="shortcut icon" href="<?php echo esc_url($maskitto_light['favicon-image']['url']); ?>" />
	<?php endif; ?>
	<?php echo maskitto_light_generate_css(); ?>
	<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>

<?php if( $maskitto_light['page-layout'] == 2 ) : ?>
	<div class="boxed-layout">
<?php elseif( $maskitto_light['page-layout'] == 3 ) : ?>
	<div class="full-layout">
<?php endif; ?>

	<header class="top<?php
			if( isset($maskitto_light['header-layout']) && $maskitto_light['header-layout'] == 4 ) :
				echo ' header-inverted-layout';
			elseif( isset($maskitto_light['header-layout']) && $maskitto_light['header-layout'] == 2 ) :
				echo ' header-layout-large';
			elseif( isset($maskitto_light['header-layout']) && $maskitto_light['header-layout'] == 3 ) :
				echo ' header-layout-large header-layout-large-small';
			endif;

			if( isset( $maskitto_light['header-layout'] ) && $maskitto_light['header-layout'] ) :
				echo ' framework-ok';
			endif;
		?>">
		<?php if( ( isset( $maskitto_light['header-contacts'] ) && isset( $maskitto_light['header-social'] ) ) && ( $maskitto_light['header-contacts'] || $maskitto_light['header-social'] ) ) { ?>
		<div class="header-details">
			<div class="container">
				<div class="row">
					<div class="col-md-7 col-sm-7 our-info">
						<?php if(isset($maskitto_light['header-contacts']) && $maskitto_light['header-contacts']){ ?>

							<?php if( isset($maskitto_light['header-contacts-mail']) && $maskitto_light['header-contacts-mail'] ){ ?>
								<a href="mailto:<?php echo $maskitto_light['header-contacts-mail']; ?>"><i class="fa fa-envelope"></i><?php echo $maskitto_light['header-contacts-mail']; ?></a>
							<?php } ?>

							<?php if( isset($maskitto_light['header-contacts-phone']) && $maskitto_light['header-contacts-phone'] ){ ?>
								<span><i class="fa fa-phone"></i><?php echo esc_attr($maskitto_light['header-contacts-phone']); ?></span>
							<?php } ?>

						<?php } ?>
					</div>
					<div class="col-md-5 col-sm-5 text-right soc-icons">
						<?php if(isset($maskitto_light['header-social']) && $maskitto_light['header-social']){ ?>
							<?php echo maskitto_light_social_icons(); ?>
						<?php } ?>
					</div>
				</div>
			</div>
			<?php } ?>
		</div>
		<nav class="primary navbar navbar-default" role="navigation">

			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<i class="fa fa-bars"></i>
					</button>
					<a class="navbar-brand" href="<?php echo get_home_url(); ?>">
						<?php if(isset($maskitto_light['logo-image']) && $maskitto_light['logo-image']['url']) { ?>
							<img src="<?php echo esc_url($maskitto_light['logo-image']['url']); ?>" alt="" />
						<?php } elseif( get_header_image() ) { ?>
							<img src="<?php echo header_image(); ?>" alt="" />
						<?php } ?>
					</a>
				</div>

				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<?php
						/* Primary navigation */
						wp_nav_menu( array(
							'theme_location' => 'primary',
							'menu' => 'Primary navigation',
							'depth' => 2,
							'container' => false,
							'fallback_cb' => 'false',
							'menu_class' => 'nav navbar-nav navbar-right',
							'walker' => new maskitto_light_wp_bootstrap_navwalker())
						);
					?>

					<?php if ( !has_nav_menu( 'primary' ) ) : ?>
						<ul class="nav navbar-nav navbar-right no-menu-assigned">
							<li class="menu-item menu-item-type-post_type menu-item-object-page">
								<?php if( current_user_can( 'manage_options' ) ) : ?>
									<a href="<?php echo admin_url(); ?>/nav-menus.php"><?php _e( 'No menu is assigned', 'maskitto-light' ) ?>, <?php _e( 'please assign it here', 'maskitto-light' ) ?></a>
								<?php else : ?>
									<a href="#"><?php _e( 'No menu is assigned', 'maskitto-light' ) ?></a>
								<?php endif; ?>
							</li>
						</ul>
					<?php endif; ?>

					<ul id="menu-header-menu-1" class="nav navbar-nav navbar-right navbar-secondary">
						<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-102"><a href="#"><?php _e( 'Social links', 'maskitto-light' ); ?></a></li>
						<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-102 menu-social-icons">
						<?php if(isset($maskitto_light['header-social']) && $maskitto_light['header-social']){ ?>
							<?php echo maskitto_light_social_icons(); ?>
						<?php } ?>
						</li>
					</ul>

				</div>
			</div>

		</nav>

	</header>
	<div id="wrapper">

		<noscript>
			<div class="enable-javascript"><?php _e( 'Javascript is disabled in your web browser. Please enable it', 'maskitto-light' ); ?> <a href="<?php echo esc_attr($enable_javascript); ?>" target="_blank" style="color:#fff;"><?php _e( '(see how)', 'maskitto-light' ); ?></a>.</div>
		</noscript>