<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package MarComm-AUX
 * @since 1.0.0
 */

use WP_AUX\Entities\AuxFramework\Partials\AlertEntity;
use WP_AUX\Enum\AlertTypeEnum;
use WP_AUX\Enum\SiteHeaderVariationEnum;
use WP_AUX\Services\AuxFramework\ElementClassesService;

$siteHeaderVariation = aux_header_variation();

$headerClasses = ElementClassesService::buildClasses('main-header')
  ->addClass('show-for-medium')
  ->addClass($siteHeaderVariation->headerClass())
  ->addModifier($siteHeaderVariation->mainHeaderModifier());
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head prefix="tamu: https://www.tamu.edu/ns#" itemscope itemtype="http://schema.org/Article">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
  <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
  <a class="skip-link screen-reader-text" href="#main-content">Skip to content</a>

  <?php
  aux_unpublished_banner();
  ?>
  <header id="navbar" class="<?php echo $headerClasses; ?>">
    <?php
    get_template_part('template-parts/header/header-utility', $siteHeaderVariation->value);
    get_template_part('template-parts/header/header-identity', $siteHeaderVariation->value);

    if (SiteHeaderVariationEnum::University !== $siteHeaderVariation) {
      wp_nav_menu(
        [
          'theme_location' => 'menu-1',
          'menu_id' => 'menu',
          'walker' => new header_menu_walker(),
          'container' => 'nav',
          'container_class' => 'site-header__nav',
        ]
      );
    }
    ?>
  </header>

  <?php get_template_part("template-parts/header/mobile-menu"); ?>
