A comprehensive introduction to sub-Riemannian geometry