Organizing small spaces is always a challenge but I am excited about these kinds of challenges. I've lived in a vintage Shasta Compact when traveled up and down the east Coast of the United States. The inside dimensions were 10 feet long by 7 feet wide and the ceiling was 7 feet if I remember correctly. I was able to fit a shower, a potty, a 4 gallon water heater, a 40 gallon fresh water tank, a sink, a stove/oven, a fridge, and 2 beds that could sleep 2 people each (snug). That's impressive if you ask me. So using some of my experience from that, I addressed this small bookshelf with a lot of books. Thinking outside the box I arranged and rearranged the rooms until they not only fit but also looked pleasing to the eye.
I find stacking some books horizontal and some vertical breaks it up uniquely and helps utilize space more efficiently. In my opinion, it makes it more interesting to look at too.
Before photo. (I didn't take a before photo of the above shelves but they were pulled in the same manor as the one seen here).