<section class="slice">
<div class="fluid-grid">
{% set thematics = get_thematic(slice.expertise.id) %}
{% if thematics|length > 0 %}
<div
class="row"
x-data='{
selected: {{ thematics[0].id }},
expertises: {{ thematics | json_encode | raw }},
isOpen: false,
}'
>
<div class="col-12 md-col-3 relative">
<button class="cta-arrow text-2xl text-violet p-5 rounded-lg w-full btn-select-faq" style="background-color: #F5F5F5; margin-bottom: 32px" @click="isOpen = !isOpen">
<p x-text="thematics.find(e => e.id === selected)?.title"></p>
<span class="cta-arrow__circle">
<svg width="8" height="8" class="icon--white">
<use href="#icon-arrow" xlink:href="#icon-arrow"></use>
</svg>
</span>
</button>
<div
class="p-5 rounded-lg width-fit-full absolute top-60px left-0 md:block"
style="background-color: #F5F5F5"
:class="{ 'hidden md:block': !isOpen }"
>
{% for thematic in thematics %}
<button class="cta-arrow text-2xl text-violet mt-5 first:mt-0 opacity-50" @click="selected = {{ thematic.id }}; isOpen = false;" :class="{ 'opacity-100': selected === {{ thematic.id }} }">
{{ thematic.title }}
<span class="cta-arrow__circle opacity-0" :class="{ '!opacity-100': selected === {{ thematic.id }} }">
<svg width="8" height="8" class="icon--white">
<use href="#icon-arrow" xlink:href="#icon-arrow"></use>
</svg>
</span>
</button>
{% endfor %}
</div>
</div>
<div class="col-12 md-col-9">
{% for thematic in thematics %}
<ul class="list-none" x-cloak x-show="selected === {{ thematic.id }}">
{% set questions = get_questions([thematic.id]) %}
{% for question in questions %}
{% include 'front/partials/cards/question_reponse-card.html.twig' %}
{% endfor %}
</ul>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</section>