How does the original ionic distribution restore after synaptic transmission
Most of the depolarization in the presynaptic terminal is still sodium-based, it's just that there are also calcium channels there. Very little calcium actually moves, as these channels are closely coupled to the synaptic release machinery (see for example Stanley 1993 Single calcium channels and acetylcholine release at a presynaptic nerve terminal).
The calcium concentration gradient has to be established everywhere in cells that have this gradient (all animal cells, as far as I know), not just at a synapse, since calcium is typically a powerful &quot;second-messenger&quot; signal.
The two common mechanisms for transport are by using the gradient of sodium via calcium antiporters (this mechanism: using sodium or proton gradients to move other ions/molecules, is quite ubiquitous in biology), and via a calcium ATPase. Calcium transport involves both the external space and intracellular calcium stores such as within the endoplasmic/sarcoplasmic reticulum.
In the short term, calcium concentrations are also dealt with via chelation by calcium-binding proteins.