The resilience of coral reefs in an era of climate change