Ideal MHD ballooning stability in the vicinity of a separatrix