Landmark ruling on detention laws