/*
 * VAL — recherche Google CSE depuis le bandeau.
 *
 * Le champ affiché dans l'overlay est volontairement indépendant du
 * formulaire Google CSE présent en bas de page : cela évite que les styles
 * .gsc-* du site ne contaminent l'interface minimaliste du bandeau.
 */

#val-search-toggle-wrap {
  position: absolute;
  left: 1.5rem;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10020;
}

#val-search-toggle-wrap .val-search-toggle {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.6rem !important;
  height: 2.6rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  cursor: pointer;
}

#val-search-toggle-wrap .val-search-toggle svg {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

#val-search-toggle-wrap .val-search-toggle:hover {
  opacity: .7;
}

#val-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1.5rem;
  background: rgba(0, 0, 0, .70);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}

#val-search-overlay.val-search-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#val-search-overlay .val-search-form {
  width: min(42rem, 100%);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#val-search-overlay .val-search-line {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .5rem 0;
  border-bottom: 2px solid rgba(255, 255, 255, .9);
}

#val-search-overlay .val-search-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: .35rem 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font: inherit !important;
  font-size: clamp(1.25rem, 3vw, 2rem) !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}

#val-search-overlay .val-search-input::placeholder {
  color: rgba(255, 255, 255, .87) !important;
  opacity: 1;
}

#val-search-overlay .val-search-submit {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto;
  width: 2.8rem !important;
  height: 2.8rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
}

#val-search-overlay .val-search-submit:hover {
  opacity: .7;
}

#val-search-overlay .val-search-submit svg {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Mobile : voile un peu plus dense. */
@media only screen and (max-width: 639px) {
  #val-search-toggle-wrap {
    left: .75rem;
  }

  #val-search-overlay {
    padding: 1rem;
    background: rgba(0, 0, 0, .78);
  }

  #val-search-overlay .val-search-form {
    width: 100%;
  }

  #val-search-overlay .val-search-input {
    font-size: 1.25rem !important;
  }
}

/*
 * Accueil : le grand titre centré gêne la lecture du champ si celui-ci reste
 * exactement au centre. On remonte donc la recherche et on densifie le voile.
 */
.page_sommaire #val-search-overlay {
  align-items: flex-start;
  padding-top: 30vh;
  background: rgba(0, 0, 0, .82);
}

@media only screen and (max-width: 639px) {
  .page_sommaire #val-search-overlay {
    padding-top: 26vh;
    background: rgba(0, 0, 0, .88);
  }
}
