The native details/summary element provides expand/collapse behavior without any custom JavaScript, and the container here also has the class "details" to match the requirement.
Note: styling and keyboard behavior are provided by the browser. This example demonstrates the simpler option.