John Lewis reported a decline in first-half profit amid "continuing challenging trading conditions," but has accelerated investments in its future growth.