<?php
global $post;
/**
 * Despite its name, this template echos between the opening HTML markup and the opening primary markup.
 *
 * This template must be called using get_header().
 *
 * @package SplendorStudio\Framework\Templates\Structure
 *
 * @since   1.0.0
 */
fancify_lite_output_e( 'fancify_lite_doctype', '<!DOCTYPE html>' );

fancify_lite_open_markup_e( 'fancify_lite_html', 'html', str_replace(' ', '&', str_replace( '"', '', fancify_lite_render_function( 'language_attributes' ) ) ) );

fancify_lite_open_markup_e( 'fancify_lite_head', 'head');

/**
 * Fires in the head.
 *
 * This hook fires in the head HTML section, not in wp_header().
 *
 * @since 1.0.0
 */
do_action('fancify_lite_head');

wp_head();

fancify_lite_close_markup_e( 'fancify_lite_head', 'head' );
fancify_lite_open_markup_e(
	'fancify_lite_body',
	'body',
	array(
		'class'     => implode(' ', get_body_class('fancify-form fancify-form no-js')),
		'itemscope' => 'itemscope',
		'itemtype'  => 'https://schema.org/WebPage',
	)
);

fancify_lite_build_skip_links();

if ( function_exists( 'wp_body_open' ) ) {
	wp_body_open();
} else {
	do_action( 'wp_body_open' ); // phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedHooknameFound -- Valid use case
}

// Add compaility with plugin
$container = isset( $post->ID ) ? Fancify_Lite_ACF::get_field( 'page_option_page_layout', 'theme_default', $post->ID ) : 'theme_default';
if ( 'theme_default' === $container ) {
	$container = get_theme_mod( 'general_layout_option' , 'full' );
}

fancify_lite_open_markup_e( 'fancify_lite_site', 'div', array( 'class' => 'fancify-site fancify-site-' . esc_attr( $container ) ) );

fancify_lite_open_markup_e( 'fancify_lite_main', 'main', array( 'class' => 'fancify-block fancify-main fancify-block fancify-row' ) );

do_action('fancify_lite_page_banner');

fancify_lite_open_markup_e('fancify_lite_fixed_wrap[_main]', 'div', 'class=fancify-container fancify-container-center fancify-container-center');

fancify_lite_open_markup_e(
	'fancify_lite_main_grid',
	'div',
	array(
		'class'               => 'fancify-grid fancify-grid',
		'data-fancify-grid-margin' => '',
	)
);

fancify_lite_open_markup_e( 'fancify_lite_primary', 'div', array('class' => 'fancify-primary ' . fancify_lite_get_layout_class( 'content' ) ) );