Ab initio condensed-phase photochemistry