{# Parameters:
  - title: (string) (default: '')
  - title_tag: (string) (default: 'div')
  - title_link: (link object) (default: {})
  - title_attributes (drupal attrs)
  - description: (string) (default: '')
  - link: (link object) (default: {})
  - image: (string) <img> tag
  - copyright: (string) (default: '')
  - copyright_label: (string) (default: '')
  - shade: (boolean) (default: false)
  - hero: (boolean) (default: false)
  - full_width: (boolean) (default: false)
  - fixed_height: (boolean) (default: false)
  - content_classes: (string) (default: '')
  - attributes (drupal attrs)
#}

{%- set _title = title|default('') %}
{% set _title_tag = title_tag|default('div') %}
{% set _title_link = title_link|default({}) %}
{% set _title_attributes = title_attributes ?: create_attribute() %}
{% set _description = description|default('') %}
{% set _link = link|default({}) %}
{% set _image = image|default('') %}
{% set _copyright = copyright|default('') %}
{% set _copyright_label = copyright_label|default('') %}
{% set _shade = shade ?? false %}
{% set _hero = hero ?? false %}
{% set _full_width = full_width ?? false %}
{% set _fixed_height = fixed_height ?? false %}
{% set _content_classes = content_classes|default('') %}

{%- set _content_class = 'bcl-banner__content' %}
{% if _content_classes is not empty %}
  {%- set _content_class = _content_class ~ " " ~ _content_classes %}
{% endif %}

{%- set _title_classes = ['display-6'] %}
{% if _description is not empty or _link is not empty %}
  {%- set _title_classes = _title_classes|merge(['mb-3']) %}
{% endif %}

{%- set _title_attributes = _title_attributes.addClass(_title_classes) %}

{%- set _classes = ['bcl-banner'] %}

{%- if _shade %}
  {%- set _classes = _classes|merge(['shade']) %}
{% endif %}

{%- if _image and not _shade %}
  {%- set _classes = _classes|merge(['overlay']) %}
{% endif %}

{%- if _hero %}
  {%- set _classes = _classes|merge(['hero']) %}
{% endif %}

{%- if _full_width %}
  {%- set _classes = _classes|merge(['full-width']) %}
{% endif %}

{%- if _fixed_height %}
  {%- set _classes = _classes|merge(['fixed-height']) %}
{% endif %}

{%- if attributes is empty %}
  {%- set attributes = create_attribute() %}
{% endif %}

{%- set attributes = attributes.addClass(_classes) -%}

<div {{ attributes }}>
  {%- if _image is not empty -%}
    <div class="bcl-banner__image" style="background-image:url({{ _image }})"></div>
  {%- endif -%}
  <div class="container">{# -#}
    <div class="{{ _content_class }}">
      {%- if _title is not empty %}
        {%- include '@oe-bcl/bcl-heading/heading.html.twig' with {
          title: _title,
          title_tag: _title_tag,
          title_link: _title_link,
          attributes: _title_attributes,
        } only %}
      {%- endif %}
    {%- if _description is not empty -%}
      <p class="mb-4">{{ _description }}</p>
    {%- endif %}
    {%- if _link.path %}
      {%- include '@oe-bcl/bcl-link/link.html.twig' with _link only %}
    {%- endif -%}
    </div>{# -#}
  </div>{# -#}
</div>
  {%- if _copyright is not empty -%}
    <div class="bcl-copyright">
      {%- if _copyright_label is not empty -%}
        <span class="visually-hidden">{{- _copyright_label }} </span>
      {%- endif -%}
      {{- _copyright -}}
    </div>
  {%- endif -%}
{#--#}
