I didn’t test this but won’t the focus-within trick work for click menus too? The user clicks the button (which must be a child of the container) so focus moves within the container and hence the submenu can show.
nav:focus-within > .submenu {display:block}
(Edit: oh it’s mentioned in the article briefly without much explication of the need for js)