<header class="np-header np-header-color">
  <div class="np-header-content">
    <div class="np-hidden-desktop np-header-mobile-menu-nav">
      {% if current_person.signed_in? %}
        <button
          data-toggle-class="np-hidden"
          class="np-header-mobile-menu-nav-button fal fa-times np-hidden np-header-font-color"
          data-toggle-target=".np-header-mobile-avatar-menu,
          .np-header-mobile-menu-content, .np-main, .np-footer"
        ></button>
        <button
          data-test="open-mobile-menu"
          data-toggle-class="np-hidden"
          class="np-header-mobile-menu-nav-button np-header-mobile-avatar-menu"
          data-toggle-target=".fa-times, .np-header-mobile-menu-content, .np-main, .np-footer"
        >
          <img
            alt="{{ current_person.name }}"
            class="np-header-avatar-image"
            src="{{ current_person.avatar_url }}"
          />
        </button>
      {% endif %}
    </div>
    {% if current_school.logo_url %}
      <h1 class="np-header-logo">
        <a href="{% route home %}">
          <img
            alt="{{ current_school.name }}"
            class="np-header-logo-image"
            src="{{ current_school.logo_url }}"
          />
        </a>
      </h1>
    {% else %}
      <a href="{% route home %}" class="np-school-name np-header-font-color">
        {{ current_school.name }}
      </a>
    {% endif %}

    <div class="np-hidden-mobile np-header-desktop-nav">
      <ul class="np-header-desktop-nav-list">
        <li class='np-header-right-menu-label' id='label1'>
         Themengebiete
          <i class="fas fa-chevron-down"></i>
          <ul class='np-header-right-menu-list' id='menu1'>
            <li class='np-header-right-menu-list-element'>
              Medienarbeit und Grundlagen der PR
            </li>
            <li class='np-header-right-menu-list-element'>
              Kommunikations­strategie & -management
            </li>
            <li class='np-header-right-menu-list-element'>
              Social Media Management
            </li>
            <li class='np-header-right-menu-list-element'>
              Interne Kommunikation 
            </li>
            <li class='np-header-right-menu-list-element'>
              Videos, Images, & Podcasts
            </li>
            <li class='np-header-right-menu-list-element'>
              Digitale Kommunikation & Online-Marketing
            </li>
            <li class='np-header-right-menu-list-element'>
              Leadership & Management-Kompetenzen
            </li>
            <li class='np-header-right-menu-list-element'>
              Public Affairs 
            </li>
            <li class='np-header-right-menu-list-element'>
              Verhandlungs­führung
            </li>
          </ul>
        </li>
        <li class='np-header-right-menu-label' id='label2'>
          Weiterbildungsangebote
          <i class="fas fa-chevron-down"></i>
          <ul class='np-header-right-menu-list' id='menu2'>
            <li class='np-header-right-menu-list-element'>
              Seminare
            </li>
            <li class='np-header-right-menu-list-element'>
              Online-Seminare
            </li>
            <li class='np-header-right-menu-list-element'>
              E-Learnings
            </li>
            <li class='np-header-right-menu-list-element'>
              Konferenzen
            </li>
            <li class='np-header-right-menu-list-element'>
             Zertifikats-Lehrgänge
            </li>
            <li class='np-header-right-menu-list-element'>
              Inhouse-Schulungen
            </li>
            <li class='np-header-right-menu-list-element'>
              Young Professionals
            </li>
          </ul>
        </li>
        <li class='np-header-right-menu-label' id='label3'>
          Über uns
          <i class="fas fa-chevron-down"></i>
          <ul class='np-header-right-menu-list' id='menu3'>
            <li class='np-header-right-menu-list-element'>
              Die Depak
            </li>
            <li class='np-header-right-menu-list-element'>
              Studienzentrum
            </li>
            <li class='np-header-right-menu-list-element'>
              Team
            </li>
            <li class='np-header-right-menu-list-element'>
              Tipps & Service
            </li>
          </ul>
        </li>
        <li class='np-header-right-menu-label'>
          Newsletter
        </li>
      </ul>
    </div>
    {% if current_person.signed_in? %}
      <div class="np-hidden-mobile np-header-search np-header-search-expanded">
        <form action="{% route search %}" method="get" data-test="desktop-search">
          <input
            aria-label="{% t .search %}"
            class="np-header-search-input np-header-font-background-color"
            type="text"
            name="q"
            placeholder="{% t .search %}"
          />
          <i class="np-header-search-icon far fa-search"></i>
        </form>
      </div>
      <div class="np-hidden-mobile np-header-avatar">
        <button
          class="np-header-avatar-button"
          data-test="open-desktop-menu"
          data-toggle-class-on-target="np-hidden"
          data-toggle-target=".np-header-avatar-tooltip"
          data-toggle-outside
        >
          <img
            alt="{{ current_person.name }}"
            class="np-header-avatar-image"
            src="{{ current_person.avatar_url }}"
          >
        </button>
        <div class="np-header-avatar-tooltip np-hidden" role="tooltip">
          <span class="np-header-avatar-tooltip-arrow-up"></span>
          <div class="np-header-avatar-tooltip-learner">
            <div class="np-header-avatar-tooltip-learner-name">
              {{ current_person.name }}
            </div>
            <div class="np-header-avatar-tooltip-learner-email">
              {{ current_person.email }}
            </div>
          </div>
          <nav class="np-header-avatar-tooltip-navigation">
          {% unless current_school.sso_active? %}
            <a
              class="np-header-avatar-tooltip-navigation-link"
              href="{% route account %}"
            >
              {% t .profile_settings %}
            </a>
          {% endunless %}
            <a
              class="np-header-avatar-tooltip-navigation-link np-danger"
              href="{% route logout %}"
            >
              {% t .sign_out %}
            </a>
          </nav>
        </div>
      </div>
    {% else %}
      <a
        class="np-header-sign-in np-header-desktop-nav-link np-header-font-color"
        href="{% route login %}"
      >
        {% t shared.sign_in %}
      </div>
    {% endif %}
  </div>
</header>

<div class="np-hidden-desktop">
  <div class="np-header-mobile-menu-content np-hidden">
    {% if current_person.signed_in? %}
      <img
        alt="{{ current_person.name }}"
        class="np-header-mobile-menu-content-avatar"
        src="{{ current_person.avatar_url }}"
      />
      <div class="np-header-mobile-menu-content-name">
        {{ current_person.name }}
      </div>
    {% endif %}
    <div class="np-header-mobile-menu-content-nav">
      <form
        class="np-header-search"
        data-test="mobile-search"
        method="get"
        action="{% route search %}"
      >
        <input
          aria-label="{% t .search %}"
          class="np-header-search-input"
          type="text"
          name="q"
          placeholder="{% t .search %}"
        />
        <i class="np-header-search-icon far fa-search"></i>
      </form>
      {% for website_navigation in navigations.header_navigations %}
        <a
          href="{{ website_navigation.path }}"
          class="np-header-mobile-menu-content-button"
          {% if website_navigation.external? %} target="_blank" {% endif %}
        >
          {{ website_navigation.name }}
        </a>
      {% endfor %}
      <div class="np-header-mobile-menu-content-line"></div>
      {% unless current_school.sso_active? %}
        <a
          class="np-header-mobile-menu-content-button"
          href="{% route account %}"
        >
          {% t .profile_settings %}
        </a>
      {% endunless %}
      <a
        class="np-header-mobile-menu-content-button np-danger"
        href="{% route logout %}"
      >
        {% t .sign_out %}
      </a>
    </div>
  </div>
</div>

{% include "messages" %}
<style>
  .np-header-logo-image {
    height: 55px;
  }
  .np-header-right-menu-label {
    font-size: 18px;
    padding: 13px 18px;
  }
  .np-header-right-menu-list {
    position: absolute;
    top: 80px;
    display: none;
    padding: 15px;
    background: white;
    list-style-type: none;
    z-index: 10;
    border-top: 2px solid #5a39a2;
    margin-left: -25px;
  }
  .np-header-right-menu-list-element {
    padding: 10px 0;
  }
  #label1:hover > #menu1 {
      display: block
  }
  #menu1:hover {
    display: block;
  }
  #label2:hover > #menu2 {
      display: block
  }
  #menu2:hover {
    display: block;
  }
  #label3:hover > #menu3 {
      display: block
  }
  #menu3:hover {
    display: block;
  }
</style>
