{{define "image_item"}}
<a class="image-result" href="{{.URL}}" target="_blank" rel="noopener noreferrer">
  <div class="image-thumb">
    {{if .Thumbnail}}
    <img src="{{.Thumbnail}}" alt="{{.Title}}" loading="lazy" onerror="this.parentElement.classList.add('image-error')">
    {{else}}
    <div class="image-placeholder">🖼️</div>
    {{end}}
  </div>
  <div class="image-meta">
    <span class="image-title">{{.Title}}</span>
    {{if .Content}}<span class="image-source">{{.Content}}</span>{{end}}
  </div>
</a>
{{end}}
