<?php
global $wp_embed, $fgt_header_render, $isSticky, $isStickyClass;

$mergeWithContent = FALSE;
$mergeWithContentClass = '';
if (isset($post)) {
	$mergeWithContent = get_post_meta($post->ID, '_flothemes_merge_with_content_header_metabox_field', TRUE);
	$mergeWithContentClass = $mergeWithContent === 'true' ? 'fgt-page-merge-with-header' : '';
	$elements_color = get_post_meta($post->ID, '_flothemes_elements_color_header_metabox_field', TRUE);
	if (!$elements_color) {
		$elements_color = "#000";
	}
}
?>

<?php
$mergedWithHeaderElColor = $mergeWithContent === 'true' ? 'style="--elements-color: ' . $elements_color . '"' : '';
?>


<div id="page" class="flextheme_main_wrapper <?php echo $mergeWithContentClass; ?>">
	<header id="masthead" class="site-header <?php echo $isStickyClass; ?>" <?php echo $mergedWithHeaderElColor; ?>>
		<?php

			echo do_shortcode($wp_embed->autoembed(do_blocks($fgt_header_render)));

		?>

	</header>