The city’s buildings addressed a dual predicament: how to stay cool during the unforgiving heat, while coping with heavy seasonal rains