Small-world and ultrasmall-world phenomena in kernel-based spatial random graphs