{# audio-embed kindergarten override: neon panel, mono meta. Facade script + data-bn-* attributes + {% img %} preserved byte-for-byte. #}
<figure class="bn-audio my-6 overflow-hidden rounded-2xl border border-primary/40 bg-card text-card-foreground kg-crayon-shadow{% if class %} {{ class }}{% endif %}" data-bn-audio data-audio-url="{{ url|default:"" }}" data-audio-media="{% if media %}{{ media|mediaURL }}{% endif %}"><div class="flex items-center gap-4 p-4">{% if artwork %}<div class="h-16 w-16 shrink-0 overflow-hidden rounded-2xl border border-primary/30 bg-muted">{% img artwork alt=title|default:"" class="h-full w-full object-cover" %}</div>{% endif %}<div class="min-w-0 flex-1">{% if title %}<p class="kg-display truncate font-medium text-foreground">{{ title }}</p>{% endif %}{% if artist %}<p class="kg-mono truncate text-sm text-muted-foreground">{{ artist }}</p>{% endif %}<div class="mt-2 flex items-center gap-3" data-bn-audio-slot><button type="button" data-bn-audio-play class="kg-mono inline-flex items-center gap-2 rounded-2xl bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring" aria-label="Play{% if title %}: {{ title }}{% endif %}">::lucide:play:sm:: Play</button>{% if download %}<a href="{% if media %}{{ media|mediaURL }}{% else %}{{ url }}{% endif %}" download class="kg-mono inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground">::lucide:download:sm:: Download</a>{% endif %}</div></div></div></figure><script>
(function(){
  if(window.__bnAudioFacade)return;window.__bnAudioFacade=true;
  document.addEventListener('click',function(e){
    var btn=e.target.closest('[data-bn-audio-play]');if(!btn)return;
    var fig=btn.closest('[data-bn-audio]');if(!fig)return;
    e.preventDefault();
    var src=fig.getAttribute('data-audio-media')||fig.getAttribute('data-audio-url')||'';
    if(!src)return;
    var slot=btn.closest('[data-bn-audio-slot]');
    var a=document.createElement('audio');a.src=src;a.controls=true;a.autoplay=true;a.preload='none';a.style.cssText='width:100%;min-width:12rem;height:2.25rem;';
    btn.remove();slot.insertBefore(a,slot.firstChild);
  });
})();
</script>
