{include file="_partials/head.tpl"}

<div class="bz-container">
  <div class="bz-page-head">
    <div class="bz-breadcrumbs"><a href="/">Главная</a> · <span>Поиск</span></div>
    <h1>Поиск</h1>
    <form method="get" action="/search" class="bz-search-form" style="margin-top:18px">
      <input type="search" name="q" value="{query}" placeholder="Что ищем?" autofocus>
      <button type="submit">{icon name="search" size="16"} Найти</button>
    </form>
  </div>

  <div class="bz-article-layout">
    <main>
      [if {query}]
        <p class="bz-muted">Найдено результатов: <b>{total}</b></p>
        [if {results}]
          <div class="bz-following-grid">
            [foreach var="results" as="r"]
              <article class="bz-following-card">
                <div class="bz-body">
                  <span class="bz-tag">{r.kind_label}</span>
                  <h3 class="bz-card-title"><a href="{r.url}">{r.title}</a></h3>
                  [if {r.snippet}]<p class="bz-card-short">{r.snippet}</p>[/if]
                  <div class="bz-card-meta">
                    {icon name="calendar" size="14"} <span>{r.date}</span>
                  </div>
                </div>
              </article>
            [/foreach]
          </div>
          {include file="_partials/pagination.tpl"}
        [else]
          <div class="bz-empty-state">
            <div class="bz-empty-icon">{icon name="search" size="32"}</div>
            <h3>Ничего не найдено</h3>
            <p>Попробуйте изменить запрос.</p>
          </div>
        [/if]
      [/if]
    </main>

    {include file="_partials/sidebar.tpl"}
  </div>
</div>

{include file="_partials/foot.tpl"}
