Updated guidance for Scottish schools follows two landmark court rulings relating to single-sex spaces.