These function as adjectives and adverbs, respectively. Note that the entire phrase functions as though it were as single adjective or adverb, respectively. Examples:
"They are doing an in depth study on the effects of sunlight on health." (Here the prep. phrase "in depth" functions as an adj. modifying the noun "study." It's as though you were saying: "...doing a deep study on the e