{#
/**
 * @file
 * Theme override to display node pages with custom header.
 */
#}

{# Modern Header Component #}
{% include '@starman/header/header.twig' with {
  'header_type': header_config.type,
  'logo2_url': logo2_url,
  'site_name': site_name,
  'front_page': front_page,
  'main_menu': page.primary_menu ?: page.navbar_left ?: main_menu_direct,
  'user_menu': page.secondary_menu,
  'promo_text': header_config.promo_text,
  'currency': header_config.currency,
  'cart_count': 0,
  'show_promo_bar': header_config.show_promo_bar,
  'show_search': header_config.show_search,
  'show_user_account': header_config.show_user_account,
  'show_cart': header_config.show_cart,
  'show_locale_selector': header_config.show_locale_selector
} %}

{# Skip to main content link for accessibility #}
<a href="#main-content" class="visually-hidden-focusable skip-link">
  {{ 'Skip to main content'|t }}
</a>

{# Main content area #}
<main id="main-content" class="main-content" role="main">

  {# Highlighted content region #}
  {% if page.highlighted %}
    <section class="highlighted">
      <div class="container">
        {{ page.highlighted }}
      </div>
    </section>
  {% endif %}

  {# Help content region #}
  {% if page.help %}
    <section class="help">
      <div class="container">
        {{ page.help }}
      </div>
    </section>
  {% endif %}

  {# Breadcrumb #}
  {% if page.breadcrumb %}
    <section class="breadcrumb">
      <div class="container">
        {{ page.breadcrumb }}
      </div>
    </section>
  {% endif %}

  {# Main content region #}
  <section class="content">
    <div class="container">
      <div class="row">

        {# Sidebar first #}
        {% if page.sidebar_first %}
          <aside class="col-md-3" role="complementary">
            {{ page.sidebar_first }}
          </aside>
        {% endif %}

        {# Main content #}
        <div class="{{ page.sidebar_first and page.sidebar_second ? 'col-md-6' : (page.sidebar_first or page.sidebar_second ? 'col-md-9' : 'col-md-12') }}">
          {{ page.content }}
        </div>

        {# Sidebar second #}
        {% if page.sidebar_second %}
          <aside class="col-md-3" role="complementary">
            {{ page.sidebar_second }}
          </aside>
        {% endif %}

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

</main>

{# Footer region #}
{% if page.footer %}
  <footer class="site-footer" role="contentinfo">
    <div class="container">
      {{ page.footer }}
    </div>
  </footer>
{% endif %}
