{#
/**
 * @file
 * Template for the main page.
 */
#}
<div class="site page {{page.isPublishedClass}}">
  <div class="site-wrapper__row">
    <!--[if IE 8 ]>
    <div class="site">
      <div class="site__inner alert alert-warning text-center" role="alert" aria-hidden="true">
        <p>This website may not work correctly because your browser is out of date. <a href="https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support" target="_blank">Please update your browser</a>.</p>
      </div>
    </div>
    <![endif]-->
    <!--[if IE 9 ]>
    <div class="site">
      <div class="site__inner alert alert-warning text-center" role="alert" aria-hidden="true">
        <p>This website may not work correctly because your browser is out of date. <a href="https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support" target="_blank">Please update your browser</a>.</p>
      </div>
    </div>
    <![endif]-->
    <span class="sr-only" id="back-to-top-anchor" aria-hidden="true" aria-disabled="true">Back to top anchor</span>

    {# Notices #}
    {% if page.notices %}
      {% block notices %}
        <div class="site notices" role="region">
          <div class="site__inner container">
            <div class="site__row row">
              {{ page.notices }}
            </div>
          </div>
        </div>
      {% endblock %}
    {% endif %}

    <div class="header-regions-wrapper">

      {# Pre-Header #}
      {% if page.pre_header %}
        {% block pre_header %}
          <div class="site pre-header" role="region">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.pre_header }}
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}

      {# Header #}
      {% if page.header %}
        {% block header %}
          <header class="site header" role="banner">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.header }}
              </div>
            </div>
          </header>
        {% endblock %}
      {% endif %}

      {# Post-Header #}
      {% if page.post_header %}
        {% block post_header %}
          <div class="site post-header" role="region">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.post_header }}
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}

      {# Pre-Hero #}
      {% if page.pre_hero %}
        {% block pre_hero %}
          <div class="site pre-hero" role="region" aria-label="Pre-hero">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.pre_hero }}
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}

      {# Hero #}
      {% if page.hero %}
        {% block hero %}
          <div class="site hero" role="region" aria-label="Hero">
            <div class="hero__inner">
              <div class="site__inner container">
                <div class="site__row row">
                  {{ page.hero }}
                </div>
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}

      {# Post-Hero #}
      {% if page.post_hero %}
        {% block post_hero %}
          <div class="site post-hero" role="region" aria-label="Post-hero">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.post_hero }}
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}

    </div>


    <main role="main" class="main-regions-wrapper">

    {# Help #}
    {% if page.help %}
      {% block help %}
        <div class="site help" role="region">
          <div class="site__inner container">
            <div class="site__row row">
              {{ page.help }}
            </div>
          </div>
        </div>
      {% endblock %}
    {% endif %}

    {# Pre-Content #}
    {% if page.pre_content %}
      {% block pre_content %}
        <div class="site pre-content" role="region" aria-label="Pre-content">
          <div class="site__inner container">
            <div class="site__row row">
              {{ page.pre_content }}
            </div>
          </div>
        </div>
      {% endblock %}
    {% endif %}

    {%
      set content_classes = [
      'site__content',
      'col-12',
        (page.sidebar|render|striptags('<drupal-render-placeholder>')|trim is not empty) ? 'has-sidebar' : 'has-no-sidebar'
      ]
    %}
    <div class="site content">
      <div class="site__inner container">
        <div class="site__row row">
          <div {{ content_attributes.addClass(content_classes) }} id="content" role="main">

            {# Action Links #}
            {% if action_links %}
              {% block action_links %}
                <ul class="action-links">{{ action_links }}</ul>
              {% endblock %}
            {% endif %}

            {# Content #}
            {% block content %}
              {{ page.content }}
            {% endblock %}
          </div>
          {%
            set has_sidebar = (page.sidebar|render|striptags('<drupal-render-placeholder>')|trim is not empty) ? TRUE : FALSE
          %}

          {% if (has_sidebar) %}
            <aside class="site__sidebar col-12" role="complementary">
              <span class="sr-only" id="sidebar-anchor" aria-hidden="true" aria-disabled="true">Sidebar anchor</span>
              <div class="site__sidebar-inner">
                {# Sidebar #}
                {% block sidebar %}
                  {{ page.sidebar }}
                {% endblock %}
              </div>
            </aside>
          {% endif %}

        </div>
      </div>
    </div>

    {# Post-Content #}
    {% if page.post_content %}
      {% block post_content %}
        <div class="site post-content" role="region" aria-label="Post-content">
          <div class="site__inner container">
            <div class="site__row row">
              {{ page.post_content }}
            </div>
          </div>
        </div>
      {% endblock %}
    {% endif %}


    </main>

    {% if (page.pre_footer) or (page.footer) or page.post_footer %}
    <hr class="footer-divide" />
    <footer class="footer-regions-wrapper bg-dark text-white py-4 py-lg-6" role="contentinfo">
      <span class="footer-regions-wrapper__anchor sr-only" id="footer-anchor" aria-hidden="true" aria-disabled="true">More menu anchor</span>
      {# Pre-Footer #}
      {% if page.pre_footer %}
        {% block pre_footer %}
          <div class="site pre-footer">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.pre_footer }}
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}

      {# Footer #}
      {% if page.footer %}
        {% block footer %}
          <footer class="site footer">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.footer }}
              </div>
            </div>
          </footer>
        {% endblock %}
      {% endif %}

      {# Post-Footer #}
      {% if page.post_footer %}
        {% block post_footer %}
          <div class="site post-footer">
            <div class="site__inner container">
              <div class="site__row row">
                {{ page.post_footer }}
              </div>
            </div>
          </div>
        {% endblock %}
      {% endif %}
    {% endif %}

  </footer>
</div>
</div>