<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<?php
	if ( class_exists( '\Elementor\Plugin' ) ) {
		$meta_viewport = \Elementor\Utils::get_meta_viewport( 'theme-builder' );
		$allowed_html  = array(
			'meta' => array(
				'name'    => array(),
				'content' => array(),
			),
		);
		echo wp_kses( $meta_viewport, $allowed_html );
	}
	?>
	<?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
		<title>
			<?php
			echo esc_html( wp_get_document_title() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 
			?>
		</title>
	<?php endif; ?>
	<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
	<?php wp_body_open(); ?>

	<?php do_action( 'ecafe_before_header' ); ?>
	<header itemscope="itemscope" id="ecafe-header" role="banner">
		<?php
		$allowed_tags           = wp_kses_allowed_html( 'post' );
		$allowed_tags['script'] = array(
			'type'  => true,
			'src'   => true,
			'defer' => true,
		);
		$allowed_tags['style']  = array(
			'type'  => true,
			'media' => true,
		);
		echo Ecafe_Theme_Builder::instance()->ec_render_builder_data_location( 'header' );
		?>
	</header>
	<?php do_action( 'ecafe_after_header' ); ?>
