A variety of is or are?

I've been proofreading and copy editing and just analyzing English for years, but sometimes I get stuck on collective nouns. For instance, I recently saw "A variety of methods was used." That seems correct because the focus on the sentence is "a variety." Just in case, though, I did a search online, and the conflicting information is worrisome. Many articles and books have "was used," so it seems legitimate. But when I did a search for "were used," there are many articles using that as well. So what's the correct usage?

Well, if I were to use "variety" related to the articles and books I found, I would say "a variety of articles and books show" instead of "a variety of articles and books shows" because I want to emphasize the plurality of "articles and books" instead of "variety," which is singular. I guess that falls in to the "proximity agreement" concept, because I'm "relying on the noun that is closest to the verb to determine whether the verb is singular or plural."

I ended up keeping "A variety of methods was used" because I felt that the emphasis was on "variety." But if it said "A variety of methods were used," I probably would've kept that as well, because it "sounds right" and a lot of people online seem to agree. Many sources say that if it's preceded by "the," then "variety of" would be singular. But if it's "a," then it's not.

So am I wrong? I don't think so, because I still think the emphasis is on "variety," plus "of..." is a preposition, and it seems like prepositions create subsets of the main subject. But according to language nerds discussing this stuff online, I'm wrong because it's "a." And what doesn't help is that the Oxford learner dictionary seems to contradict itself; they say (ha ha, I'm breaking the grammar rule here; I should say "it says") "There is a wide variety of..." but later on they say "A plural verb is needed after a/an (large, wide, etc.) variety of...A variety of reasons were given."

I like Grammar Girl's explanation; it seems more forgiving: "Some people get tripped up when a prepositional phrase comes after a collective noun that is the subject of a sentence. For example, if you're talking about 'a large group of students,' 'group' is the collective noun and the subject of the sentence; however, it's easy to get distracted by the prepositional phrase 'of students' because it sounds plural. The thing to remember is that the verb takes its cue from the subject of the sentence--'a large group'--and not from the prepositional phrase that modifies the subject. In cases like this, just ignore the prepositional phrase 'of students' and take your cue from the real subject: 'a large group'.”

So according to GG, I'm correct. Plus American English (which I'm a native speaker of [of which I'm a native speaker]) uses the singular, while Brits use plural. And just to make sure, I asked a writing group that I sometimes meet with what they think, and all of them agree with what I did.

Thus I think I made the right decision, though I'm still struggling with "a number of," which I'll discuss in another post.