{{ 'menu-hamburger-vertical.css' | asset_url | stylesheet_tag }}

{% comment %}
  Renders a hamburger menu style vertical

  Accepts:
  - menu: {Object} Menu object (required)

  Usage:
  {% render 'menu-hamburger-vertical',
    menu: menu
  %}
{% endcomment %}

<xo-modal
  class='menu-hamburger-vertical'
  xo-name='xo-menu-hamburger'
  xo-animate='fade-up'
  xo-placement='top-left'
  xo-duration='600'
  xo-portal='false'
  xo-backdrop-color='rgba(0, 0, 0, 0.8)'
>
  <xo-modal-trigger class='xo-menu-hamburger__trigger xo-menu-hamburger__trigger--close3' xo-name='xo-menu-hamburger'>
    <div class='xo-menu-hamburger__icon'></div>
  </xo-modal-trigger>
  <ul class='list-unstyled menu-hamburger-vertical__list'>
    {% for link in menu.links %}
      <li>
        {% if link.title contains '[' %}
          <a
            class='menu-hamburger-vertical__link'
            href='{{ link.url }}'
            title='{{link.title | split: '[' | first }}'
            {% if link.current %}
              aria-current='page'
            {% endif %}
          >
            {{ link.title | split: '[' | first }}
          </a>
        {% elsif link.title contains '(' %}
          {% comment %} skip {% endcomment %}
        {% else %}
          <a
            class='menu-hamburger-vertical__link'
            href='{{ link.url }}'
            title='{{ link.title }}'
            {% if link.current %}
              aria-current='page'
            {% endif %}
          >
            {{ link.title }}
          </a>
        {% endif %}
      </li>
    {% endfor %}
  </ul>
</xo-modal>
