{#
/**
 * @file
 * Dark+'s theme override for the block entity refernece field for the tabs powered custom block
 *
 * @see darkplus_preprocess_field__block_content__mt_fancy_tabs_block()
 */
#}
{%
  set classes = [
    'field',
    'field--name-' ~ field_name|clean_class,
    'field--type-' ~ field_type|clean_class,
    'field--label-' ~ label_display,
    'field--entity-reference-target-type-' ~ entity_reference_target_type|clean_class,
    'field--mt-tabs',
    'clearfix',
  ]
%}
{%
  set title_classes = [
    'field__label',
    label_display == 'inline' ? 'inline',
  ]
%}
<div{{ attributes.addClass(classes) }}>
  {% if not label_hidden %}
    <h3{{ title_attributes.addClass(title_classes) }}>{{ label }}</h3>
  {% endif %}
  <ul class="nav nav-tabs nav-tabs--fancy nav-justified">
    {% for item in items %}
      <li class="nav-item">
        <a class="nav-link mt-style-custom-all {{ loop.first ? ' active' : '' }}" href="#block-id-{{item.block_data.id}}" data-toggle="tab">
          <span class="nav-tab__title">
            {{ item.content['#paragraph'].get('field_mt_fancy_title').value }}
          </span>
          {% if item.content['#paragraph'].get('field_mt_fancy_subtitle').value %}
            <span class="nav-tab__subtitle">
              {{ item.content['#paragraph'].get('field_mt_fancy_subtitle').value }}
            </span>
          {% endif %}
        </a>
      </li>
    {% endfor %}
  </ul>
  <div class="tab-content">
    {% for item in items %}
      <div class="tab-pane fade {{ loop.first ? ' active show' : '' }}" id="block-id-{{item.block_data.id}}">{{ item.content }}</div>
    {% endfor %}
  </div>
</div>
