As a partial answer, but I hope a useful one, details
elements can be 'grouped' by giving them the same name
attribute value. When we do that, only one of the grouped elements is allowed to be open. So opening a new one will close the previously opened one.