What variety of Arabic would most historical sources have been written in after the decline of Classical Arabic but before the modern era?

by Lion_And_Sun

Are our surviving Arabic texts after the 9th century still written in Classical Arabic, in a local vernacular, or something else? I'm particularly curious about the type that would have been used in the religious texts of Safavid Iran, my main area of interest, as most religious writings there were still in Arabic until the late 17th century.

Kiviimar

Cool, this question is totally my area.
I'm not sure why you think Classical Arabic declined after the 9th century. In fact, the 9th century was the period in which the first real grammars of Classical Arabic were being produced; Sibuwayh himself only died right at the end of the 8th century, and that's pretty much the first grammar we have of Arabic. Classical Arabic was more or less continuously in use by Muslim scholars, both from within the Arabic world as outside until the Nahda period, i.e. the 18th century, until it was more-or-less replaced by Modern Standard Arabic. In any case, when you look at the history of Classical Arabic literature, it's obvious that more-or-less the same standard was used up until the beginning of the 18th century; al-Mas‘ūdi (9th century), Yaqūt al-Rūmī (13th century), and al-Umawi (15th century) all pretty much write in the same kind of language. In other words, this decline never really took place.
That being said, there is a corpus of texts written in a form of Arabic that is neither dialectal nor Classical, and which is usually called Middle-Arabic. A sizeable amount of texts, some of which were produced by authors otherwise fluent in Classical Arabic, are written in this kind of register and reflect a somewhat simplified form of Classical Arabic with a fair amount of substratal influence, both from the Arabic dialects as well as from neighbouring languages. We're still trying to figure out what the nature of these texts is, exactly, but it's apparent they do possess some kind of standard. Bear in mind that the majority of these texts can be classified as popular literature, so it would be extremely unlikely you would find texts of a religious nature amongst them.
To answer your question: the kind of writing you refer to, if written in Arabic, would definitely be Classical Arabic and would attempt to at least reproduce the standard used by earlier Muslim writers.

Sources

Blau, J. (2002) A Handbook of Early Middle Arabic
Lentin, J. (2012) "Normes orthographiques en arabe moyen"
Versteegh, K. (2014) History of the Arabic Language