.search { position: absolute; z-index: 101; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; /* makes other page elements clickable */ } .js .search::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; background: rgba(0, 0, 0, 0.8); } .btn--search-close { font-size: 2em; position: absolute; top: 1.25em; right: 1.25em; display: none; } .js .btn--search-close { display: block; } .search__form { position: relative; width: 50%; min-width: 300px; margin: 0 auto; } .search__input { font-family: inherit; font-size: 5em; display: inline-block; -webkit-box-sizing: border-box; box-sizing: border-box; width: 100%; padding: 0 1em 0.15em 0; pointer-events: auto; color: #2196f3; border-bottom: 4px solid; } .search__input::-webkit-search-cancel-button, .search__input::-webkit-search-decoration { -webkit-appearance: none; } .search__input::-ms-clear { display: none; } .btn--search { font-size: 3em; position: absolute; right: 0; bottom: 0.5em; pointer-events: none; color: #e8db82; } .search--open .btn--search { pointer-events: auto; } .search__suggestion { width: 50%; max-width: 450px; margin: calc(40vh + 2em) auto 0; text-align: left; pointer-events: none; } .search__suggestion:nth-child(2) { margin: 0 3em; } .search__suggestion h3 { font-size: 1.5em; margin: 0; color: #fff; } .search__suggestion h3::before { content: '\21FE'; display: inline-block; padding: 0 0.5em 0 0; } .search__suggestion p { font-size: 1.25em; line-height: 1.4; margin: 0.75em 0 0 0; color: #bbb; } /************************/ /* Transitions */ /************************/ .js .search::before { opacity: 0; transition: opacity 0.5s; transition-timing-function: cubic-bezier(0.7,0,0.3,1); } .js .search--open::before { opacity: 1; } .search--open { pointer-events: auto; } .search__form { transform: scale3d(0.5,0.5,1); transition: transform 0.5s; transition-timing-function: cubic-bezier(0.7,0,0.3,1); } .search--open .search__form { transform: translate3d(0,40vh,0) translate3d(0,-50%,0); } .btn--search-close { opacity: 0; transform: scale3d(0.8, 0.8, 1); transition: opacity 0.5s, transform 0.5s; transition-timing-function: cubic-bezier(0.7,0,0.3,1); } .search--open .btn--search-close { opacity: 1; transform: scale3d(1, 1, 1); transition-delay: 0.1s; } /* Dummy blocks */ .search__suggestion h3, .search__suggestion p { opacity: 0; transform: translate3d(0, 100px, 0); transition: opacity 0.2s, transform 0.5s; transition-timing-function: cubic-bezier(0.7,0,0.3,1); } .search--open .search__suggestion h3, .search--open .search__suggestion p { opacity: 1; transform: translate3d(0, 0, 0); transition: opacity 0.5s, transform 0.5s; transition-timing-function: cubic-bezier(0.7,0,0.3,1); } .search--open .search__suggestion p { transition-delay: 0.1s; } @media screen and (max-width: 40em) { .search__form { width: 100%; padding: 2em 1em 0; } .search__input { font-size: 2em; } .btn--search { font-size: 1.25em; right: 1em; } .btn--search-close { font-size: 1.15em; } .search__suggestion { font-size: 0.85em; width: 100%; margin-top: 40vh; padding: 0 1em; } }