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

?>
<!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 do_action( 'wp_body_open' ); ?>

<div id="page" class="site">
	<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'business-office' ); ?></a>

	<?php if( is_front_page() || !is_paged() ) {
		get_template_part( 'apex-library/header', 'image' );
	} ?>

	<header id="masthead" class="site-header">
		<section id="top-header">
			<div class="container">
				<div class="row header-bg">
					<div class="col-xxl-3 col-xl-3 col-lg-3 col-md-4 col-12 align-self-center">
						<div class="site-branding text-center text-md-start">
							<?php if ( has_custom_logo() ) : ?>
								<div class="site-branding-logo">
									<?php the_custom_logo(); ?>
								</div>
							<?php endif; ?>

							<div class="site-branding-text">
								<?php if ( is_front_page() ) : ?>
									<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; ?>

								<?php
								$business_office_description = get_bloginfo( 'description', 'display' );

								if ( $business_office_description || is_customize_preview() ) :
									?>
									<p class="site-description"><?php echo esc_html( $business_office_description ); ?></p>
								<?php endif; ?>
							</div>
						</div>
					</div>
					<div class="col-xxl-7 col-xl-7 col-lg-6 col-md-4 col-12 align-self-center text-md-start">
						<?php get_template_part('apex-library/template-parts/navigation'); ?>
					</div>
					<div class="col-xxl-2 col-xl-2 col-lg-3 col-md-4 col-12 align-self-center header-button text-md-end text-center">
						<?php if ( get_theme_mod( 'business_office_header_btn_text' ) && get_theme_mod( 'business_office_header_btn_url' ) ) : ?>
							<a href="<?php echo esc_url(get_theme_mod('business_office_header_btn_url')); ?>" class="view-all-btn">
								<?php echo esc_html(get_theme_mod('business_office_header_btn_text')); ?>
							</a>
						<?php endif; ?>
					</div>
				</div>
			</div>
		</section>
	</header>

	<div id="content" class="site-content">
