<?php
/**
 * The header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="content">
 *
 * @package Swifty Site Designer
 */

do_action( 'swifty_check_theme_inited' );
    
global $ssd_settings;
$ssd_settings = json_decode( get_theme_mod( 'ssd_settings_obj', '{}' ), true );

global $wp_customize;

$ssd_css = get_theme_mod( 'ssd_css', '' );

$scc_version = apply_filters( 'swifty_scc_get_version', '' );

$swifty_css_location = apply_filters( 'swifty_get_css_location', 'inline' );
    
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php
if( $swifty_css_location === 'external' && ! isset( $wp_customize ) ) {
    $ver = md5( $ssd_css . $scc_version );
    $ajax_url = get_stylesheet_directory_uri() . '/ssd/php/ssd_ajax.php';
    wp_enqueue_style( 'ssd_dynamic_css', $ajax_url . '?action=ssd_dynamic_css', array(), $ver );
}
if( $swifty_css_location !== 'external' || isset( $wp_customize ) ) {
    // Must be done before wp_head!
    $swifty_scc_get_styles = apply_filters( 'swifty_scc_get_styles', '' );
}
?>
    
<?php wp_head(); ?>

</head>

<body <?php body_class( isset( $ssd_settings[ 'boxed' ] ) && $ssd_settings[ 'boxed' ] == 1 ? 'swifty_boxed' : 'swifty_wide' ); ?>>

<?php if( isset( $wp_customize ) ) { ?>
    <style type="text/css"><?php echo swifty_read_text( dirname( __FILE__ ) . '/style.css' ); ?></style>
<?php } ?>

<?php
if( $swifty_css_location !== 'external' || isset( $wp_customize ) ) {
?>
    <!-- Inline the full css, even though it's quite big, so the page can be correctly renderdered immediately. Also important for Google Page Speed Insights -->
    <style type="text/css" id="swifty_ssd_css"><?php echo $ssd_css; ?></style>
    <!--Inline the SCC styles-->
    <style type="text/css"><?php echo $swifty_scc_get_styles; ?></style>
<?php
}
?>

<!--<div id="page" class="hfeed site">-->
<!--	<div id="content" class="site-content">-->


        <div class="swifty_area_frame swifty_area">
        <div class="swifty_area_inner_frame swifty_area_inner">
        <div class="swifty_area_inner_content_frame swifty_area_inner_content">
            <div class="swifty_area_hub swifty_area">
            <div class="swifty_area_inner_hub swifty_area_inner">
            <div class="swifty_area_inner_content_hub swifty_area_inner_content">
                <div class="swifty_area_main swifty_area">
                <div class="swifty_area_inner_main swifty_area_inner">
                <div class="swifty_area_inner_content_main swifty_area_inner_content">
