At any stage of a proceeding involving custody of a child the court may, if it is in the best interests of the child, close the proceeding to the public or order the court records closed to the public temporarily or permanently. The court may modify or vacate an order under this section at any time.