Variable detours in long-distance migration across ecological barriers and their relation to habitat availability at ground