I learned that in the past it was acceptable to use "for" to mean "because", but I also learned that it's not acceptable anymore. When I need to write some texts in English, I often type them in Google Translator in my mother language and then I just check for any grammatical errors (because I'm lazy sometimes). Google often uses "for" as in the following sentence:
His eyes widened and he was speechless, for he was sure that the darkness in the room was an absence of physical light, when in actuality it was due to the absence of spiritual light.
The above example was taken from a 2009 book and the author is young.
I like to use "for" in this way to be honest but I'm afraid it's something archaic. But if it's archaic I don't know why many books have "for" used in this way and why Google Translator keeps giving me it instead of "because".