/* Use a filled focus state throughout the site. Native controls keep their tab order. */
@layer henvori-focus {
  body :focus,
  :where(.hm-room-compare, .hd-compare):has(input:focus-visible),
  :where(.as-enhancements, .as-check, .ss-consent) input:focus-visible + span {
    outline: none !important;
  }

  :where(
    input:not([type="range"], [type="checkbox"], [type="radio"], [type="color"], [type="file"], [type="button"], [type="submit"], [type="reset"]),
    textarea:not([data-chat-input], [data-chat-bottom-input]), select, [contenteditable="true"]
  ):focus {
    border-color: color-mix(in srgb, currentColor 17%, transparent) !important;
    background-color: color-mix(in srgb, currentColor 7%, transparent) !important;
    box-shadow: none !important;
  }

  :where(
    .ca-search, .hv-model-search, .tool-studio-search, .speech-search, .st-search, .admin-search-wrap, .ca-section .ca-card
  ):focus-within {
    border-color: color-mix(in srgb, currentColor 17%, transparent) !important;
    box-shadow: none !important;
  }

  :where(.hm-room-compare, .hd-compare):has(input:focus-visible) :where(.hm-room-divider, .hd-compare-line) i {
    box-shadow: none !important;
    scale: 1.16;
  }

  .tool-studio-card:focus-visible:not(:hover) {
    border-color: color-mix(in srgb, currentColor 20%, transparent) !important;
    box-shadow: none !important;
  }

  @media (forced-colors: active) {
    body :focus-visible {
      outline: 2px solid Highlight !important;
      outline-offset: 2px;
    }
  }
}

body :where(button, summary, a, [role="button"], [role="option"], [role="tab"],
  input:is([type="range"], [type="checkbox"], [type="radio"], [type="button"], [type="submit"], [type="reset"]),
  video[controls], pre[tabindex]):focus-visible {
  filter: brightness(.77);
}

body :where(a, summary):focus-visible {
  text-decoration: underline;
  text-underline-offset: .24em;
}

:where(.as-enhancements, .as-check, .ss-consent) input:focus-visible + span {
  filter: brightness(.77);
}
