{# See agaric/templates/layout/node--teaser.html.twig for variables. #}

<a class="teaser media content" href="{{ url }}">

<div class="media-left">

{% set has_title_paragraph = false %}
{% if content.field_body_paragraph %}
  {% for i, paragraph in content.field_body_paragraph %}
    {% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
      {% set has_title_paragraph = true %}
      {{ paragraph }}
    {% endif %}
  {% endfor %}
{% endif %}

{% if not has_title_paragraph %}
  {{ content.field_image }}
  {% if node.bundle == 'case_study' and content.field_case_study_subtitle is not empty %}
    <p class="byline is-mono">
      {{ content.field_case_study_subtitle }}
    </p>
  {% endif %}
{% endif %}
</div>
<div class="media-content content">
  <h3 class="title is-5">{{ label }}</h3>
  <div class="subtitle is-6">
    {{ content.field_summary }}
  </div>
</div>

</a>
<!-- Unexpected extra content -->
{{ content|without('field_body_paragraph', 'field_case_study_subtitle', 'field_image', 'field_summary', 'uid', 'created') }}
