{% load brickwork_components brickwork_icons %} {% comment %} Card (CMP-014 to CMP-017): the elevated composition surface. Structural, so it is consumed via {% include %} (like _page_header.html and _data_table.html). Unfilled regions emit NO markup (AC-BW-070). Appearance: docs/APPEARANCE.md (icvoss/django-brickwork#535). This is the finished card contract: no further appearance axes are planned for _card.html. Named blocks (semver-public, BR-BW-TPL-001), in document order: media, header, title, actions, body, footer: concise names (ADR-077). `media` is new with the appearance suite; the rest since 3.4.0. Prefixed names (card_header, card_title, card_actions, card_body, card_footer) were removed in 4.0.0. DUAL CONSUMPTION on `title` (icvoss/django-brickwork#398): the `title` block also renders a `title` context variable in

. `{% block title %}` still overrides the whole thing. Appearance options (closed; `{% bw_options %}` raises on unknown values): surface ("default"|"raised"|"tint"|"inverse"|"muted"): CSS-only fill. elevation ("0"|"1"|"2"|"3"): CSS-only shadow ladder. "1" / omitted = base. size ("sm"|"md"|"lg"): padding scale. radius ("default"|"sm"|"lg"|"xl"|"none"): CSS-only corner scale. "default" / "lg" / omitted emit no modifier (base uses --bw-radius-lg). header_recipe ("none"|"plain"|"bordered"|"muted"|"inverse"|"accent"): region recipe, NOT the header block. Package emits header chrome when title is set and the recipe is not none, or when title + action_label are set without a whole-card href. "plain" is chrome without a treatment class. {% block header %} still wins for rich markup. footer_recipe ("none"|"plain"|"muted"|"actions"): region recipe for footers. caption= supplies muted/plain text on include; actions is for buttons via {% block footer %} / extends. media_recipe ("none"|"bleed"|"inset"|"icon"): media region recipe. bleed/inset need media_src (+ optional media_alt); icon needs media_icon (a registered brickwork icon name). {% block media %} wins for rich media. body / caption: optional escaped strings for include-path body and footer. action_label / action_href: optional header action on the include path (ghost sm button). Suppressed when the whole card is an href link (nested interactive content). Rich action clusters stay extends-only. Existing flags (unchanged): interactive (bool): raise to elevation-2 on hover/focus-within. href: whole card is a clickable anchor; interactive always applies. Trust boundary: brickwork does not validate URL schemes; href values are emitted as given and callers passing user-supplied URLs must validate them first. bordered (bool): hairline alone (elevation-0). States: resting elevation-1; interactive/href raise shadow only (MOT-010). Accessibility: linked cards are real ; package header actions are omitted on linked cards. Axe: card-*.html. Responsive: no breakpoint switch; sizing is the fixed size token scale. {% endcomment %}{% bw_options component="brickwork/components/_card.html" surface=surface elevation=elevation size=size radius=radius header_recipe=header_recipe footer_recipe=footer_recipe media_recipe=media_recipe %} {% if href %}{% else %}
{% endif %} {% block media %}{% if media_recipe and media_recipe != "none" %}{% if media_recipe == "icon" and media_icon %}
{% bw_icon media_icon size="lg" decorative=True %}
{% elif media_src %}
{{ media_alt }}
{% endif %}{% endif %}{% endblock %} {% block header %}{% if title %}{% if header_recipe and header_recipe != "none" %}

{{ title }}

{% if action_label and not href %}
{% if action_href %}{% bw_button action_label href=action_href size="sm" variant="ghost" %}{% else %}{% bw_button action_label size="sm" variant="ghost" %}{% endif %}
{% endif %}
{% elif action_label and not href %}

{{ title }}

{% if action_href %}{% bw_button action_label href=action_href size="sm" variant="ghost" %}{% else %}{% bw_button action_label size="sm" variant="ghost" %}{% endif %}
{% endif %}{% endif %}{% endblock %} {% block title %}{% if title %}{% if not header_recipe or header_recipe == "none" %}{% if not action_label or href %}

{{ title }}

{% endif %}{% endif %}{% endif %}{% endblock %} {% block actions %}{% endblock %} {% block body %}{% if body %}

{{ body }}

{% endif %}{% endblock %} {% block footer %}{% if footer_recipe and footer_recipe != "none" and caption %}{% endif %}{% endblock %} {% if href %}
{% else %}
{% endif %}