Polysilsesquioxane derived ceramic foams with gradient porosity