<div class="basepack-card--wrapper castorcito-basepack--item">
  <div class="castorcito-basepack--inner">
    <div class="basepack-card--item {{ component_data.fields.image_alignment.value  }}">
        <div class="basepack-card--item--info">
        {% if component_data.fields.title.value is not empty %}
          <div class="basepack-card--item--title-container">
          <h3 class="basepack-card--item--title">{{ component_data.fields.title.value }}</h3>
          </div>
        {% endif %}
        {% if component_data.fields.subtitle.value is not empty %}
          <h4 class="basepack-card--item--subtitle">{{ component_data.fields.subtitle.value }}</h4>
        {% endif %}
        {% if component_data.fields.description.value is not empty  %}
          <div class="basepack-card--item--description">
            {% embed "castorcito:castorcito_formatted_text" with {
              cfield_data: component_data.fields.description
            } %}
            {% endembed %}
          </div>
        {% endif %}
        {% if component_data.fields.link.value is not empty %}
        <div class="basepack-card--item--link-wrapper">
          <a class="basepack-card--item--link"
            href="{{ component_data.fields.link.external
                    ? component_data.fields.link.value
                    : drupal_url(component_data.fields.link.relative) }}"
            {{ component_data.fields.link.target ? 'target=' ~ component_data.fields.link.target }}>
            {{ component_data.fields.link.text }}
          </a>
        </div>
        {% endif %}
        </div>
        <div class="basepack-card--item--media">
          <div class="basepack-card--item--image">
          {% if display_settings.display_options.convert_image_link %}
            {% if component_data.fields.link.value is not empty %}
              <a class="basepack-card--item--link" 
                aria-label="{{ component_data.fields.link.text }}"
                href="{{ component_data.fields.link.external
                        ? component_data.fields.link.value
                        : drupal_url(component_data.fields.link.relative) }}"
                {{ component_data.fields.link.target ? 'target=' ~ component_data.fields.link.target }}>
            {% endif %}
          {% endif %}

            {% embed "castorcito:castorcito_image" with {
              cfield_data: component_data.fields.image,
              cfield_display_settings: display_settings.cfields.image
            } %}
            {% endembed %}

          {% if display_settings.display_options.convert_image_link %}
            {% if component_data.fields.link.value is not empty %}
              </a>
            {% endif %}
          {% endif %}
          </div>
        </div>
    </div>
  </div>
</div>
