{# Navigation précédent/suivant pour les aperçus de fichiers #}
<div class="preview-nav">
  {% if prev_path %}
    <a href="{{ url_for('browse', subpath=prev_path) }}" class="nav-arrow" id="nav-prev" title="Précédent (←)">&#8249;</a>
  {% else %}
    <span class="nav-arrow nav-arrow--off">&#8249;</span>
  {% endif %}

  {% if sibling_pos %}
    <span class="nav-pos">{{ sibling_pos }}</span>
  {% endif %}

  {% if next_path %}
    <a href="{{ url_for('browse', subpath=next_path) }}" class="nav-arrow" id="nav-next" title="Suivant (→)">&#8250;</a>
  {% else %}
    <span class="nav-arrow nav-arrow--off">&#8250;</span>
  {% endif %}
</div>
<script>
document.addEventListener('keydown', function(e) {
  if (e.key === 'ArrowLeft')  { var a = document.getElementById('nav-prev'); if (a) location.href = a.href; }
  if (e.key === 'ArrowRight') { var a = document.getElementById('nav-next'); if (a) location.href = a.href; }
});
</script>
