  Diffractive nonlocal metasurfaces have recently opened a broad range of
exciting developments in nanophotonics research and applications, leveraging
spatially extended (yet locally patterned) resonant modes to control light with
new degrees of freedom. While conventional grating responses are elegantly
captured by temporal coupled mode theory (TCMT), TCMT is not well equipped to
capture the more sophisticated responses observed in the nascent field of
nonlocal metasurfaces. Here, we introduce spatio-temporal coupled mode theory
(STCMT), capable of elegantly capturing the key features of the resonant
response of wavefront-shaping nonlocal metasurfaces. This framework can
quantitatively guide nonlocal metasurface design, and is compatible with local
metasurface frameworks, making it a powerful tool to rationally design and
optimize a broad class of ultrathin optical components. We validate this STCMT
framework against full-wave simulations of various nonlocal metasurfaces,
demonstrating that this tool offers a powerful semi-analytical framework to
understand and model the physics and functionality of these devices, without
the need for computationally intense full-wave simulations. We also discuss how
this model may shed physical insights into nonlocal phenomena in photonics and
into the functionality of the resulting devices. As a relevant example, we
showcase STCMT's flexibility by applying it to study and rapidly prototype
nonlocal metasurfaces that spatially shape thermal emission.
