<?php
/**
 * Header Layout
 * @package Wind Energy
 */

$wind_energy_default = wind_energy_get_default_theme_options();
?>

<?php
$wind_energy_sticky = get_theme_mod('wind_energy_sticky');
    $wind_energy_data_sticky = "false";
    if ($wind_energy_sticky) {
    $wind_energy_data_sticky = "true";
    }
    global $wp_customize;
?>
<header id="site-header" class="site-header-layout header-layout" role="banner">
    <div class="header-navbar <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($wind_energy_data_sticky); ?>">
        <div class="wrapper header-wrapper">
            <div class="theme-header-areas header-areas-left">
                <div class="header-titles">
                    <?php
                    wind_energy_site_logo();
                    wind_energy_site_description();
                    ?>
                </div>
            </div>
            <?php $wind_energy_header_social_ed = get_theme_mod( 'wind_energy_header_social_ed', $wind_energy_default['wind_energy_header_social_ed'] ); 
                if( $wind_energy_header_social_ed ){ ?>
                <div class="theme-header-areas header-areas-left">
                    <div class="social-media">
                        <?php $wind_energy_header_center_facebook = esc_url( get_theme_mod( 'wind_energy_header_center_facebook',$wind_energy_default['wind_energy_header_center_facebook'] ) );
                            if( $wind_energy_header_center_facebook ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $wind_energy_header_center_facebook ); ?>"><span class="dashicons dashicons-facebook-alt"></span></a>
                        <?php } ?>
                        <?php $wind_energy_header_center_twitter = esc_url( get_theme_mod( 'wind_energy_header_center_twitter',$wind_energy_default['wind_energy_header_center_twitter'] ) );
                            if( $wind_energy_header_center_twitter ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $wind_energy_header_center_twitter ); ?>"><span class="dashicons dashicons-twitter"></span></a>
                        <?php } ?>
                        <?php $wind_energy_header_center_linkedin = esc_url( get_theme_mod( 'wind_energy_header_center_linkedin',$wind_energy_default['wind_energy_header_center_linkedin'] ) );
                            if( $wind_energy_header_center_linkedin ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $wind_energy_header_center_linkedin ); ?>"><span class="dashicons dashicons-linkedin"></span></a>
                        <?php } ?>
                        <?php $wind_energy_header_center_instagram = esc_url( get_theme_mod( 'wind_energy_header_center_instagram',$wind_energy_default['wind_energy_header_center_instagram'] ) );
                            if( $wind_energy_header_center_instagram ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $wind_energy_header_center_instagram ); ?>"><span class="dashicons dashicons-instagram"></span></a>
                        <?php } ?>
                        <?php $wind_energy_header_center_youtube = esc_url( get_theme_mod( 'wind_energy_header_center_youtube',$wind_energy_default['wind_energy_header_center_youtube'] ) );
                            if( $wind_energy_header_center_youtube ){ ?>
                            <a target="_blank" href="<?php echo esc_url( $wind_energy_header_center_youtube ); ?>"><span class="dashicons dashicons-youtube"></span></a>
                        <?php } ?>
                    </div>
                </div>
            <?php } ?>
            <div class="theme-header-areas header-areas-right">
                <div class="site-navigation">
                    <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'wind-energy'); ?>" role="navigation">
                        <ul class="primary-menu theme-menu">
                            <?php
                            if (has_nav_menu('wind-energy-primary-menu')) {
                                wp_nav_menu(
                                    array(
                                        'container' => '',
                                        'items_wrap' => '%3$s',
                                        'theme_location' => 'wind-energy-primary-menu',
                                    )
                                );
                            } else {
                                wp_list_pages(
                                    array(
                                        'match_menu_classes' => true,
                                        'show_sub_menu_icons' => true,
                                        'title_li' => false,
                                        'walker' => new wind_energy_Walker_Page(),
                                    )
                                );
                            } ?>
                        </ul>
                    </nav>
                </div>
                <div class="navbar-controls twp-hide-js">
                    <button type="button" class="navbar-control navbar-control-offcanvas">
                        <span class="navbar-control-trigger" tabindex="-1">
                            <?php wind_energy_the_theme_svg('menu'); ?>
                        </span>
                    </button>
                </div>
            </div>
            <?php
            $wind_energy_header_button_ed = get_theme_mod( 'wind_energy_header_button_ed', $wind_energy_default['wind_energy_header_button_ed'] ); 
                if( $wind_energy_header_button_ed ){ ?>
                <div class="theme-header-areas header-areas-right">
                    <?php $wind_energy_header_layout_button_text = esc_html( get_theme_mod( 'wind_energy_header_layout_button_text',$wind_energy_default['wind_energy_header_layout_button_text'] ) );
                        $wind_energy_header_layout_button_link = esc_html( get_theme_mod( 'wind_energy_header_layout_button_link' ) );

                        if( $wind_energy_header_layout_button_text || $wind_energy_header_layout_button_link ){ ?>
                        <a href="<?php echo esc_url( $wind_energy_header_layout_button_link ); ?>" class="btn-fancy btn-fancy-primary"><?php echo esc_html( $wind_energy_header_layout_button_text ); ?></a>
                    <?php } ?>
                </div>
            <?php } ?>
        </div>
    </div>
</header>