How to design a structure that allows this door to move like this

Can anyone give me some advice? I'm currently working on this challenge. The difficulty lies in the fact that the door needs to move downward first before it can move upward. Is it possible to achieve this motion in one stroke using a cylinder? Thank you so much!