Linking continuum-scale state of wetting to pore-scale contact angles in porous media.