The world may lose almost half of its sandy beaches by the end of the century if climate change isn’t kept in check.