/*Специальные возможности. Подключается после app.css и ничего не меняет,
  пока на <html> не появится класс a11y-*: любое правило ниже либо описывает
  саму панель (.a11y-root и её потомки), либо начинается с html.a11y-.

  Требование ПП-266 от 18.07.2024: контраст, увеличение шрифта, озвучивание.*/

/* ------------------------------------------------------------------ */
/*  1. Кнопка вызова и панель                                          */
/* ------------------------------------------------------------------ */

.a11y-fab {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 2147483000;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1d4077;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    transition: background-color .15s, transform .15s;
}
.a11y-fab:hover,
.a11y-fab:focus {
    background: #0d57a2;
    transform: scale(1.06);
    outline: 3px solid #ffb300;
    outline-offset: 2px;
}

.a11y-overlay {
    position: fixed;
    z-index: 2147483000;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, .45);
}

.a11y-panel {
    position: fixed;
    z-index: 2147483001;
    top: 0;
    bottom: 0;
    left: 0;
    width: 360px;
    max-width: 100%;
    background: #2b2b33;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .4);
    /*Панель уезжает за край, а не прячется display:none - иначе ng-if
      пересоздавал бы её и терял фокус.*/
    transform: translateX(-100%);
    transition: transform .22s ease-in-out;
    overflow-y: auto;
}
.a11y-panel.is-open { transform: translateX(0); }

.a11y-head {
    position: relative;
    padding: 18px 54px 16px 20px;
    border-bottom: 1px solid #3d3d47;
}
.a11y-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}
.a11y-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #4a4a55;
    border-radius: 4px;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.a11y-close:hover,
.a11y-close:focus { background: #3d3d47; outline: 2px solid #ffb300; }

.a11y-body { padding: 4px 20px 24px; }

.a11y-sec {
    padding: 16px 0;
    border-bottom: 1px solid #3d3d47;
}
.a11y-sec--last { border-bottom: 0; }
.a11y-sec h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #ffb300;
}
.a11y-note {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #b6b6c2;
}

.a11y-switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 128px;
    padding: 7px 14px 7px 9px;
    border: 1px solid #4a4a55;
    border-radius: 20px;
    background: #353541;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.a11y-switch__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6b6b7a;
    transition: background-color .15s;
}
.a11y-switch.is-on { border-color: #ffb300; background: #4a3f22; }
.a11y-switch.is-on .a11y-switch__dot { background: #ffb300; }
.a11y-switch:focus { outline: 2px solid #ffb300; outline-offset: 2px; }

.a11y-steps { display: flex; gap: 6px; }
.a11y-step {
    flex: 1 1 0;
    padding: 9px 2px;
    border: 1px solid #4a4a55;
    border-radius: 4px;
    background: #353541;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}
.a11y-step.is-on { border-color: #ffb300; background: #4a3f22; color: #ffd27a; }
.a11y-step:focus { outline: 2px solid #ffb300; outline-offset: 1px; }

.a11y-row { display: flex; gap: 6px; margin-top: 10px; }
.a11y-btn {
    flex: 1 1 auto;
    padding: 8px 10px;
    border: 1px solid #4a4a55;
    border-radius: 4px;
    background: #353541;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.a11y-btn:hover:not([disabled]) { background: #43434f; }
.a11y-btn:focus { outline: 2px solid #ffb300; outline-offset: 1px; }
.a11y-btn[disabled] { opacity: .45; cursor: default; }
.a11y-btn--wide { width: 100%; }

.a11y-voice { display: block; margin-top: 12px; font-size: 13px; font-weight: 400; }
.a11y-voice select {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 7px 8px;
    border: 1px solid #4a4a55;
    border-radius: 4px;
    background: #353541;
    color: #fff;
}

.a11y-speak {
    position: fixed;
    z-index: 2147483002;
    padding: 6px 12px;
    border: 0;
    border-radius: 4px;
    background: #1d4077;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}
.a11y-speak i { margin-right: 6px; }

@media (max-width: 600px) {
    .a11y-panel { width: 100%; }
}

/*Печать панели не касается.*/
@media print {
    .a11y-root { display: none !important; }
}

/* ------------------------------------------------------------------ */
/*  2. Размер шрифта                                                   */
/* ------------------------------------------------------------------ */

/*В каскаде проекта нет ни одного rem при html{font-size:10px}, поэтому
  увеличение базового кегля ничего не даёт. zoom масштабирует и текст, и
  коробки: фиксированная шапка и компенсирующий её padding-top контейнера
  остаются согласованными сами собой.*/
html.a11y-font-1 #header,
html.a11y-font-1 .main-container { zoom: 1.25; }
html.a11y-font-2 #header,
html.a11y-font-2 .main-container { zoom: 1.5; }
html.a11y-font-3 #header,
html.a11y-font-3 .main-container { zoom: 2; }

/*Без этого расширившийся контент обрежется: в app.css:1830 у контейнера
  стоит overflow: hidden.*/
html.a11y-font-1 .app > .main-container > .content-container,
html.a11y-font-2 .app > .main-container > .content-container,
html.a11y-font-3 .app > .main-container > .content-container {
    overflow: auto !important;
}

/*Боковое меню висит на slimScroll, который измеряет высоту один раз при
  инициализации. После увеличения нижние пункты оказались бы за обрезкой.*/
html.a11y-font-1 .slimScrollDiv,
html.a11y-font-2 .slimScrollDiv,
html.a11y-font-3 .slimScrollDiv,
html.a11y-font-1 #nav,
html.a11y-font-2 #nav,
html.a11y-font-3 #nav {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
html.a11y-font-1 .slimScrollBar,
html.a11y-font-2 .slimScrollBar,
html.a11y-font-3 .slimScrollBar { display: none !important; }

/*Увеличение - для экрана. В распечатках и в xerox масштаб обычный.*/
@media print {
    html.a11y-font-1 #header, html.a11y-font-1 .main-container,
    html.a11y-font-2 #header, html.a11y-font-2 .main-container,
    html.a11y-font-3 #header, html.a11y-font-3 .main-container {
        zoom: normal !important;
    }
}

/* ------------------------------------------------------------------ */
/*  3. Высококонтрастный вид                                           */
/* ------------------------------------------------------------------ */

html.a11y-contrast,
html.a11y-contrast body {
    background: #000 !important;
    color: #fff !important;
}

/*Принудительная палитра поверх всего. Перекрашивать три слоя стилей
  (Bootstrap, Angular Material, Kendo) по одному цвету нереально: там около
  290 разных значений. Селектор специфичнее почти всего в проекте и бьёт
  инлайновые style="color: black" - инлайн без !important проигрывает.*/
html.a11y-contrast *:not(.a11y-root):not(.a11y-root *) {
    background-color: transparent !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/*Правило выше до псевдоэлементов не достаёт, а их в трёх слоях стилей
  около двухсот. Самый заметный - .page-signin .body-inner:before
  (styles/app.css:1207): светлая плашка под формой входа, на которой белый
  текст становится нечитаемым.*/
html.a11y-contrast *:not(.a11y-root):not(.a11y-root *)::before,
html.a11y-contrast *:not(.a11y-root):not(.a11y-root *)::after {
    background-color: transparent !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
}

html.a11y-contrast a,
html.a11y-contrast a *,
html.a11y-contrast .btn-link {
    color: #ffd800 !important;
    text-decoration: underline !important;
}

html.a11y-contrast input,
html.a11y-contrast select,
html.a11y-contrast textarea,
html.a11y-contrast .form-control,
html.a11y-contrast .btn,
html.a11y-contrast .md-button {
    border: 2px solid #fff !important;
    background: #000 !important;
    color: #fff !important;
}

html.a11y-contrast ::-webkit-input-placeholder { color: #cfcfcf !important; }
html.a11y-contrast ::placeholder { color: #cfcfcf !important; }

/*Единственное правило во всём проекте, которое по специфичности выигрывает
  у палитры выше (styles/ui.css:8) - декоративная рамка карточек стажировок.*/
html.a11y-contrast .panel-student > .panel-heading + .panel-collapse > .panel-body,
html.a11y-contrast .panel-student > .panel-footer + .panel-collapse > .panel-body {
    border-top-color: #fff !important;
}

/*Фотографии и логотипы не перекрашиваем: в head_logo.svg и logo2.svg текст
  переведён в кривые цветом #1D1D1B и на чёрном фоне просто исчез бы.
  Вместо фильтра даём белую подложку.*/
html.a11y-contrast img,
html.a11y-contrast .head_logo,
html.a11y-contrast .logo-icon {
    background: #fff !important;
    border: 1px solid #fff !important;
}

/*График рисуется в canvas, CSS до его подписей не достаёт - оставляем
  читаемым островом на белом.*/
html.a11y-contrast .ds-chart,
html.a11y-contrast .ds-chart * {
    background: #fff !important;
}

html.a11y-contrast .a11y-fab {
    background: #000 !important;
    border-color: #ffd800 !important;
    color: #ffd800 !important;
}

/* ------------------------------------------------------------------ */
/*  4. Видимый фокус с клавиатуры                                      */
/* ------------------------------------------------------------------ */

/*В ui.css и app.css выключение контура встречается девять раз. Возвращаем
  его только для клавиатуры: :focus-visible не срабатывает на клик мышью,
  поэтому вид страницы для обычного пользователя не меняется.*/
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.md-button:focus-visible {
    outline: 3px solid #ffb300 !important;
    outline-offset: 2px !important;
}
html.a11y-contrast a:focus-visible,
html.a11y-contrast button:focus-visible,
html.a11y-contrast input:focus-visible,
html.a11y-contrast select:focus-visible,
html.a11y-contrast textarea:focus-visible {
    outline-color: #ffd800 !important;
}

/*Ссылка «к содержимому» для клавиатуры: видна только при фокусе.*/
.a11y-skip {
    position: fixed;
    z-index: 2147483002;
    top: -60px;
    left: 12px;
    padding: 10px 16px;
    background: #1d4077;
    color: #fff;
    border-radius: 0 0 4px 4px;
    transition: top .15s;
}
.a11y-skip:focus {
    top: 0;
    color: #fff;
    text-decoration: none;
}
