/* Accounting A11Y focus: adapted from the completed Digitana Social keyboard-focus contract. */
:where(
  a[href],
  button,
  input:not([type="hidden"]),
  select,
  textarea,
  summary,
  [tabindex]:not([tabindex="-1"]),
  [role="button"][tabindex]:not([tabindex="-1"]),
  [role="link"][tabindex]:not([tabindex="-1"])
):not([hidden]):not(:disabled):not([aria-disabled="true"]):where(:not([tabindex="-1"])):not([data-accounting-pointer-focus="true"]):focus-visible {
  outline: 3px solid var(--color-blue) !important;
  outline-offset: 3px !important;
}

:where(
  .accounting-nav__button,
  .accounting-auth-button,
  .header-help,
  .icon-button,
  .theme-switch,
  .motion-toggle
):not([hidden]):not(:disabled):not([aria-disabled="true"]):not([tabindex="-1"]):focus-visible {
  position: relative;
  z-index: 20;
  outline-offset: -3px !important;
}

html[data-theme="dark"] :where(
  a[href],
  button,
  input:not([type="hidden"]),
  select,
  textarea,
  summary,
  [tabindex]:not([tabindex="-1"]),
  [role="button"][tabindex]:not([tabindex="-1"]),
  [role="link"][tabindex]:not([tabindex="-1"])
):not([hidden]):not(:disabled):not([aria-disabled="true"]):where(:not([tabindex="-1"])):not([data-accounting-pointer-focus="true"]):focus-visible {
  outline-color: #8bc8ed !important;
}

/* Skip-Link bleibt in beiden Themes lesbar und klar vom Seitenhintergrund getrennt. */
.skip-link,
.skip-link:visited {
  border: 2px solid var(--color-blue);
  background: var(--color-surface);
  color: var(--color-blue-deep);
}

html[data-theme="dark"] .skip-link,
html[data-theme="dark"] .skip-link:visited {
  border-color: var(--color-blue-light);
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.skip-link:focus-visible,
.accounting-nav__button.is-active:focus-visible {
  outline: 4px solid #8bc8ed !important;
  outline-offset: 3px !important;
}

.accounting-nav__button.is-active:focus-visible {
  box-shadow:
    0 0 0 2px #164f73,
    0 5px 12px rgba(38, 103, 148, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .accounting-nav__button.is-active:focus-visible {
  box-shadow:
    0 0 0 2px #eef9ff,
    0 5px 12px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
