Optical spectra in the condensed phase: Capturing anharmonic and vibronic features using dynamic and static approaches