Theory of thermal motion in electromagnetically induced transparency: Effects of diffusion, Doppler broadening, and Dicke and Ramsey narrowing