FAQs accordion - Change focus to the last expanded result

Hi,

a customer wants that when their experience returns results for their FAQs (we are using the standard faq accordion card, the focus always move to the expanded question. For example, if 5 results are displayed and the user displays the first one and the last one, the client wants the focus are on the last questions expanded and not stay on the first answer even if it remains open.

Any ideas?

Thanks!