Valence excitons and inner-shell excitons in gaseous and solid argon