{% extends "base.html" %}
{% block title %}{{ file }} · {{ name }} · The Booth{% endblock %}
{% block content %}
<div class="docview">
  <div class="vbar">
    <a class="vbtn vx" href="/b/{{ name_url }}/" title="back to gallery (Esc)">✕</a>
    <span class="vname">{{ file }}</span>
    <span class="vspacer"></span>
    <a class="vbtn" href="{{ file_url }}?dl=1" title="download {{ file }}">⬇</a>
  </div>
  {% if is_html %}
    <article class="markdown-body">{{ body|safe }}</article>
  {% else %}
    <pre class="textview">{{ body }}</pre>
  {% endif %}
</div>
<style>
  /* .markdown-body and .textview now live in base.html (shared with the inline
     gallery view). Only the full-page layout wrapper is page-specific. */
  .docview{max-width:52rem;margin:0 auto;padding:0 clamp(12px,3vw,20px) 4rem}
  .docview .textview{overflow-x:auto}
</style>
<script>
  document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape') window.location.href = {{ ('/b/' ~ name_url ~ '/')|tojson }};
  });
</script>
{% endblock %}
