:has is OP
Also, today I learned about :focus-within, which enables a drop-down menu that works on mobile and can be keyboard selected, in four lines. What the fuck

(e.g. html is 'menu-parent' with 'menu' and 'menu-button' as children)

#menu {
display: none;
}

#menu-parent:focus-within #menu {
display: block;
}

When you click 'menu-button', 'menu' appears. And it fits in a Mastodon post. Awesome