  We discuss the propagation of an electromagnetic field in an inhomogeneously
anisotropic material where the optic axis is rotated in the transverse plane
but is invariant along the propagation direction. In such a configuration, the
evolution of an electromagnetic wavepacket is governed by the
Pancharatnam-Berry phase (PBP), responsible for the appearance of an effective
photonic potential. In a recent paper [A. Alberucci et al., "Electromagnetic
confinement via spin-orbit interaction in anisotropic dielectrics", ACS
Photonics \textbf{3}, 2249 (2016)] we demonstrated that the effective potential
supports transverse confinement. Here we find the profile of the quasi-modes
and show that the photonic potential arises from the Kapitza effect of light.
The theoretical results are confirmed by numerical simulations, accounting for
the medium birefringence. Finally, we analyze in detail a configuration able to
support non-leaky guided modes.
