Historic building total loss after overnight blaze