A reduced scalar magnetohydrodynamic (MHD) description for linear perturbations of arbitrary aspect-ratio, fully three-dimensional plasma configurations is derived for perturbations with short scale-length perpendicular to the magnetic field. The application of the scalar wave equation to ballooning modes is presented. It is shown that coexistence of toroidally extended and toroidally localized unstable ideal hydromagnetic ballooning modes occurs in an interchange-unstable equilibrium case modelling the Large Helical Device (LHD) with a broad pressure profile. The toroidally extended modes can be understood on the basis of a ripple-averaged ballooning equation, whereas the toroidally localized branch corresponds to modes localized along a flux tube. A new three-dimensional ray phase space is introduced in which the periodicity properties are simplified.