{#
/**
 * @file
 * Theme implementation to display a paragraph.
 */
#}
{% block attributes %}
  {% set classes = [
    'c-paragraph',
    'c-paragraph--type-' ~ paragraph.bundle|clean_class,
    view_mode ? 'c-paragraph--view-mode-' ~ view_mode|clean_class,
    not paragraph.isPublished() ? 'is-unpublished',
  ] %}
{% endblock %}

{% set paragraph_modifier_classes %}
  {%- block modifier_classes -%}
  {%- endblock -%}
{% endset %}

{% set paragraph_constrain_modifier_classes %}
  {%- block constrain_modifier_classes -%}
  {%- endblock -%}
{% endset %}

{% set paragraph_has_constrain %}
  {%- block has_constrain -%}
    {{ true }}
  {%- endblock -%}
{% endset %}

{% set paragraph_title %}
  {%- block paragraph_title -%}
  {%- endblock -%}
{% endset %}

{% set paragraph_title_element %}
  {%- block paragraph_title_element -%}
    h2
  {%- endblock -%}
{% endset %}

{% set paragraph_content %}
  {%- block paragraph_content -%}
    {{ content }}
  {%- endblock -%}
{% endset %}

{% embed '@layouts/section/section.twig' with {
  'attributes': attributes.addClass(classes),
  'modifier_classes': paragraph_modifier_classes,
  'constrain_modifier_classes': paragraph_constrain_modifier_classes,
  'has_constrain': paragraph_has_constrain,
  'section_title': paragraph_title,
  'section_title_element': paragraph_title_element,
} %}

  {% block content %}
    {{ paragraph_content }}
  {% endblock %}

{% endembed %}
