Rayleigh–Bloch surface waves along periodic gratings and their connection with trapped modes in waveguides | Synapse