Stock market today: Indexes cap stellar first half of 2024 with losses even after encouraging inflation report