/* ==========================================================================
   TM-SCHOOL · версия для слабовидящих (a11y)
   Порт панели sischool (Cecutient):vanilla CSS, без jQuery.
   Требования: ГОСТ Р 52872-2019 (интернет-ресурсы для инвалидов по зрению),
   ГОСТ Р 70176-2022 (доступность сайтов образовательных организаций):
   - ссылка на версию для слабовидящих на каждой странице (кнопка в топ-панели);
   - размер шрифта (3 ступени), 4 цветовые схемы (мин.: чёрное на белом / белое на чёрном);
   - отключение изображений с текстовой заменой (alt), шрифт sans/serif;
   - межстрочный интервал и кернинг; сохранение настроек между страницами;
   - управление с клавиатуры (кнопки, aria-pressed, :focus-visible).
   Область действия — только #tm-site (панель настроек не перекрашивается).
   ========================================================================== */

/* --- Панель: скрыта, пока режим не включён --- */
#tm-a11y-panel { display: none; background: #283347; color: #fff; }
body.tm-a11y #tm-a11y-panel { display: block; }

#tm-a11y-panel .tm-a11y-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; margin: 4px;
  border: 2px solid #fff; border-radius: 8px;
  color: #fff; background: transparent; cursor: pointer;
  font-weight: 700; line-height: 1;
}
#tm-a11y-panel .tm-a11y-box:hover { background: rgba(255,255,255,.2); }
#tm-a11y-panel .tm-a11y-box:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#tm-a11y-panel .tm-a11y-box[aria-pressed="true"] { background: #fff; color: #283347; }

#tm-a11y-panel .tm-a11y-opt {
  display: block; width: 100%; margin: 4px 0; padding: 8px 14px;
  border: 1px solid #fff; border-radius: 8px;
  color: #fff; background: transparent; cursor: pointer; text-align: left;
}
#tm-a11y-panel .tm-a11y-opt:hover { background: rgba(255,255,255,.15); }
#tm-a11y-panel .tm-a11y-opt[aria-pressed="true"] { background: #fff; color: #283347; }

#tm-a11y-settings { display: none; }
#tm-a11y-settings.tm-open { display: block; }

/* Кнопки в топ-панели: одна видна в обычном режиме, другая — в a11y */
#tm-a11y-off { display: none; }
body.tm-a11y #tm-a11y-on { display: none; }
body.tm-a11y #tm-a11y-off { display: inline-flex; }

/* --- База режима: убрать декор, Worttrennung --- */
body.tm-a11y #tm-site * {
  overflow-wrap: break-word; word-wrap: break-word;
  hyphens: auto; transition: none !important;
  text-shadow: none !important; box-shadow: none !important;
}
body.tm-a11y #tm-site *:focus-visible { outline: 3px solid currentColor !important; outline-offset: 2px; }
body.tm-a11y #tm-site .tm-a11y-img-alt {
  display: block; border: 1px solid; padding: 10px; margin-bottom: 14px;
}

/* --- Размер шрифта (исправлен typo !mportant старой темы) --- */
body.tm-a11y.tm-a11y-font-small #tm-site p,
body.tm-a11y.tm-a11y-font-small #tm-site a,
body.tm-a11y.tm-a11y-font-small #tm-site div,
body.tm-a11y.tm-a11y-font-small #tm-site span,
body.tm-a11y.tm-a11y-font-small #tm-site li { font-size: 1rem !important; }
body.tm-a11y.tm-a11y-font-small #tm-site h1,
body.tm-a11y.tm-a11y-font-small #tm-site h2 { font-size: 1.5rem !important; }
body.tm-a11y.tm-a11y-font-small #tm-site h3 { font-size: 1.125rem !important; }

body.tm-a11y.tm-a11y-font-medium #tm-site p,
body.tm-a11y.tm-a11y-font-medium #tm-site div,
body.tm-a11y.tm-a11y-font-medium #tm-site span,
body.tm-a11y.tm-a11y-font-medium #tm-site li { font-size: 1.5rem !important; }
body.tm-a11y.tm-a11y-font-medium #tm-site a { font-size: 1.375rem !important; }
body.tm-a11y.tm-a11y-font-medium #tm-site h1,
body.tm-a11y.tm-a11y-font-medium #tm-site h2 { font-size: 1.75rem !important; }
body.tm-a11y.tm-a11y-font-medium #tm-site h3 { font-size: 1.5rem !important; }

body.tm-a11y.tm-a11y-font-big #tm-site p,
body.tm-a11y.tm-a11y-font-big #tm-site div,
body.tm-a11y.tm-a11y-font-big #tm-site span,
body.tm-a11y.tm-a11y-font-big #tm-site li { font-size: 2rem !important; }
body.tm-a11y.tm-a11y-font-big #tm-site a { font-size: 1.5rem !important; }
body.tm-a11y.tm-a11y-font-big #tm-site h1,
body.tm-a11y.tm-a11y-font-big #tm-site h2 { font-size: 2.25rem !important; }
body.tm-a11y.tm-a11y-font-big #tm-site h3 { font-size: 1.625rem !important; }

/* --- Цветовые схемы --- */
/* A: чёрный текст на белом */
body.tm-a11y.tm-a11y-scheme-default #tm-site *,
body.tm-a11y.tm-a11y-scheme-default #tm-site *::before,
body.tm-a11y.tm-a11y-scheme-default #tm-site *::after {
  background: #fff !important; background-image: none !important;
  color: #000 !important; border-color: #000 !important;
}
body.tm-a11y.tm-a11y-scheme-default #tm-site .tm-submenu .tm-link {
  background: #000 !important; color: #fff !important;
}
/* B: белый текст на чёрном */
body.tm-a11y.tm-a11y-scheme-black #tm-site *,
body.tm-a11y.tm-a11y-scheme-black #tm-site *::before,
body.tm-a11y.tm-a11y-scheme-black #tm-site *::after {
  background: #000 !important; background-image: none !important;
  color: #fff !important; border-color: #fff !important;
}
body.tm-a11y.tm-a11y-scheme-black #tm-site .tm-submenu .tm-link {
  background: #fff !important; color: #000 !important;
}
/* C: тёмно-синий на голубом */
body.tm-a11y.tm-a11y-scheme-blue #tm-site *,
body.tm-a11y.tm-a11y-scheme-blue #tm-site *::before,
body.tm-a11y.tm-a11y-scheme-blue #tm-site *::after {
  background: #9dd1ff !important; background-image: none !important;
  color: #063462 !important; border-color: #063462 !important;
}
body.tm-a11y.tm-a11y-scheme-blue #tm-site .tm-submenu .tm-link {
  background: #063462 !important; color: #9dd1ff !important;
}
/* D: светло-зелёный на тёмно-коричневом */
body.tm-a11y.tm-a11y-scheme-green #tm-site *,
body.tm-a11y.tm-a11y-scheme-green #tm-site *::before,
body.tm-a11y.tm-a11y-scheme-green #tm-site *::after {
  background: #3b2716 !important; background-image: none !important;
  color: #a9e44d !important; border-color: #a9e44d !important;
}
body.tm-a11y.tm-a11y-scheme-green #tm-site .tm-submenu .tm-link {
  background: #a9e44d !important; color: #3b2716 !important;
}

/* --- Изображения --- */
body.tm-a11y.tm-a11y-noimg #tm-site img { display: none !important; }
body.tm-a11y.tm-a11y-mono #tm-site img { filter: grayscale(100%) !important; }

/* --- Гарнитура --- */
body.tm-a11y.tm-a11y-serif #tm-site,
body.tm-a11y.tm-a11y-serif #tm-site h1,
body.tm-a11y.tm-a11y-serif #tm-site h2,
body.tm-a11y.tm-a11y-serif #tm-site h3,
body.tm-a11y.tm-a11y-serif #tm-site a,
body.tm-a11y.tm-a11y-serif #tm-site li { font-family: "Times New Roman", Times, serif !important; }
body.tm-a11y.tm-a11y-sans #tm-site,
body.tm-a11y.tm-a11y-sans #tm-site h1,
body.tm-a11y.tm-a11y-sans #tm-site h2,
body.tm-a11y.tm-a11y-sans #tm-site h3,
body.tm-a11y.tm-a11y-sans #tm-site a,
body.tm-a11y.tm-a11y-sans #tm-site li { font-family: Arial, sans-serif !important; }

/* --- Межстрочный интервал --- */
body.tm-a11y.tm-a11y-spacing-small #tm-site h1,
body.tm-a11y.tm-a11y-spacing-small #tm-site h2,
body.tm-a11y.tm-a11y-spacing-small #tm-site h3,
body.tm-a11y.tm-a11y-spacing-small #tm-site h4,
body.tm-a11y.tm-a11y-spacing-small #tm-site a,
body.tm-a11y.tm-a11y-spacing-small #tm-site span,
body.tm-a11y.tm-a11y-spacing-small #tm-site p,
body.tm-a11y.tm-a11y-spacing-small #tm-site div,
body.tm-a11y.tm-a11y-spacing-small #tm-site li { line-height: 1.5 !important; }
body.tm-a11y.tm-a11y-spacing-medium #tm-site h1,
body.tm-a11y.tm-a11y-spacing-medium #tm-site h2,
body.tm-a11y.tm-a11y-spacing-medium #tm-site h3,
body.tm-a11y.tm-a11y-spacing-medium #tm-site h4,
body.tm-a11y.tm-a11y-spacing-medium #tm-site a,
body.tm-a11y.tm-a11y-spacing-medium #tm-site span,
body.tm-a11y.tm-a11y-spacing-medium #tm-site p,
body.tm-a11y.tm-a11y-spacing-medium #tm-site div,
body.tm-a11y.tm-a11y-spacing-medium #tm-site li { line-height: 2 !important; }
body.tm-a11y.tm-a11y-spacing-big #tm-site h1,
body.tm-a11y.tm-a11y-spacing-big #tm-site h2,
body.tm-a11y.tm-a11y-spacing-big #tm-site h3,
body.tm-a11y.tm-a11y-spacing-big #tm-site h4,
body.tm-a11y.tm-a11y-spacing-big #tm-site a,
body.tm-a11y.tm-a11y-spacing-big #tm-site span,
body.tm-a11y.tm-a11y-spacing-big #tm-site p,
body.tm-a11y.tm-a11y-spacing-big #tm-site div,
body.tm-a11y.tm-a11y-spacing-big #tm-site li { line-height: 2.5 !important; }

/* --- Кернинг --- */
body.tm-a11y.tm-a11y-kerning-small #tm-site h1,
body.tm-a11y.tm-a11y-kerning-small #tm-site h2,
body.tm-a11y.tm-a11y-kerning-small #tm-site h3,
body.tm-a11y.tm-a11y-kerning-small #tm-site h4,
body.tm-a11y.tm-a11y-kerning-small #tm-site a,
body.tm-a11y.tm-a11y-kerning-small #tm-site span,
body.tm-a11y.tm-a11y-kerning-small #tm-site p,
body.tm-a11y.tm-a11y-kerning-small #tm-site div,
body.tm-a11y.tm-a11y-kerning-small #tm-site li { letter-spacing: normal !important; }
body.tm-a11y.tm-a11y-kerning-medium #tm-site h1,
body.tm-a11y.tm-a11y-kerning-medium #tm-site h2,
body.tm-a11y.tm-a11y-kerning-medium #tm-site h3,
body.tm-a11y.tm-a11y-kerning-medium #tm-site h4,
body.tm-a11y.tm-a11y-kerning-medium #tm-site a,
body.tm-a11y.tm-a11y-kerning-medium #tm-site span,
body.tm-a11y.tm-a11y-kerning-medium #tm-site p,
body.tm-a11y.tm-a11y-kerning-medium #tm-site div,
body.tm-a11y.tm-a11y-kerning-medium #tm-site li { letter-spacing: .2em !important; }
body.tm-a11y.tm-a11y-kerning-big #tm-site h1,
body.tm-a11y.tm-a11y-kerning-big #tm-site h2,
body.tm-a11y.tm-a11y-kerning-big #tm-site h3,
body.tm-a11y.tm-a11y-kerning-big #tm-site h4,
body.tm-a11y.tm-a11y-kerning-big #tm-site a,
body.tm-a11y.tm-a11y-kerning-big #tm-site span,
body.tm-a11y.tm-a11y-kerning-big #tm-site p,
body.tm-a11y.tm-a11y-kerning-big #tm-site div,
body.tm-a11y.tm-a11y-kerning-big #tm-site li { letter-spacing: .4em !important; }
