Mass loss from inhomogeneous hot star winds III. An effective-opacity formalism for line radiative transfer in accelerating, clumped two-component media, and first results on theory and diagnostics