Pictures of the top of the stairs: https://www.imgur.com/a/YFZU1Pt
I've read that you aren't supposed to have the gate over the edge of the top step, but unfortunately we don't have much wall on the one side to operate with. Also I know you are supposed to attach them to a stud but the stud here is next to the light switch which is close to the edge of the top stair.
Does anyone have any recommendations for a type of baby gate or how I should mount it here for safety?


