Singular modes of the electromagnetic field