Terpyridine-based smart organic–inorganic hybrid gel as potential dye-adsorbing agent for water purification