/**
  * @file
  * Search API Form, provided by the Search API block module.
  * This block appears in two places: desktop view in the navigation bar,
  * and mobile view in the offcanvas panel for mobile hidden by the hamburger menu button.
  **/

/** Shared for both versions **/

.search-api-form .content {
  display: flex;
}

.search-api-form .content form {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  flex-wrap: nowrap;
  margin-bottom: 0;
}

.search-api-form .form-search {
  border: 1px solid var(--black);
  border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
}

.search-api-form .form-search:is(:hover, :focus) {
  border: 1px solid var(--laurier-gold);
  box-shadow: none;
}

.search-api-form form div[data-drupal-selector="edit-actions"] {
  border: 1px solid var(--laurier-green);
  border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
  background-color: var(--laurier-green);
}

.search-api-form .form-actions .button {
  margin: 0.375rem;
  border: none;
  border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
  background: var(--laurier-green)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='23' viewBox='0 0 22 23'%3E%3Cpath fill='white' d='M21.7 21.3l-4.4-4.4C19 15.1 20 12.7 20 10c0-5.5-4.5-10-10-10S0 4.5 0 10s4.5 10 10 10c2.1 0 4.1-0.7 5.8-1.8l4.5 4.5c0.4 0.4 1 0.4 1.4 0S22.1 21.7 21.7 21.3z M10 18c-4.4 0-8-3.6-8-8s3.6-8 8-8s8 3.6 8 8S14.4 18 10 18z'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
  padding: 0;
  width: 23px;
  height: 23px;
  fill: var(--white);
  color: var(--white);
  font-size: 0;
  line-height: 0;
}

.search-api-form
  form
  div[data-drupal-selector="edit-actions"]:is(:hover, :focus-within) {
  background-color: var(--white);
  color: var(--laurier-green);
}

.search-api-form
  form
  div[data-drupal-selector="edit-actions"]:is(:hover, :focus-within):is(
    :hover,
    :focus
  )
  .button {
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='23' viewBox='0 0 22 23'%3E%3Cpath fill='black' d='M21.7 21.3l-4.4-4.4C19 15.1 20 12.7 20 10c0-5.5-4.5-10-10-10S0 4.5 0 10s4.5 10 10 10c2.1 0 4.1-0.7 5.8-1.8l4.5 4.5c0.4 0.4 1 0.4 1.4 0S22.1 21.7 21.7 21.3z M10 18c-4.4 0-8-3.6-8-8s3.6-8 8-8s8 3.6 8 8S14.4 18 10 18z'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
}

.search-api-form
  form
  div[data-drupal-selector="edit-actions"]
  .button:is(:focus) {
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='23' viewBox='0 0 22 23'%3E%3Cpath fill='black' d='M21.7 21.3l-4.4-4.4C19 15.1 20 12.7 20 10c0-5.5-4.5-10-10-10S0 4.5 0 10s4.5 10 10 10c2.1 0 4.1-0.7 5.8-1.8l4.5 4.5c0.4 0.4 1 0.4 1.4 0S22.1 21.7 21.7 21.3z M10 18c-4.4 0-8-3.6-8-8s3.6-8 8-8s8 3.6 8 8S14.4 18 10 18z'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: none;
}

/** Mobile version visible when the slideout pane is active **/
.offcanvas .search-api-form {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
}

/** Navbar version visible when the slideout pane is not active **/
.region--header-form .search-api-form {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  height: 100%;
}

.region--header-form .search-api-form form {
  display: inline-flex;
}

/** Don't display when the offcanvas is active, to avoid duplicating the search region **/
@media (max-width: 84.99999rem) {
  .offcanvas-active .region--header-form .search-api-form {
    display: none;
  }
}
