Detention of an Afghan at Guantánamo Bay ruled illegal