:has(:hover) > :not(:hover)

Updated snippet from a great comment from Temani Afif on Bluesky.

I wrote a bit more about this here too.