Attitude stability of articulated gravity-oriented satellites. Part I. General theory, and motion in orbital plane