  Neutral hydrogen intensity mapping can in principle deliver rapid and
large-volume cosmological surveys with exquisitely accurate redshifts that are
determined directly from imaging. However, intensity maps suffer from very
strong foreground contamination. Future surveys will require efficient data
pipelines to remove the foregrounds and reveal the cosmological signal. It is
expected that this cleaning will not remove the signal in substantial parts of
the available Fourier space and that significant loss of signal due to
imperfect cleaning will be confined to specific regions of Fourier space. This
suggests a strategy which is useful for simplified estimates and rapid
computations -- i.e., to apply foreground filters that avoid the regions where
loss of signal is significant. The standard Fourier-space power spectrum and
foreground filters use a flat-sky approximation and thus exclude wide-angle
correlations. We provide a new geometrical formulation of foreground filters in
harmonic space, which naturally includes all wide-angle effects in the power
spectrum. Foreground filtering leads to a loss of isotropy in Fourier space. In
harmonic space this produces off-diagonal correlations. We derive analytical
expressions for the generalised HI power spectrum and its cross-power with CMB
lensing, for both single-dish and interferometer mode surveys. We show
numerically that the off-diagonal contributions are negligible for the auto
power. In the cross power, there is a non-negligible off-diagonal contribution,
but only for a small interval of the largest available scales. For auto and
cross power, the signal loss due to foreground avoidance decreases with
increasing multipole (i.e. smaller scales), and the loss in interferometer mode
is equal to, or slightly greater than, in single-dish mode. We find that the
cross power in single-dish mode vanishes below a critical multipole, ...
