Structure, stability, and thermodynamics of lamellar DNA-lipid complexes