/**
 * @file
 * This file is used to style the search block.
 */

.search-form + h2 {
  margin: 0 14px 1rem;
}

.search-block-form {
  display: none;
}

@media screen and (min-width: 48em) {
  .search-block-form {
    display: block;
    flex: 0 1 50%;
  }
}

.search-block-form form {
  display: flex;
  margin-top: 1.3rem;
  margin-bottom: 1.2rem;
}

.search-iconwrap {
  /* Compensate for focus styling that offsets left alignment of icon */
  margin-left: -7px;
}

@media screen and (min-width: 48em) {
  .search-iconwrap {
    display: none;
  }
}

/* Search icon for mobile */
.search-link {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 40px;
  height: 40px;
  /* Centres the icon when focused/hovered */
  margin-right: -7px;
  padding-right: 7px;
}
.search-link:focus,
.search-link:hover {
  outline: 3px solid #00836d;
  background-color: #fff;
}
.search-link svg {
  display: block;
  width: 26px;
  height: auto;
}

/* Search input */
.form-type-search {
  margin-top: 0;
  margin-bottom: 0;
}

.form-search {
  width: 20em;
  max-width: calc(100vw - 6.25em);
  height: auto;
  margin: 0 -2px 0 0;
  padding: 7px 8px 7px 32px;
  color: #464646;
  border: 1px solid #dbdbdb;
  border-right: none;
  border-radius: 3px;
  background: url(../../../../images/svg/search.svg) no-repeat 0.5em center #fff;
  font-size: 0.875rem;
  line-height: normal;
}

.form-search:focus {
  margin: 0 0 -2px -2px;
  padding: 5px 8px 5px 32px;
  outline: none;
}

.form-search::placeholder {
  opacity: 1;
}
.form-type-search .form-search {
  box-sizing: border-box; /* Override input[type="search"] of normalize.css */
}

/* Search submit */
.search-block-form .form-actions {
  position: relative;
  z-index: 1;
  margin-top: 0;
  margin-bottom: 0;
}
.search-block-form .form-submit,
.search-form .form-submit {
  /* Take off the border radius on the left side as it bumps into the search field */
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.search-block-form .form-submit:focus,
.search-block-form .form-submit:hover,
.search-form .form-submit:focus,
.search-form .form-submit:hover {
  margin: 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
