UN’s top court says failing to protect planet from climate change could violate international law