/* Public reader controls. Keep focus and autofill text readable in light fields. */
@layer liwwadders-keyboard-focus {
  html body :is(input:not([type]), input:is([type="text"], [type="search"], [type="email"], [type="url"], [type="tel"], [type="password"], [type="number"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"], [type="file"]), textarea, select) {
    background-color: #fff !important;
    color: #000000 !important;
    border: 1px solid #999 !important;
  }
  :root body :is(input:not([type]), input:is([type="text"], [type="search"], [type="email"], [type="url"], [type="tel"], [type="password"], [type="number"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"], [type="file"]), textarea, select):focus {
    border-color: #000 !important;
    outline: none !important;
    box-shadow: none !important;
  }
  .ct-header-cta a.ct-button[aria-label="Liwwadders"] {
    background-color: var(--lwd-red, #ed1646) !important;
    color: #fff !important;
  }
  .ct-header-cta a.ct-button[aria-label="Liwwadders"]:is(:active, [data-liw-departing]) {
    background-color: var(--lwd-link-blue, var(--theme-palette-color-4, #3282f6)) !important;
  }
  @media (forced-colors: active) {
    :root body :is(input:not([type]), input:is([type="text"], [type="search"], [type="email"], [type="url"], [type="tel"], [type="password"], [type="number"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"], [type="file"]), textarea, select):focus {
      border-color: Highlight !important;
    }
  }
}

/* Search popup: one white rounded rectangle, with the submit control inside it.
   Keep other fields' grey-to-black border and keyboard navigation intact. */
@layer liwwadders-keyboard-focus {
  html body #search-modal .ct-search-form-inner {
    display:flex; align-items:center; gap:0; padding:4px;
    border:0!important; border-radius:12px!important;
    background:#fff!important; outline:none!important; box-shadow:none!important;
  }
  html body #search-modal input.modal-field,
  html body #search-modal input.modal-field:focus {
    flex:1 1 0; width:0; min-width:0; height:44px; padding:0 16px;
    border:0!important; border-radius:8px!important;
    background:#fff!important; color:#000!important;
    outline:none!important; box-shadow:none!important;
    -webkit-appearance:none; appearance:none;
  }
  html body #search-modal .wp-element-button {
    position:relative; flex:0 0 44px; width:44px; min-width:44px;
    height:44px; min-height:44px; margin:0; padding:0;
    border:0!important; border-radius:8px!important; box-shadow:none!important;
  }
  /* Keyboard focus stays on the combined control, without a second input rim. */
  html body #search-modal .ct-search-form-inner:has(input.modal-field:focus-visible) .wp-element-button,
  html body #search-modal .wp-element-button:focus-visible {
    outline:2px solid #5c5c5c!important; outline-offset:-4px!important;
  }
  @media (forced-colors:active) {
    html body #search-modal .ct-search-form-inner:has(input.modal-field:focus-visible) .wp-element-button,
    html body #search-modal .wp-element-button:focus-visible { outline-color:Highlight!important; }
  }
}

/* No ring while typing; a real keyboard focus on the submit button remains visible. */
@layer liwwadders-keyboard-focus {
  html body #search-modal .wp-element-button { outline:none!important; }
  html body #search-modal .ct-search-form-inner:has(input.modal-field:focus-visible) .wp-element-button { outline:none!important; }
  html body #search-modal .wp-element-button:focus-visible { outline:2px solid #fff!important; outline-offset:-4px!important; }
  @media (forced-colors:active) {
    html body #search-modal .wp-element-button:focus-visible { outline-color:Highlight!important; }
  }
}
/* Archive search uses the same white rounded rectangle with a neutral surrounding panel. */
#search-modal:has(form[data-liw-search-scope="archive"]) .ct-panel-actions,
#search-modal:has(form[data-liw-search-scope="archive"]) .ct-panel-content { background:#f3f3f3; color:#000; }
#search-modal:has(form[data-liw-search-scope="archive"]) :is(.ct-panel-heading,.lwd-search-panel-title,.ct-toggle-close) {
  color:#000; --theme-icon-color:#000; --theme-icon-hover-color:#000;
}
#search-modal form[data-liw-search-scope="archive"] .wp-element-button,
#search-modal form[data-liw-search-scope="archive"] .wp-element-button:is(:hover,:focus-visible,:active) {
  background:var(--lwd-red,#ed1646); color:#fff; --theme-icon-color:#fff; --theme-icon-hover-color:#fff;
}
