Shrines and temples have public areas and private areas. If a rope (shimenawa) or a sign blocks an area, don't cross it.
Some temples allow you to enter inner halls for an additional fee (300–500 yen). Worth it for the architecture and the painted screens.
Take photos only where signs allow. Inner halls often forbid all photography.