/*
 * rml-search: the header search (#12), as the live Search Form widget bb44210
 * ("full screen" skin). Measured at 1440px on 2026-11-21.
 *
 * Toggle: a 41px square, the magnifier 0.55em (22.5px) in neutral-500, orange on
 * hover and focus, no background.
 *
 * Open: a fixed layer over the whole window, black at 65%, 15% side padding,
 * grows from the centre in 0.3s. The field fills the width: 50px text in white,
 * centred, line height 1.5, a 1px white line under it and a 3px corner. A close
 * button sits top right (on the live site it has no size, so only Esc closes).
 */

.rml-search {
  display: inline-block;
  line-height: 0;
}

.rml-search__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 41px;
  height: 41px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--neutral-500);
  font-size: 41px;
  cursor: pointer;
  transition: color 0.2s;
}

.rml-search__toggle:is(:hover, :focus-visible) {
  color: var(--brand-primary);
}

.rml-search__toggle:focus-visible,
.rml-search__close:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.rml-search__icon {
  display: block;
  width: 0.55em;
  height: 0.55em;
}

.rml-search__text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.rml-search__panel {
  position: fixed;
  z-index: 9998;
  inset: 0;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 100vh;
  padding: 0 15%;
  background-color: color-mix(in srgb, var(--black) 65%, transparent);
  line-height: normal;
  opacity: 0;
  transform: scale(0);
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0s 0.3s;
}

.rml-search.is-open .rml-search__panel {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
  transition: opacity 0.3s, transform 0.3s, visibility 0s;
}

.rml-search__form {
  flex: 1 1 100%;
  margin: 0;
}

.rml-search__input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
  border: solid var(--white);
  border-width: 0 0 1px;
  border-radius: 3px;
  background: none;
  box-shadow: none;
  color: var(--white);
  font-family: var(--font-heading), sans-serif;
  font-size: 50px;
  line-height: 1.5;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

.rml-search__input::placeholder {
  color: inherit;
  opacity: 0.6;
}

.rml-search__input:focus {
  outline: 3px solid var(--white);
  outline-offset: 0;
}

.rml-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.rml-search__close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.rml-search__close:hover {
  color: var(--brand-primary);
}

@media (prefers-reduced-motion: reduce) {
  .rml-search__panel,
  .rml-search.is-open .rml-search__panel {
    transition: none;
  }
}

/* Theme guard (#13). Hello Elementor's reset gives every button a pink
   background and white text on :hover and :focus ([type=button]:hover,
   specificity 0,2,0), and the Design guide doesn't load that reset, so its
   samples never showed it. These rules (html button[type]:where(...), 0,2,2)
   beat the theme and restate this element's own resting and state colours;
   rules with three or more classes (open, current) still win over them. */
html button[type]:where(.rml-search__toggle, .rml-search__close, .rml-search__submit):is(:hover, :focus) {
  background-color: transparent;
}

html button[type]:where(.rml-search__toggle):focus:where(:not(:focus-visible)) {
  color: var(--neutral-500);
}

html button[type]:where(.rml-search__toggle):is(:hover, :focus-visible),
html button[type]:where(.rml-search__close):hover {
  color: var(--brand-primary);
}

html button[type]:where(.rml-search__close):focus:where(:not(:hover)) {
  color: var(--white);
}

/* The field against the theme and the kit (input[type=search], 0,1,1): Hello's
   reset gives it a grey 1px box, 16px padding and "transition: all .3s" (which
   kept it hidden for a moment after the layer opened, so the script's focus()
   failed); the kit's custom CSS sets 14px. Restated one step higher. */
.rml-search input.rml-search__input {
  width: 100%;
  padding: 0;
  border: solid var(--white);
  border-width: 0 0 1px;
  border-radius: 3px;
  font-size: 50px;
  transition: none;
}

.rml-search input.rml-search__input:focus {
  border-color: var(--white);
}
