{# Related items via graph similarity, not tag matching.

  Use case: the "you might also like" panel under any content page,
  but using the engine's embedding-based similarity (db.similar) so
  the matches reflect structural + textual relatedness, not just
  tag overlap.

  This is the StaticOwl differentiator pattern: any flat-CMS can do
  related-by-tag in 3 lines. Only a graph-native CMS can do this
  one-liner against actual content embeddings.

  Schema assumptions:
    - Any content type with embeddings (every node gets one by default)

  Drop into a page template as a fragment. Uses the same `{% similar %}`
  / `{% else %}` shape as other iteration tags. #}

<aside class="related related--similar">
  <h2>You might also like</h2>
  <ul>
    {% similar to:"{{ id }}" limit:5 as match %}
      <li>
        <a href="{{ match.url }}">{{ match.title }}</a>
        <span class="match-score" title="cosine similarity">
          {{ match.score | times: 100 | round }}% match
        </span>
      </li>
    {% else %}
      <li class="empty">No related content yet.</li>
    {% endsimilar %}
  </ul>
  <p class="hint">
    Matches based on content structure + meaning, not tag overlap.
  </p>
</aside>
