{#
/**
 * The paragraph preview view mode is used in the node teaser view mode.
 *
 * @see agaric/templates/paragraph/paragraph--title.html.twig for variables.
 */
#}
{%
  set classes = [
    'hero',
    not paragraph.isPublished() ? 'paragraph--unpublished'
  ]
%}
{% if paragraph.field_style_color is not empty %}
  {% set classes = classes|merge(['is-'~paragraph.field_style_color.value]) %}
{% endif %}
{% if paragraph.field_style_titlebar.value == false %}
  {% set classes = classes|merge(['hero-project']) %}
{% endif %}
{% if paragraph.field_style_classes is not empty %}
  {% set styles=[] %}
  {% for style in paragraph.field_style_classes %}
    {% set styles = styles|merge([style.value]) %}
  {% endfor %}
  {% set classes = classes|merge(styles) %}
{% endif %}

{% if paragraph.field_style_titlebar.value == true and paragraph.field_image is not empty %}
  {% set attributes = attributes.setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image: url('~file_url(paragraph.field_image.entity.uri.value)~')') %}
{% endif %}

{% block paragraph %}
    {% block content %}
      {{ content.field_image }}
      <p class="byline is-mono">{{ content.field_subtitle }}</p>
    {% endblock %}
{% endblock paragraph %}
