<?php
/**
 * The header for our theme
 *
 * @package Senior Care Charity
 */

?>
<!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', 'senior-care-charity' ); ?></a>
	<?php
		$senior_care_charity_preloader_wrap = absint(get_theme_mod('senior_care_charity_enable_preloader', 0));
		if($senior_care_charity_preloader_wrap == 1){ ?>
			<div id="loader">
				<div class="loader-container">
					<div id="preloader" class="loader-2">
						<div class="dot"></div>
					</div>
				</div>
			</div>
	<?php } ?>

	<header id="masthead" class="site-header">

		<?php 
		$senior_care_charity_top_header = absint(get_theme_mod('senior_care_charity_enable_top_header', 1));

		$senior_care_charity_has_header_image = has_header_image();

		if($senior_care_charity_top_header == 1){ 
			?>
			<div class="top-header-wrap">
				<div class="container">
					<div class="flex-row">
						<div class="top-header-left">
							<?php if ( get_theme_mod('senior_care_charity_location_text_option','Orlando, FL 32830, United States') ) : ?><span><i class="<?php echo esc_attr(get_theme_mod('senior_care_charity_location_text_option_icon','fas fa-map-marker-alt')); ?>"></i><?php echo esc_html(get_theme_mod('senior_care_charity_location_text_option','Orlando, FL 32830, United States')); ?></span><?php endif; ?>
							<?php 
							$senior_care_charity_phone = get_theme_mod('senior_care_charity_phone_text_option', '+00-123-4356-7890');
							$senior_care_charity_phone_icon = get_theme_mod('senior_care_charity_phone_text_option_icon', 'fas fa-phone');
							$senior_care_charity_email = get_theme_mod('senior_care_charity_email_text_option', 'senior-charity@example.com');
							$senior_care_charity_email_icon = get_theme_mod('senior_care_charity_email_text_option_icon', 'fas fa-envelope');

							if ( !empty($phone) ) : ?>
							    <a href="tel:<?php echo esc_attr($senior_care_charity_phone); ?>">
							        <i class="<?php echo esc_attr($senior_care_charity_phone_icon); ?>"></i>
							        <?php echo esc_html($senior_care_charity_phone); ?>
							    </a>
							<?php endif; ?>

							<?php if ( !empty($senior_care_charity_email) ) : ?>
							    <a href="mailto:<?php echo esc_attr($senior_care_charity_email); ?>">
							        <i class="<?php echo esc_attr($senior_care_charity_email_icon); ?>"></i>
							        <?php echo esc_html($senior_care_charity_email); ?>
							    </a>
							<?php endif; ?>
						</div>
						<div class="top-header-right">
							<?php if ( get_theme_mod('senior_care_charity_facebook_link_option','#') ) : ?><a href="<?php echo esc_url(get_theme_mod('senior_care_charity_facebook_link_option','#')); ?>"><i class="fab fa-facebook-f"></i></a><?php endif; ?>
							<?php if ( get_theme_mod('senior_care_charity_twitter_link_option','#') ) : ?><a href="<?php echo esc_url(get_theme_mod('senior_care_charity_twitter_link_option','#')); ?>"><i class="fab fa-twitter"></i></span><?php endif; ?>
							<?php if ( get_theme_mod('senior_care_charity_youtube_link_option','#') ) : ?><a href="<?php echo esc_url(get_theme_mod('senior_care_charity_youtube_link_option','#')); ?>"><i class="fab fa-youtube"></i></a><?php endif; ?>
							<?php if ( get_theme_mod('senior_care_charity_instagram_link_option','#') ) : ?><a href="<?php echo esc_url(get_theme_mod('senior_care_charity_instagram_link_option','#')); ?>"><i class="fab fa-instagram"></i></a><?php endif; ?>
							<?php if ( get_theme_mod('senior_care_charity_pintrest_link_option','#') ) : ?><a href="<?php echo esc_url(get_theme_mod('senior_care_charity_pintrest_link_option','#')); ?>"><i class="fab fa-pinterest-p"></i></a><?php endif; ?>
						</div>
					</div>
				</div>
			</div>
		<?php } ?>

		<div class="main-header-wrap">
			<div class="top-box <?php echo esc_attr( get_theme_mod( 'senior_care_charity_enable_sticky_header', false ) ? 'sticky-header' : '' ); ?>" <?php if (!empty($senior_care_charity_has_header_image)) { ?> style="background-image: url(<?php echo header_image(); ?>);" <?php } ?>>
				<div class="header-wrap">
					<div class="container">
						<div class="flex-row">
							<div class="main-header main-header-box">
								<div class="site-branding">
									<?php
									the_custom_logo();
									if ( is_front_page() && is_home() ) :
										?>
										<?php if( get_theme_mod('senior_care_charity_site_title_text',true)){ ?>
											<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
										<?php } ?>
										<?php
									else :
										?>
										<?php if( get_theme_mod('senior_care_charity_site_title_text',true)){ ?>
											<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
										<?php } ?>
										<?php
									endif;
									$senior_care_charity_description = get_bloginfo( 'description', 'display' );
									if ( $senior_care_charity_description || is_customize_preview() ) :
										?>
										<?php if( get_theme_mod('senior_care_charity_site_tagline_text',false)){ ?>
											<p class="site-description"><?php echo $senior_care_charity_description; ?></p>
										<?php } ?>
									<?php endif; ?>
								</div>
							</div>
							<div class="nav-box-header-left">
								<div class="section-nav main-header-box">
									<nav id="site-navigation" class="main-navigation">
										<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><i class="fas fa-bars"></i></button>
										<?php
											wp_nav_menu(
												array(
													'theme_location' => 'menu-1',
													'menu_id'        => 'primary-menu',
												)
											);
										?>
									</nav>
								</div>
							</div>
							<div class="nav-box-header-right">
								<?php if ( get_theme_mod('senior_care_charity_donate_link_option','#') ) : ?><a href="<?php echo esc_url( get_theme_mod('senior_care_charity_donate_link_option','#','') ); ?>"><?php esc_html_e('Donate Now','senior-care-charity'); ?></a><?php endif; ?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</header>