/* Readium CSS
   A11y font pref

   A submodule managing a11y text normalization for user settings
   Part of “User Overrides” class – no flag required.

   Repo: https://github.com/readium/css */

/* For AccessibleDfA, we need to normalize font-weight and font-style since only the normal style is available */

:root[style*="AccessibleDfA"] {
  /* We won’t use the variable there since we need fallbacks for missing characters */
  font-family: AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
}

:root[style*="IA Writer Duospace"] {
  /* We won’t use the variable there since we need fallbacks for missing characters */
  font-family: "IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace !important;
}

/* Maybe users want a setting to normalize any font offered so there is a “a11y Normalize” flag for it */

:root:--a11y-font,
:root:--a11y-normalize {
  font-weight: normal !important;
  font-style: normal !important;
}

/* Targeting everything except code. Note that Open Dyslexic has a monospaced font for code */
:root:--a11y-font *:not(code):not(var):not(kbd):not(samp),
:root:--a11y-normalize *:not(code):not(var):not(kbd):not(samp) {
  font-family: inherit !important;
  font-weight: inherit !important;
  font-style: inherit !important;
}

/* Normalizing text-decoration, subs and sups */
:root:--a11y-font *,
:root:--a11y-normalize * {
  text-decoration: none !important;
  font-variant-caps: normal !important;
  font-variant-position: normal !important;
  font-variant-numeric: normal !important;
}

:root:--a11y-font sup,
:root:--a11y-normalize sup,
:root:--a11y-font sub,
:root:--a11y-normalize sub {
  font-size: 1rem !important;
  vertical-align: baseline !important;
}