CSS Containing Captions when using Responsive Images

See accompanying blog post.

Short caption, all is good.

Long caption, pushes the width of the parent element beyond the width of the image.- all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good, all is not so good.

Long caption with max-width on the parent element. Ok, but what if you don't know the photo's width? Unfortunately we only have javascript to come to the rescue.