Simply add a name attribute with the same value to all participating <details> elements and you're all set ... it's _that_ easy! š¤©
Learn all about it here: https://developer.chrome.com/docs/css-ui/exclusive-accordion
I've also included a small polyfill for older browsers in the post.
https://mas.to/@patrickbrosset/113090391253303510