{#
  Shared mobile menu for both base templates and OOB updates

  This macro can be used in two modes:
  - oob=true: Outputs full wrapper with hx-swap-oob attribute (for OOB updates)
  - oob=false: Outputs just content, assumes wrapper exists (for base templates)

  The caller can pass section-specific nav items via section_nav parameter.
#}

{% macro mobile_menu(section_nav='', oob=true) %}
{% if oob %}
<div id="root-menu" hx-swap-oob="outerHTML" class="md:hidden">
{% endif %}
  <nav id="nav-panel" {% if oob %}hx-swap-oob="true"{% endif %} class="flex flex-col gap-2 mt-2 px-2 pb-2" role="listbox">
    {% if not g.user %}
      {% include '_types/root/_sign_in.html' %}
    {% endif %}
    {% include '_types/root/_nav.html' %}

    {# Section-specific mobile nav #}
    {% if section_nav %}
      {{ section_nav }}
    {% else %}
      {% include "_types/root/_nav_panel.html"%}
    {% endif %}
  </nav>
{% if oob %}
</div>
{% endif %}
{% endmacro %}





{% macro oob_mobile_menu() %}
<div id="root-menu" hx-swap-oob="outerHTML" class="md:hidden">
  <nav id="nav-panel" class="flex flex-col gap-2 mt-2 px-2 pb-2" role="listbox">
    {{caller()}}
  </nav>
</div>
{% endmacro %}



