Excitation of plasmonic and photonic modes in metallic lamellar gratings