{#
/**
 * @file
 * Droopler's theme implementation of the reusable page header.
 *
 * Available variables:
 *
  * General utility variables:
 * - base_path: The base URL path of the Drupal installation. Will usually be
 *   "/" unless you have installed Drupal in a sub-directory.
 * - is_front: A flag indicating if the current page is the front page.
 * - logged_in: A flag indicating if the user is registered and signed in.
 * - is_admin: A flag indicating if the user has permission to access
 *   administration pages.
 *
 * Site identity:
 * - front_page: The URL of the front page. Use this instead of base_path when
 *   linking to the front page. This includes the language domain or prefix.
 * - logo: The url of the logo image, as defined in theme settings.
 * - site_name: The name of the site. This is empty when displaying the site
 *   name has been disabled in the theme settings.
 * - site_slogan: The slogan of the site. This is empty when displaying the site
 *   slogan has been disabled in theme settings.
 *
 * Regions:
 * - page.header_form: Items for the header form region.
 * - page.primary_menu: Items for the primary menu region.
 * - page.secondary_menu: Items for the secondary menu region.
 * - page.lang_menu: Items for the language menu region.
 *
 * Theme variables:
 * - is_cta_header: A flag to determine whether this is a header with CTA.
 * - is_disabled_header: A flag to determine whether this is a disabled header.
 * - header_layout: Header layout type name.
 * - navbar_attributes: Items for the header region.
 *
 * @see layout/page.html.twig
 * @see template_preprocess_page()
 * @see droopler_theme_preprocess_page()
 */
#}
{% set header_classes = [
  'container',
  'no-padding-md',
  is_cta_header ? 'hanging-header',
  page.admin_tabs ? 'alert-ladning-header',
] %}

<header id="header" class="header" role="banner" aria-label="{{ 'Site header'|t }}">
  <nav{{ navbar_attributes.addClass(classes) }}>
    <div class="{{ header_classes | join(' ') }}">
      <div class="navbar-brand d-flex align-items-center">
        {{ page.header }}
      </div>
      {% if is_cta_header %}
        {% if cta_button is not empty %}
          <div class="d-content-cta-wrapper">
            {{ cta_button | render }}
          </div>
        {% endif %}
      {% else %}
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-nav" aria-controls="navbar-nav" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <nav class="navbar navbar-expand-lg main-navbar px-0 collapse ml-auto flex-column d-lg-flex" id="navbar-nav">
          <div class="navbar-inner d-flex">
            {% if page.secondary_menu %}
              <div class="secondary-menu-region">{{ page.secondary_menu }}</div>
            {% endif %}
            {% if page.primary_menu %}
              <div class="menu-region">{{ page.primary_menu }}</div>
            {% endif %}
            {% if  page.lang_menu %}
              <div class="lang-region">{{ page.lang_menu }}</div>
            {% endif %}
          </div>
        </nav>
      {% endif %}
    </div>
  </nav>
</header>
