Photon confinement effects — from physics to applications