.wrapper { height: 100%; overflow-x: hidden; position: relative; } .overlay { content: ""; display: block; width: 0; height: 0; background-color: rgba(0, 0, 0, 0.5); position: absolute; top: 0; left: 0; z-index: 2; opacity: 0; transition: opacity .5s; } .overlay.open { width: 100%; height: 100%; opacity: 1; } main { height: 100%; min-height: 100vh; padding: 0 50px; background-color: #eee; transiti