It has to come within range of certain systems, but it doesn't have to loiter within range of every Tom, Dick & Harry on shore with a light howitzer, mortar, tank, ATGW (imagine them being within range of your helicopters sitting on the deck). The RN is quite clear that LPDs & the like are meant to stand offshore until a beachhead is secured. Bringing them in too close doesn't only risk the ship, but all the supplies on it, which those troops ashore will need, plus the helicopters which the LHD carries, the medical facilities, communications, etc. - all valuable to the troops onshore. And I don't see how cramming the deck with vehicles will maximise its ability to support the troops on-shore. The flat deck is for helicopters: parking tanks on it compromises its main purpose. Carrying a few armed choppers would probably be a better way to use some of that limited deck space for fire support. They can continue to support the troops as they move inland.
And see my previous post for a superior (IMO) indirect fire solution, which can get much closer inshore (even up rivers, into lagoons, etc), so providing better, closer, fire support, & doesn't put the whole ship at risk.