Engineering the Electromagnetic Properties of Periodic Nanostructures Using Electrostatic Resonances