Structure-based framework for the design and risk assessment of hydraulic structures, with application to offline flood detention basins