/**
 * @file
 * Accessibility baseline from the UoA design system (WCAG 2.2 AA).
 *
 * Loaded after basecore and the rest of dit_theme. The !important flags are
 * deliberate: basecore has ~290 :focus rules, several of which remove the
 * outline at higher specificity (e.g. `a:focus { outline: none }` in
 * basecore/css/base/elements.css), and content carries inline styles. These
 * rules are guarantees, not styling, so nothing may override them.
 * Guarded by tests/e2e-pw/specs/foundation.spec.ts.
 */

/* Visible keyboard focus everywhere (WCAG 2.4.7, 2.4.13). :focus-visible only,
   so mouse clicks do not show the ring. */
:root :focus-visible {
  outline: var(--uoa-focus-ring-width) solid var(--uoa-color-focus-ring) !important;
  outline-offset: var(--uoa-focus-ring-offset) !important;
}

/* On brand-coloured surfaces the blue ring would not reach 3:1; use white. */
[class*='page-node-type-pms-'] .banner :focus-visible,
.region--colored-background :focus-visible,
.region--dark-colored-background :focus-visible,
.region--dark-background :focus-visible,
.region--shade-background :focus-visible {
  outline-color: var(--uoa-color-focus-ring-inverse) !important;
}

/* Links inside running text must not rely on colour alone (WCAG 1.4.1).
   Navigation, menus, cards and buttons keep their own styles. */
.text-formatted :is(p, li, td, dd) a:not([class*='button']) {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.text-formatted :is(p, li, td, dd) a:not([class*='button']):hover {
  text-decoration-thickness: 2px;
}

/* No uppercase on Greek (design system, typography): browsers drop or mangle
   the accents and screen readers may spell the words out. Covers basecore,
   content and inline styles. */
:lang(el) {
  text-transform: none !important;
}

/* "All motion is switched off for users with prefers-reduced-motion"
   (design system, shape & motion; WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
