Most turbulent flows appearing in nature (e.g. geophysical and astrophysical flows) are subjected to strong rotation and stratification. These effects break the symmetries of classical, homogenous isotropic turbulence. In doing so, they introduce a natural decomposition of phase space in terms of wave modes and potential vorticity modes. The appearance of a new time scale, associated with the propagation of waves, hinders the understanding of energy transfers across scales. For instance, it is difficult to predict a priori whether the energy cascades downscale as in homogeneous isotropic turbulence or upscale as expected from balanced dynamics. In this paper, we suggest a theoretical approach based on equilibrium statistical mechanics for the ideal system, inspired by the restricted partition function formalism introduced in metastability studies. We focus on the qualitative features of the inviscid system, taking into account either all the modes or just the slow modes. Specifically, we show that at absolute equilibrium, i.e. when all the modes are considered, no negative temperature states exist, and the isotropic energy spectrum is close to equipartition. By contrast, when the statistics is restricted to the contributions of the slow modes, we find that in the presence of rotation, there exists a regime of negative temperature featuring an infrared divergence in both the isotropic and the axisymmetric average energy spectrum, characteristic of an inverse cascade regime. Such regimes are not allowed for purely stratified flows, even in the restricted ensemble, because the slow manifold then partitions into modes that carry potential vorticity on the one hand, and hydrostatically balanced but vorticity-free modes, the so-called vertical shear horizontal flows, on the other hand, which forbid the appearance of negative temperatures.