/* Mastodon screen-reader-safe personal stylesheet.
   Designed for the standard and advanced web interfaces.
   This stylesheet deliberately does not hide elements, change DOM order,
   or override Mastodon's screen-reader-only utility classes.
*/

/* Prefer predictable scrolling and minimal movement. */
html {
  scroll-behavior: auto !important;
  scroll-padding-top: 1rem;
}

*,
*::before,
*::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Preserve native keyboard-focus indicators, and strengthen them. */
:where(a, button, input, textarea, select, summary, [role="button"],
  [role="link"], [role="menuitem"], [role="tab"], [role="checkbox"],
  [role="radio"], [role="switch"], [tabindex]):focus-visible {
  outline: 3px solid #ffbf47 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px #111827 !important;
}

/* Forced-colors mode must retain OS-controlled colors. */
@media (forced-colors: active) {
  :where(a, button, input, textarea, select, summary, [role="button"],
    [role="link"], [role="menuitem"], [role="tab"], [role="checkbox"],
    [role="radio"], [role="switch"], [tabindex]):focus-visible {
    outline: 3px solid Highlight !important;
    box-shadow: none !important;
  }
}

/* Make keyboard focus clear on editable post fields as well. */
:where([contenteditable="true"], [role="textbox"]):focus-visible {
  outline: 3px solid #ffbf47 !important;
  outline-offset: 2px !important;
}

@media (forced-colors: active) {
  :where([contenteditable="true"], [role="textbox"]):focus-visible {
    outline-color: Highlight !important;
  }
}

/* Make link underlines reliable independently of color. */
:where(.status__content, .reply-indicator__content, .account__header__content,
       .about__section, .rich-formatting) a:not(.mention):not(.hashtag) {
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

/* Give touch and mouse users a larger hit area without changing tab order. */
:where(.status__action-bar__button, .icon-button):not([hidden]) {
  min-width: 2.5rem;
  min-height: 2.5rem;
}

/* Do not allow focus to be clipped by scrollable content containers. */
:where(.scrollable, .item-list, .columns-area, .column) {
  scroll-padding: 1rem;
}

/* Keep text selectable for review and copying. */
:where(.status__content, .reply-indicator__content,
       .account__header__content, .notification__message) {
  user-select: text;
}

/* When the OS requests reduced motion, also suppress smooth movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}


