Exclusive electroproduction of [Formula: see text] mesons on unpolarized hydrogen and deuterium targets is studied at HERMES in the kinematic region of [Formula: see text], [Formula: see text], and [Formula: see text]. The data were accumulated during the 1996-2007 running period using the [Formula: see text] longitudinally polarized electron or positron beams at HERA. The determination of the virtual-photon longitudinal-to-transverse cross-section ratio shows that a considerable part of the cross section arises from transversely polarized photons. Spin density matrix elements are derived and presented in projections of [Formula: see text] or [Formula: see text]. Violation of s-channel helicity conservation is observed for some of these elements. A sizable contribution from unnatural-parity-exchange amplitudes is found and the phase shift between those amplitudes that describe transverse [Formula: see text] production by longitudinal and transverse virtual photons is determined for the first time. Good agreement is found between the HERMES proton data and results of a pQCD-inspired phenomenological model that includes pion-pole contributions.