{# LIBRARIES #}
{% extends "@molecules/tm-cards/plain-card/plain-card.twig" %}

{# VARIABLES #}
{% set card_class = "background-img-card mb-4" %}
{% set link_scope = "top" %}
{% set content_class = 'cbelianr' %}
{% set show_footer = false %}
{% set show_top_text = show_top_text|default(false) %}
{% set top_text = top_text|default('') %}
{% set top_text_icon = top_text_icon|default('') %}

{% if wide_image %}
  {% set card_class = card_class ~ ' wide-image' %}
{% endif %}

{# BLOCKS #}
{% block card_header %}
  {% if show_top_text and top_text %}
    {% include "@atoms/tm-links/icon-bookended/icon-bookended.twig" with {
      "text": top_text,
      "icon_left": top_text_icon,
      "class": "top-left-text",
      "tag_name": "h3"
    } only %}
  {% endif %}

  {{ parent() }}

{% endblock %}

{% block card_body %}

  {{ attach_library('ui_patterns/background_img_card.background_img_card_lib') }}

  {% if body %}
    <div class="card-body-text">
      {{ body }}
    </div>
  {% endif %}

  <hr>

  {% if title %}
    {% include "@atoms/tm-links/icon-bookended/icon-bookended.twig" with {
      "text": title,
      "icon_right": global_icon_right|default('fas fa-chevron-right'),
      "class": "subtitle",
      "tag_name": "h3"
    } only %}
  {% endif %}

{% endblock %}

{% block card_footer %}
  {% if date %}
    <span class="card-date">{{ date }}</span>
  {% endif %}
  {% if tags %}
    {% include "@molecules/tm-cards/card-partials/tags.html.twig" %}
  {% endif %}
{% endblock %}
