legal fees foreclosure
Are legal fees tax deductible except if you were able to restore the mortgage?

They are deductible only if it was owned businesses. If it's your residence, then the fees are not deductible.