<?php
/**
 * Template part for displaying the header
 *
 * @package code4rest
 */

namespace Code4rest;

code4rest()->print_styles( 'code4rest-header' );
?>
<header id="masthead" class="site-header" role="banner" <?php code4rest()->print_microdata( 'header' ); ?>>
	<div id="main-header" class="site-header-wrap">
		<div class="site-header-inner-wrap<?php echo esc_attr( 'top_main_bottom' === code4rest()->option( 'header_sticky' ) ? ' code4rest-sticky-header' : '' ); ?>"<?php
		if ( 'top_main_bottom' === code4rest()->option( 'header_sticky' ) ) {
			echo ' data-reveal-scroll-up="' . ( code4rest()->option( 'header_reveal_scroll_up' ) ? 'true' : 'false' ) . '"';
			echo ' data-shrink="' . ( code4rest()->option( 'header_sticky_shrink' ) ? 'true' : 'false' ) . '"';
			if ( code4rest()->option( 'header_sticky_shrink' ) ) {
				echo ' data-shrink-height="' . esc_attr( code4rest()->sub_option( 'header_sticky_main_shrink', 'size' ) ) . '"';
			}
		}
		?>>
			<div class="site-header-upper-wrap">
				<div class="site-header-upper-inner-wrap<?php echo esc_attr( 'top_main' === code4rest()->option( 'header_sticky' ) ? ' code4rest-sticky-header' : '' ); ?>"<?php
				if ( 'top_main' === code4rest()->option( 'header_sticky' ) ) {
					echo ' data-reveal-scroll-up="' . ( code4rest()->option( 'header_reveal_scroll_up' ) ? 'true' : 'false' ) . '"';
					echo ' data-shrink="' . ( code4rest()->option( 'header_sticky_shrink' ) ? 'true' : 'false' ) . '"';
					if ( code4rest()->option( 'header_sticky_shrink' ) ) {
						echo ' data-shrink-height="' . esc_attr( code4rest()->sub_option( 'header_sticky_main_shrink', 'size' ) ) . '"';
					}
				}
				?>>
					<?php
					/**
					 * Code4rest Top Header
					 *
					 * Hooked Code4rest\top_header
					 */
					do_action( 'code4rest_top_header' );
					/**
					 * Code4rest Main Header
					 *
					 * Hooked Code4rest\main_header
					 */
					do_action( 'code4rest_main_header' );
					?>
				</div>
			</div>
			<?php
			/**
			 * Code4rest Bottom Header
			 *
			 * Hooked Code4rest\bottom_header
			 */
			do_action( 'code4rest_bottom_header' );
			?>
		</div>
	</div>
	<?php
	/**
	 * Code4rest Mobile Header
	 *
	 * Hooked Code4rest\mobile_header
	 */
	do_action( 'code4rest_mobile_header' );
	?>
</header><!-- #masthead -->
