However, there is now that remaining unhybridized p orbital of
nitrogen, which has 2 electrons, so how can it be involved in π
bonding?
Everything is more-or-less "right" up to these point. The thing you're missing is that there is only one electron in the unhybridized $\mathrm{p}$ orbital of $\ce{N}$ atom since to get the following usual configuration of $\ce{NO3-}$ ion (image courtesy of Wikipedia)
with two negatively charged $\ce{O-}$ ions one electron has to be moved from $\ce{N}$ atom to $\ce{O}$ atom first. Now note that since all $\ce{O}$ atom are equivalent to each other we need to invoke the concept of the resonance, but for simplicity think first about any single of the resonance structure above.
So, formally we start by having:
- one $\ce{N}$ atom with $\mathrm{(1s)^2 (2s)^2 (2p)^3}$ electron configuration;
- two $\ce{O}$ atoms with $\mathrm{(1s)^2 (2s)^2 (2p)^4}$ electron configuration;
- and one $\ce{O-}$ ion with $\mathrm{(1s)^2 (2s)^2 (2p)^5}$ electron configuration;
In the first step we transfer one of the $p$-electrons from $\ce{N}$ atom to an $\ce{O}$ atom, so we end up with:
- one $\ce{N+}$ ion with $\mathrm{(1s)^2 (2s)^2 (2p)^2}$ electron configuration;
- one $\ce{O}$ atom with $\mathrm{(1s)^2 (2s)^2 (2p)^4}$ electron configuration;
- and two $\ce{O-}$ ions with $\mathrm{(1s)^2 (2s)^2 (2p)^5}$ electron configuration;
At the next step we invoke the $\mathrm{sp^2}$ hybridization of $\ce{N+}$ ion, so that we get:
- one $\mathrm{sp^2}$-hybridized $\ce{N+}$ ion with $\mathrm{(1s)^2 (sp^2)^3 (2p)^1}$ electron configuration;
- one $\ce{O}$ atom with $\mathrm{(1s)^2 (2s)^2 (2p)^4}$ electron configuration;
- and two $\ce{O-}$ ions with $\mathrm{(1s)^2 (2s)^2 (2p)^5}$ electron configuration;
Finally, we form bonds as follows:
- One $\sigma$ bond between the $\mathrm{sp^2}$-hybridized $\ce{N+}$ ion and an $\ce{O-}$ ion in forming which we use 1 of the total 3 $\mathrm{sp^2}$-electrons of $\ce{N+}$ ion and the only unpaired $\mathrm{2p}$-electron of $\ce{O-}$ ion;
- Another identical $\sigma$ bond between the $\mathrm{sp^2}$-hybridized $\ce{N+}$ and another $\ce{O-}$ ion; here we use 1 of the remaining 2 $\mathrm{sp^2}$-electrons of $\ce{N+}$ ion and the only unpaired $\mathrm{2p}$-electron of $\ce{O-}$ ion;
- Yet another $\sigma$ bond, but this time between the $\mathrm{sp^2}$-hybridized $\ce{N+}$ ion and the $\ce{O}$ atom in forming which we use the last remaining $\mathrm{sp^2}$-electron of $\ce{N+}$ ion and 1 out of total 2 unpaired $\mathrm{2p}$-electrons of $\ce{O-}$ ion;
- What remains now is one unhybridized $\mathrm{2p}$-electrons of $\ce{N+}$ ion and one unpaired $\mathrm{2p}$-electrons of $\ce{O-}$ ion which are used to form the $\pi$ bond.
Pictorially (image courtesy of Professor Peter Bird):