In reply to a tweet by @eevee:
@eevee eventually :has() will help you here, but offhand i don't think anyone's implemented it (sorry!)