<?php
/**
* The header for GridFlex theme.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package GridFlex WordPress Theme
* @copyright Copyright (C) 2024 ThemesDNA
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
* @author ThemesDNA <themesdna@gmail.com>
*/

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>

<body <?php body_class(); ?> id="gridflex-site-body" itemscope="itemscope" itemtype="http://schema.org/WebPage">
<?php wp_body_open(); ?>
<a class="skip-link screen-reader-text" href="#gridflex-content-wrapper"><?php esc_html_e( 'Skip to content', 'gridflex' ); ?></a>

<div class="gridflex-site-wrapper">

<?php gridflex_header_image(); ?>

<?php gridflex_before_header(); ?>

<div class="gridflex-site-header gridflex-container" id="gridflex-header" itemscope="itemscope" itemtype="http://schema.org/WPHeader" role="banner">
<div class="gridflex-head-content gridflex-clearfix" id="gridflex-head-content">

<?php if ( gridflex_is_header_content_active() ) { ?>
<div class="gridflex-header-inside gridflex-clearfix">
<div class="gridflex-header-inside-content gridflex-clearfix">
<div class="gridflex-outer-wrapper">
<div class="gridflex-header-inside-container">

<div class="gridflex-logo">
<?php if ( has_custom_logo() ) : ?>
    <div class="site-branding site-branding-full">
    <div class="gridflex-custom-logo-image">
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="gridflex-logo-img-link">
        <img src="<?php echo esc_url( gridflex_custom_logo() ); ?>" alt="" class="gridflex-logo-img"/>
    </a>
    </div>
    <div class="gridflex-custom-logo-info"><?php gridflex_site_title(); ?></div>
    </div>
<?php else: ?>
    <div class="site-branding">
      <?php gridflex_site_title(); ?>
    </div>
<?php endif; ?>
</div>

<div class="gridflex-header-banner">
<?php dynamic_sidebar( 'gridflex-header-ad' ); ?>
</div>

</div>
</div>
</div>
</div>
<?php } else { ?>
<div class="gridflex-no-header-content">
  <?php gridflex_site_title(); ?>
</div>
<?php } ?>

</div><!--/#gridflex-head-content -->
</div><!--/#gridflex-header -->

<?php gridflex_after_header(); ?>

<?php if ( gridflex_is_primary_menu_active() ) { ?>
<div class="gridflex-container gridflex-primary-menu-container gridflex-clearfix">
<div class="gridflex-primary-menu-container-inside gridflex-clearfix">
<nav class="gridflex-nav-primary" id="gridflex-primary-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'gridflex' ); ?>">
<div class="gridflex-outer-wrapper">
<button class="gridflex-primary-responsive-menu-icon" aria-controls="gridflex-menu-primary-navigation" aria-expanded="false"><?php echo esc_html( gridflex_primary_menu_text() ); ?></button>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'gridflex-menu-primary-navigation', 'menu_class' => 'gridflex-primary-nav-menu gridflex-menu-primary', 'fallback_cb' => 'gridflex_fallback_menu', 'container' => '', ) ); ?>

<?php if ( 'primary-menu' === gridflex_social_buttons_location() ) { ?>
    <?php if ( gridflex_is_social_buttons_active() ) { ?>
        <?php gridflex_header_social_buttons(); ?>
        <div id="gridflex-search-overlay-wrap" class="gridflex-search-overlay">
          <div class="gridflex-search-overlay-content">
            <?php get_search_form(); ?>
          </div>
          <button class="gridflex-search-closebtn" aria-label="<?php esc_attr_e( 'Close Search', 'gridflex' ); ?>" title="<?php esc_attr_e('Close Search','gridflex'); ?>">&#xD7;</button>
        </div>
    <?php } ?>
<?php } ?>
</div>
</nav>
</div>
</div>
<?php } ?>

<?php gridflex_top_wide_widgets(); ?>

<div class="gridflex-outer-wrapper" id="gridflex-wrapper-outside">

<div class="gridflex-container gridflex-clearfix" id="gridflex-wrapper">
<div class="gridflex-content-wrapper gridflex-clearfix" id="gridflex-content-wrapper">