{#
  Template for UnLondon FAQs.

  An accordion group of FAQS.

  faqs: array of FAQs, each FAQ is an array:
    question: The quesiton.
    answer: The answer.
  coloured_bg: whether the block has a coloured background, boolean.
  flush: whether this block should be flush to the one below it, boolean.
#}

{# EXTENDS #}
{% extends "@organisms/tm-ul/ul-base/ul-base.twig" %}

{% set items = [] %}
{% set centred=centred|default(false) %}
{% set title=title|default('FAQs') %}

{% for faq in faqs %}
  {% set items = items|merge([{
    'pid': 'ul-faqs',
    'aiid': 'faq-' ~ loop.index,
    'label': faq.question,
    'content': faq.answer,
  }]) %}
{% endfor %}

{% block content_block %}
  {{ attach_library('ui_patterns/ul_faqs.ul_faqs_lib') }}

  <div class="col col-lg-8 ul-faqs{% if centred %} ul-c{% endif %}">
    <h2 class="ul-title">{{ title }}</h2>
    {% include '@organisms/tm-bs/accordion/_accordion_items.twig' with {
      'items': items,
      'pid': 'ul-faqs',
      'toggle': 'sign',
      'child_variant': 'aci_a',
      'wrapper_class': 'acw-a',
      'style': 'combined',
    } only %}
  </div>
{% endblock %}
