The HP books didnt really start as a means of appealing to a mainstream crowd though...
Notice how they’re almost all divided into very episodic chapters. That’s because children’s novels are generally built for reading maybe a chapter or two at a time. Maybe before bed or during reading time in a classroom.
Also those books are very much literature.