have trouble understanding the structure of a complicated sentence.
i come across a complicated sentence, which is:
"Der Wein wächst in Deutschland vor allem dort, wo er vor Wind und Wetter geschützten Hang gedeihen kann."
I am able to guess the meaning of the sentence but i have problem understand the structure and grammar knowledge of the second part of the sentence. I know the use of "...dort, wo...", but what das "er" mean in this sentence?
And how to understand the structure of "wo er vor Wind und Wetter geschützten Hang geheihen kann" ？ (i know the meaning of each single word)
thanks in advance.