{#
/**
 * @file
 * Theme override to display a media item.
 *
 * Available variables:
 * - media: The media item, with limited access to object properties and
 *   methods.
 * - name: Name of the media.
 * - content: Media content.
 *
 * @see template_preprocess_media()
 *
 * @ingroup themeable
 */
#}
{%
  set media_classes = [
    'media',
    'media--type-' ~ media.bundle()|clean_class,
    not media.isPublished() ? 'media--unpublished',
    view_mode ? 'media--view-mode-' ~ view_mode|clean_class,
  ]|merge(utility_classes ? utility_classes : [])
%}

<{{media_element|default('div')}}{{ attributes.addClass(media_classes) }}>
  {{ title_suffix.contextual_links }}

  {% block content %}
    {% if content %}
      {{ content }}
    {% endif %}
  {% endblock %}
</{{media_element|default('div')}}>
{% if libraries %}
  {% for library in libraries %}
    {{ attach_library(library) }}
  {% endfor %}
{% endif %}