Sorry to be blunt, but if you are offline for three months you are far more likely to lose your villages to other players than the barbarian horde.
After 30 days, you enter inactivity. Which is designed to be a gradual process. Though I couldn't tell you how many villages you would lose, and it would depend on your size, there is a chance you could come back to some of your villages after being inactive.