{# image override — hairline-framed figure with alignment and an optional caption. #}
{% if src %}{% if align == "left" %}{% set ialign = "flex-start" %}{% elif align == "right" %}{% set ialign = "flex-end" %}{% else %}{% set ialign = "center" %}{% endif %}<figure class="{{ class }}" style="margin:1.5rem 0;display:flex;flex-direction:column;align-items:{{ ialign }};">
<div class="cm-media-frame" style="max-width:100%;overflow:hidden;border:1px solid hsl(var(--border));border-radius:4px;line-height:0;">{% img src alt=alt|default:"" class="cm-image-el" %}</div>
{% if caption %}<figcaption class="cm-stat-label" style="margin-top:0.5rem;text-align:{% if align == "center" %}center{% else %}left{% endif %};">{{ caption }}</figcaption>{% endif %}
</figure><style>.cm-media-frame > .cm-image-el,.cm-media-frame > img{display:block;max-width:100%;height:auto;}</style>{% endif %}
