{%
  set classes = [
    'banner',
    'banner--primary',
    'paragraph',
    'paragraph--type--' ~ paragraph.bundle|clean_class,
    view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class,
    not paragraph.isPublished() ? 'paragraph--unpublished'
  ]
%}

{% if not localgov_base_remove_css %}
  {{ attach_library('localgov_base/banner') }}
{% endif %}

{% if paragraph.localgov_url.value %}
  {% set banner_url = paragraph.localgov_url.value %}
{% endif %}

<div{{ attributes.addClass(classes) }}>
  {% if paragraph.localgov_image.value %}
    <div class="banner__image">
      {{ content.localgov_image }}
    </div>
  {% endif %}
  <div class="banner__content">
    {% if banner_url %}
      <a class="banner__link" href="{{ banner_url }}">
    {% endif %}
      {{ content.localgov_title }}
    {% if banner_url %}
      </a>
    {% endif %}

    {{ content|without('localgov_title', 'localgov_image', 'localgov_url') }}

  </div>
</div>