<?php

/**
 * Header Layout 2
 *
 * @package Vintuna
 */

use vintuna\Vintuna_Walkernav;

$vintuna_default = vintuna_get_default_theme_options();
$vintuna_header_bg_size = get_theme_mod('vintuna_header_bg_size', $vintuna_default['vintuna_header_bg_size']);
$ed_header_bg_fixed = get_theme_mod('ed_header_bg_fixed', $vintuna_default['ed_header_bg_fixed']);
$site_title_add_layout = get_theme_mod('site_title_add_layout', $vintuna_default['site_title_add_layout']);
$ed_header_bg_overlay = get_theme_mod('ed_header_bg_overlay', $vintuna_default['ed_header_bg_overlay']);
$vintuna_header_bg_size = get_theme_mod('vintuna_header_bg_size', $vintuna_default['vintuna_header_bg_size']);
$ed_header_bg_fixed = get_theme_mod('ed_header_bg_fixed', $vintuna_default['ed_header_bg_fixed']);
?>


<header id="site-header" class="theme-header data-bg <?php if ($ed_header_bg_overlay) {
                                                            echo 'data-bg-overlay';
                                                        } ?> <?php if (get_header_image()) {
                                                                    if ($ed_header_bg_fixed) {
                                                                        echo 'data-bg-fixed';
                                                                    } ?> header-bg-<?php echo esc_attr($vintuna_header_bg_size); ?> <?php } ?>" data-background="<?php echo esc_url(get_header_image()); ?>" role="banner">
    <?php
    $vintuna_default = vintuna_get_default_theme_options();
    $ed_ticker_bar_social_nav = get_theme_mod('ed_ticker_bar_social_nav', $vintuna_default['ed_ticker_bar_social_nav']);
  ?>

    <div class="header-branding-area">
        <div class="wrapper header-wrapper">
            <div class="header-item header-item-center">
                <div class="header-titles">
                    <?php
                    vintuna_site_logo();
                    vintuna_site_description();
                    ?>
                </div>
            </div>

        </div>
    </div>

    <div class="header-middle-area">
        <div class="wrapper header-wrapper">
            <div class="header-item header-item-left">

                <div class="data-time-panel">
                    <div class="theme-navextras-item theme-navextras-date">
                        <span class="theme-navextras-icon"><?php vintuna_theme_svg('calendar-full'); ?></span>
                        <span class="theme-navextras-label"><?php echo esc_html(date('l, F jS, Y')); ?></span>
                    </div>
                    <div class="theme-navextras-item theme-navextras-clock">
                        <span class="theme-navextras-icon"><?php vintuna_theme_svg('clock'); ?></span>
                        <span class="theme-navextras-label"><span id="wpi-time-clock"></span></span>
                    </div>
                </div>
            </div>

            <div class="header-item header-item-right">

                <?php
                if (has_nav_menu('vintuna-social-menu') && $ed_ticker_bar_social_nav) { ?>
                    <div class="header-social-navigation">
                        <?php
                        wp_nav_menu(
                            array(
                                'theme_location' => 'vintuna-social-menu',
                                'link_before' => '<span class="screen-reader-text">',
                                'link_after' => '</span>',
                                'container' => 'div',
                                'container_class' => 'vintuna-social-menu',
                                'depth' => 1,
                            )
                        ); ?>
                    </div>
                <?php } ?>
            </div>
        </div>
    </div>

    <div id="theme-navigation" class="header-navbar">
        <div class="wrapper header-wrapper <?php if (!is_active_sidebar('vintuna-offcanvas-widget')) { echo 'no-item-left'; } ?>">

            <div class="header-item header-item-left">

                <?php if (is_active_sidebar('vintuna-offcanvas-widget')) : ?>
                    <div id="widgets-nav" class="icon-sidr">
                        <button id="hamburger-one" class="navbar-control">

                                <span class="hamburger-wrapper">
                                    <span class="hamburger-inner"></span>
                                </span>

                        </button>
                    </div>
                <?php endif; ?>

                <div class="site-navigation">
                    <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'vintuna'); ?>" role="navigation">
                        <ul class="primary-menu theme-menu">
                            <?php
                            if (has_nav_menu('vintuna-primary-menu')) {
                                wp_nav_menu(
                                    array(
                                        'container' => '',
                                        'items_wrap' => '%3$s',
                                        'theme_location' => 'vintuna-primary-menu',
                                        'walker' => new vintuna\Vintuna_Walkernav(),
                                    )
                                );
                            } else {
                                wp_list_pages(
                                    array(
                                        'match_menu_classes' => true,
                                        'show_sub_menu_icons' => true,
                                        'title_li' => false,
                                        'walker' => new Vintuna_Walker_Page(),
                                    )
                                );
                            } ?>
                        </ul>
                    </nav>
                </div>
            </div>

            <div class="header-item header-item-right">
                <?php main_navigation_extras(); ?>
            </div>
        </div>
    </div>
</header>