Palaeoecology of a 3-kyr biosedimentary record of a coral reef-supporting carbonate shelf