<?php
/**
 * The template to display custom header from the ThemeREX Addons Layouts
 *
 * @package TOURIMO
 * @since TOURIMO 1.0.06
 */
 
$tourimo_header_css   = '';
$tourimo_header_image = tourimo_get_theme_option( 'header_image' );
$tourimo_header_image = empty($tourimo_header_image) ? get_header_image() : $tourimo_header_image;
$tourimo_header_video = tourimo_get_header_video();
if ( ! empty( $tourimo_header_image ) && tourimo_trx_addons_featured_image_override( is_singular() || tourimo_storage_isset( 'blog_archive' ) || is_category() ) ) {
	$tourimo_header_image = tourimo_skin_get_current_mode_image( $tourimo_header_image );
} 

$tourimo_header_id = tourimo_get_custom_header_id();
$tourimo_header_meta = get_post_meta( $tourimo_header_id, 'trx_addons_options', true );
if ( ! empty( $tourimo_header_meta['margin'] ) ) {
	tourimo_add_inline_css( sprintf( '.page_content_wrap{padding-top:%s}', esc_attr( tourimo_prepare_css_value( $tourimo_header_meta['margin'] ) ) ) );
}

?><header class="top_panel top_panel_custom top_panel_custom_<?php echo esc_attr( $tourimo_header_id ); ?> top_panel_custom_<?php echo esc_attr( sanitize_title( get_the_title( $tourimo_header_id ) ) ); ?>
				<?php
				echo ! empty( $tourimo_header_image ) || ! empty( $tourimo_header_video )
					? ' with_bg_image'
					: ' without_bg_image';
				if ( '' != $tourimo_header_video ) {
					echo ' with_bg_video';
				}
				if ( '' != $tourimo_header_image ) {
					echo ' ' . esc_attr( tourimo_add_inline_css_class( 'background-image: url(' . esc_url( $tourimo_header_image ) . ');' ) );
				}
				if ( is_single() && has_post_thumbnail() ) {
					echo ' with_featured_image';
				}
				if ( tourimo_is_on( tourimo_get_theme_option( 'header_fullheight' ) ) ) {
					echo ' header_fullheight tourimo-full-height';
				}
				$tourimo_header_scheme = tourimo_get_theme_option( 'header_scheme' );
				if ( ! empty( $tourimo_header_scheme ) && ! tourimo_is_inherit( $tourimo_header_scheme  ) ) {
					echo ' scheme_' . esc_attr( $tourimo_header_scheme );
				}
				?>
">
	<?php

	// Background video
	if ( ! empty( $tourimo_header_video ) ) {
		get_template_part( apply_filters( 'tourimo_filter_get_template_part', 'templates/header-video' ) );
	}

	// Custom header's layout
	do_action( 'tourimo_action_show_layout', $tourimo_header_id );

	// Header widgets area
	get_template_part( apply_filters( 'tourimo_filter_get_template_part', 'templates/header-widgets' ) );

	?>
</header>
