Update 2023-11-27: At time of writing, this idea had already been merged into the HTML standard! (albeit, not yet implemented in Firefox and Chromium):

https://html.spec.whatwg.org/multipage/interactive-elements.html#attr-details-name

The official term for this concept is "exclusive accordion".

Group 1 Item 1 Group 1 Item 1 details.
Group 1 Item 2 Group 1 Item 2 details.

Group 2 Item 1 Group 2 Item 1 details.
Group 2 Item 2 Group 2 Item 2 details.

Ungrouped Item 1 Ungrouped Item 1 details.
Ungrouped Item 2 Ungrouped Item 2 details.