This country has a long line of female rulers going back since its inception. Due to a divine connection with the goddess, only queens can inherit the throne, and rules as both leader of the nation and the country's religion. As head of the faith, she rules with "absolute authority". However, this does not translate into political power. She does not rule directly, but elects a regent to rule in her stead. He handles governmental affairs, enforcing the law, etc. While the queen is the reigning monarch, her powers are limited to religious and cultural affairs. Men are still considered the breadwinners in society, and dominate in all matters that run the country.
To my knowledge, most gods start off as feminine dieties in civilizations. When males eventually come to power, which is usually assumed to be a result of male hunters "unionizing" against the usually female gatherers, the new masculine gods are created to legitimize their authority. Logically, a regent would realize that he has real authority and power, and can size the throne with the military. Then he can install himself as ruler with all the divine right that comes with it, creating a tradition of the "Divine right of kings". Men would control both society and religion.
What would prevent this from happening?