{#
/**
 * @file
 * Theme override for a pager.
 */
#}
{% if items %}
  <nav class="pager flex items-center justify-center gap-2 py-8" role="navigation" aria-labelledby="pagination-heading">
    <h4 id="pagination-heading" class="sr-only">{{ 'Pagination'|t }}</h4>
    <ul class="flex items-center gap-1">
      {% if items.first %}
        <li class="pager__item pager__item--first">
          <a href="{{ items.first.href }}" title="{{ 'Go to first page'|t }}" class="flex items-center justify-center w-10 h-10 rounded-lg border border-gray-300 dark:border-slate-600 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-gray-700 dark:text-gray-300">
            <span class="sr-only">{{ 'First page'|t }}</span>
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7"/></svg>
          </a>
        </li>
      {% endif %}
      {% if items.previous %}
        <li class="pager__item pager__item--previous">
          <a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev" class="flex items-center justify-center w-10 h-10 rounded-lg border border-gray-300 dark:border-slate-600 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-gray-700 dark:text-gray-300">
            <span class="sr-only">{{ 'Previous page'|t }}</span>
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/></svg>
          </a>
        </li>
      {% endif %}
      {% if ellipses.previous %}
        <li class="pager__item pager__item--ellipsis text-gray-500 dark:text-gray-400 px-2" role="presentation">&hellip;</li>
      {% endif %}
      {% for key, item in items.pages %}
        <li class="pager__item{{ current == key ? ' is-active' }}">
          {% if current == key %}
            {% set title = 'Current page'|t %}
          {% else %}
            {% set title = 'Go to page @key'|t({'@key': key}) %}
          {% endif %}
          <a href="{{ item.href }}" title="{{ title }}" class="flex items-center justify-center w-10 h-10 rounded-lg border transition-colors {{ current == key ? 'bg-blue-600 border-blue-600 text-white' : 'border-gray-300 dark:border-slate-600 hover:bg-gray-100 dark:hover:bg-slate-700 text-gray-700 dark:text-gray-300' }}">
            {{ key }}
          </a>
        </li>
      {% endfor %}
      {% if ellipses.next %}
        <li class="pager__item pager__item--ellipsis text-gray-500 dark:text-gray-400 px-2" role="presentation">&hellip;</li>
      {% endif %}
      {% if items.next %}
        <li class="pager__item pager__item--next">
          <a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next" class="flex items-center justify-center w-10 h-10 rounded-lg border border-gray-300 dark:border-slate-600 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-gray-700 dark:text-gray-300">
            <span class="sr-only">{{ 'Next page'|t }}</span>
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/></svg>
          </a>
        </li>
      {% endif %}
      {% if items.last %}
        <li class="pager__item pager__item--last">
          <a href="{{ items.last.href }}" title="{{ 'Go to last page'|t }}" class="flex items-center justify-center w-10 h-10 rounded-lg border border-gray-300 dark:border-slate-600 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-gray-700 dark:text-gray-300">
            <span class="sr-only">{{ 'Last page'|t }}</span>
            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 5l7 7-7 7"/></svg>
          </a>
        </li>
      {% endif %}
    </ul>
  </nav>
{% endif %}
