{{ $home := .Site.Home }}
{{ with $home.Params.faq }}
<section id="faq" class="py-5 bg-light">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-10 mx-auto">
                <div class="d-block pb-4 text-center">
                    <h2 class="display-3">{{ .title | default "Veelgestelde vragen" }}</h2>
                </div>
                <div class="accordion faq-accordion" id="accordionFAQ">
                    
                    {{ range $index, $element := .list }}
                    <div class="accordion-item mb-3 border-0 shadow-sm">
                        <h2 class="accordion-header">
                            <button class="accordion-button {{ if ne $index 0 }}collapsed{{ end }}" 
                                    type="button" 
                                    data-bs-toggle="collapse" 
                                    data-bs-target="#collapseFAQ{{ $index }}">
                                {{ $element.question }}
                            </button>
                        </h2>
                        <div id="collapseFAQ{{ $index }}" 
                            class="accordion-collapse collapse {{ if eq $index 0 }}show{{ end }}" 
                            data-bs-parent="#accordionFAQ">
                            <div class="accordion-body">
                                {{ $element.answer | markdownify }}
                            </div>
                        </div>
                    </div>
                    {{ end }}

                </div>
            </div>
        </div>
    </div>
</section>
{{ end }}