@layman,
Each State devises its own rules as to how to allocate electoral votes. It's not determined on a nationwide basis.
But analysis shows that even if every state in the union had allocated its electoral votes strictly on the basis of the popular vote in that state, Trump still would have beaten Clinton in 2016. It would have been closer, but, still....
The fact that she won the popular vote "nationwide" is meaningless.