If you would be so kind to compile this LaTeX document:
\documentclass[a4paper,11pt]{book}
\usepackage[paper=a4paper,twoside=true,lmargin=4cm,
rmargin=4cm,bindingoffset=0cm]{geometry}
\usepackage{mdframed,lipsum,kantlipsum}
\mdfsetup{font=\small}
\begin{document}
\kant[1-8]
\begin{mdframed}
\kant[1-5]
\end{mdframed}
\end{document}
You will find that the bottoms of pages 2 and 3 are misaligned as follows:

Questions:
Shouldn't the space between the paragraph and the frame on page 3 expand such that the bottoms align? Why does this not take place?
How would you add a flexible (zero, plus something flexible if needed, just like for paragraph spacing) space above the mdframed box too? That would put a less strain on the space between the paragraphs, assuming I resolve question 1 above.
