/**
 * @file
 * search-form--popout.css
 * 
 * Works with the code:
 * @code
 * function letsgo_form_alter(&$form, FormStateInterface $form_state, $form_id) {
 *   switch ($form_id) {
 *     case 'search_block_form':
 *       $form['#attributes']['class'][] = 'search-form search-form--popout';
 *       $form['#attached']['library'][] = 'letsgo/search-form--popout';
 *       
 *       $form['keys']['#title'] = '&nbsp; &nbsp;';
 *       $form['keys']['#attributes']['placeholder'] = 'Search the site...';
 *       $form['keys']['#title_display'] = 'before';
 *       break;
 *   }
 * }
 * @endcode
 *
 * Attached in libraries.yml
 */



.search-form--popout {
  float: right;
  position: relative;
  margin: 0.5em;
  z-index: 500;
}

.search-form--popout .form-item {
  margin: 0;
}

.search-form--popout .form-item label {
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3E%3Cpath%20fill='%23716E6E'%20d='M505%20442.7L405.3%20343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3%2044-79.7%2044-128C416%2093.1%20322.9%200%20208%200S0%2093.1%200%20208s93.1%20208%20208%20208c48.3%200%2092.7-16.4%20128-44v16.3c0%206.4%202.5%2012.5%207%2017l99.7%2099.7c9.4%209.4%2024.6%209.4%2033.9%200l28.3-28.3c9.4-9.4%209.4-24.6.1-34zM208%20336c-70.7%200-128-57.2-128-128%200-70.7%2057.2-128%20128-128%2070.7%200%20128%2057.2%20128%20128%200%2070.7-57.2%20128-128%20128z'%3E%3C/path%3E%3C/svg%3E") no-repeat right center;
  background-size: 1.5em auto;
  width: 2.2em;
  height: 1.5em;
  float: right;
  cursor: pointer;
  position: relative;
  z-index: 20;
  text-indent: -99em;
  text-align: left;
  overflow: hidden;
  opacity: .8;
}

.search-form--popout .form-item input {
  width: 0;
  top: -.3em;
  position: absolute;
  right: 1.7em;
  color: transparent;
  border-radius: .1em;
  z-index: 30;
  border: 1px solid transparent;
  transition: all .5s ease 0s;
  -webkit-transition: all .5s ease 0s;
  box-shadow: none;
  background: transparent;
  font-size: 1.3em;
}

.search-form--popout .form-item input:focus,.search-form--popout .form-item:hover input {
  background: #fff;
  border-color: #ccc;
  opacity: 1;
  width: 18em;
  max-width: 90vw;
  color: #000;
  padding: .4em .5em;
  box-shadow: 0.5em 0.5em 1em rgb(0 0 0 / 20%);
}

.search-form--popout .form-actions {
  display: none !important
}

@media (max-width: 40em) {
  .search-form--popout .form-item input {
    top:50%;
    margin: -1em auto;
    left: 0;
    right: 0;
    position: fixed;
  }

  .search-form--popout .form-item input:focus,.search-form--popout .form-item:hover input {
    box-shadow: 0.5em 0.5em 30em 30em rgb(0 0 0 / 50%);
  }
}