How do you know when a pronoun is ambiguous?

It seems like I have the most trouble with ambiguous pronouns. I wrongly assume that a pronoun is ambiguous very often. Consider these three examples:

The city of Conway, Wales, now surrounds the medieval walls and castle that originally enclosed and protected (it).

True chalcedony is different from blue agate in the purity of its pale-blue color and, of the two, (is) the gemstone preferred by jewelry makers.

The essayist writing on art in America was less concerned with why funding was decreasing than with whether (it) was becoming less popular with the public.

Apparently, there is no ambiguity in the first two examples, but the “it” in the third example is, in fact, ambiguous. Why is this so? Is there a simple way I can identify whether or not a pronoun is ambiguous?

I have put the words that I think are ambiguous within parentheses.

In the second example, I thought that the “is” should have been replaced with “chalcedony is.”

1: it clearly relates back to the city. No ambiguity. "It" could not refer to the "walls and castle" -- which are the only other nouns.

2: not a pronoun question, but the "is" clearly relates back to the subject "True chalcedony". You could actually take out all the words in between and have a grammatical [albeit not a very good] sentence.

3: it can refer to "art in America" or to "funding"

There is no simple answer, BUT the farther away the pronoun is from the possible reference, the greater the risk of ambiguity. Yeah, I know that #1 is not an example of that.