<?php
/**
* The header for FreshWP theme.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package FreshWP WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license licennse URI, for example : http://www.gnu.org/licenses/gpl-2.0.html
* @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">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>

</head>

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

<div class='freshwp-wrapper'>

<?php freshwp_before_header(); ?>

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

<?php if ( get_header_image() ) : ?>
<div class="freshwp-header-image freshwp-clearfix">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="freshwp-header-img-link">
    <img src="<?php header_image(); ?>" width="<?php echo esc_attr(get_custom_header()->width); ?>" height="<?php echo esc_attr(get_custom_header()->height); ?>" alt="" class="freshwp-header-img"/>
</a>
</div>
<?php endif; ?>

<?php if ( !(freshwp_get_option('hide_header_content')) ) { ?>
<div class="freshwp-header-inside freshwp-clearfix">
<div id="freshwp-logo">
<?php if ( has_custom_logo() ) : ?>
    <div class="site-branding">
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="freshwp-logo-image-link">
        <img src="<?php echo esc_url( freshwp_custom_logo() ); ?>" alt="" class="freshwp-logo-image"/>
    </a>
    </div>
<?php else: ?>
    <div class="site-branding">
      <h1 class="freshwp-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
      <p class="freshwp-site-description"><?php bloginfo( 'description' ); ?></p>
    </div>
<?php endif; ?>
</div><!--/#freshwp-logo -->

<div id="freshwp-header-banner">
<?php dynamic_sidebar( 'freshwp-header-banner' ); ?>
</div><!--/#freshwp-header-banner -->
</div>
<?php } ?>

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

<?php freshwp_after_header(); ?>

<div class="freshwp-container freshwp-primary-menu-container freshwp-clearfix">
<div class="freshwp-primary-menu-container-inside freshwp-clearfix">
<nav class="freshwp-nav-primary" id="freshwp-primary-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'freshwp' ); ?>">
<button class="freshwp-primary-responsive-menu-icon" aria-controls="freshwp-menu-primary-navigation" aria-expanded="false"><?php esc_html_e( 'Menu', 'freshwp' ); ?></button>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'freshwp-menu-primary-navigation', 'menu_class' => 'freshwp-primary-nav-menu freshwp-menu-primary freshwp-clearfix', 'fallback_cb' => 'freshwp_fallback_menu', 'container' => '', ) ); ?>
</nav>
</div>
</div>

<?php freshwp_after_primary_menu(); ?>