{#
/**
 * @file
 * Template for a Bootstrap 5 Blockquote.
 *
 * Available variables:
 * - attributes: HTML attributes for the <figure> wrapper.
 * - text: The main quote text content. Required.
 * - footer: Attribution text shown in the footer.
 * - cite: Citation source URL or reference for the quote.
 * - alignment: Horizontal alignment class (text-start, text-center, text-end).
 * - italic: (boolean) Display the blockquote text in italic style.
 * - opacity: Bootstrap opacity utility class (opacity-25, opacity-50, etc.).
 * - text_color: Bootstrap text color utility class.
 * - blockquote_class: Additional CSS classes for the <blockquote> element.
 * - footer_class: Additional CSS classes for the <figcaption> element.
 * - custom_class: Additional CSS classes for the <figure> wrapper.
 *
 * @ingroup themeable
 */
#}

{% set figure_classes = [
  alignment|default('text-start'),
  custom_class|default(''),
]|filter(v => v) %}

{% set blockquote_classes = [
  'blockquote',
  italic|default(false) ? 'fst-italic' : '',
  opacity and opacity != 'none' ? opacity : '',
  text_color and text_color != 'none' ? text_color : '',
  blockquote_class|default(''),
]|filter(v => v) %}

<figure{{ attributes.addClass(figure_classes) }}>
  <blockquote class="{{ blockquote_classes|join(' ') }}">
    <p>{{ text }}</p>
  </blockquote>

  {% if footer or cite %}
    <figcaption class="{{ ['blockquote-footer', footer_class|default('')]|filter(v => v)|join(' ') }}">
      {{ footer }}
      {% if cite %}
        <cite title="{{ cite }}">{{ cite }}</cite>
      {% endif %}
    </figcaption>
  {% endif %}
</figure>

