/* Версия для слабовидящих: панель настроек и режимы (классы на <html> ставит a11y.js).
   a11y-on - режим включен; a11y-fs-1..3 - размер шрифта (сам размер ставит скрипт);
   a11y-c-bw / wb / blue - цветовая схема; a11y-img-off - без картинок; a11y-sp - интервалы. */

/* ---------------- кнопка в шапке ---------------- */
.a11y-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(106, 110, 118, 0.3);
    border-radius: 50%;
    background: #fff;
    color: #232323;
    font-size: 17px;
    cursor: pointer;
}
.a11y-btn:hover,
.a11y-btn:focus-visible { border-color: #232323; }
.a11y-btn--menu {
    width: auto;
    height: auto;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 15px;
}

/* ---------------- панель ---------------- */
.a11y-panel { display: none; }
html.a11y-on .a11y-panel {
    display: block;
    position: relative;
    z-index: 1060;
    padding: 10px 0;
    border-bottom: 2px solid currentColor;
    background: #fff;
    color: #000;
    font-family: Arial, sans-serif;
}
.a11y-panel__in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
}
.a11y-grp {
    display: flex;
    align-items: center;
    gap: 6px;
}
.a11y-lbl {
    margin-right: 4px;
    font-size: 17px;
    font-weight: 700;
}
.a11y-opt,
.a11y-exit {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 2px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.a11y-opt--fs2 { font-size: 20px; }
.a11y-opt--fs3 { font-size: 23px; }
.a11y-opt[aria-pressed="true"] {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}
.a11y-exit { margin-left: auto; }

/* образцы цветовых схем: у кнопок свои цвета в любой схеме */
html.a11y-on #a11yPanel .a11y-sw--bw { background: #fff !important; color: #000 !important; border-color: #000 !important; }
html.a11y-on #a11yPanel .a11y-sw--wb { background: #000 !important; color: #fff !important; border-color: #000 !important; }
html.a11y-on #a11yPanel .a11y-sw--blue { background: #9dd1ff !important; color: #063462 !important; border-color: #063462 !important; }

/* ---------------- общее для режима ---------------- */
html.a11y-on :focus-visible {
    outline: 3px solid currentColor !important;
    outline-offset: 2px !important;
}
/* без анимаций: прыжок сразу в конечное состояние */
html.a11y-on *,
html.a11y-on *::before,
html.a11y-on *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
}
html.a11y-on .wow { visibility: visible !important; }
/* с крупным шрифтом шапка и кнопки растут по содержимому */
html.a11y-on .navbar { height: auto !important; min-height: 64px; }
html.a11y-on .navbar > .container { flex-wrap: wrap; }
html.a11y-fs-2 .navbar-expand-lg .navbar-nav,
html.a11y-fs-3 .navbar-expand-lg .navbar-nav { flex-wrap: wrap; }
html.a11y-on .navbar .nav-link { white-space: normal; }

/* ---------------- цветовые схемы ---------------- */
/* :not(#a11y-none) добавляет вес уровня id: часть правил темы тоже с !important */
html.a11y-c-bw { --a11y-fg: #000; --a11y-bg: #fff; }
html.a11y-c-wb { --a11y-fg: #fff; --a11y-bg: #000; }
html.a11y-c-blue { --a11y-fg: #063462; --a11y-bg: #9dd1ff; }

html.a11y-c-bw body, html.a11y-c-wb body, html.a11y-c-blue body,
html.a11y-c-bw body *:not(#a11y-none), html.a11y-c-wb body *:not(#a11y-none), html.a11y-c-blue body *:not(#a11y-none) {
    background-color: var(--a11y-bg) !important;
    background-image: none !important;
    color: var(--a11y-fg) !important;
    border-color: var(--a11y-fg) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor !important;
}
html.a11y-c-bw body *:not(#a11y-none)::before, html.a11y-c-wb body *:not(#a11y-none)::before, html.a11y-c-blue body *:not(#a11y-none)::before,
html.a11y-c-bw body *:not(#a11y-none)::after, html.a11y-c-wb body *:not(#a11y-none)::after, html.a11y-c-blue body *:not(#a11y-none)::after {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border-color: var(--a11y-fg) !important;
}
html.a11y-c-bw a:not(#a11y-none), html.a11y-c-wb a:not(#a11y-none), html.a11y-c-blue a:not(#a11y-none) { text-decoration: underline !important; }
/* кнопки, у которых была только заливка, получают рамку */
html.a11y-c-bw body :is(button, [class*="btn"], [class*="butn"], .mobile-cta-bar a):not(#a11y-none),
html.a11y-c-wb body :is(button, [class*="btn"], [class*="butn"], .mobile-cta-bar a):not(#a11y-none),
html.a11y-c-blue body :is(button, [class*="btn"], [class*="butn"], .mobile-cta-bar a):not(#a11y-none) {
    border: 2px solid var(--a11y-fg) !important;
}
html.a11y-c-bw img:not(#a11y-none), html.a11y-c-wb img:not(#a11y-none), html.a11y-c-blue img:not(#a11y-none) { background-color: transparent !important; }
/* темный логотип на черном фоне */
html.a11y-c-wb .logo-img { filter: invert(1); }
/* затемняющие подложки фоновых картинок больше не нужны */
html.a11y-c-bw [data-overlay-dark]::before, html.a11y-c-wb [data-overlay-dark]::before,
html.a11y-c-blue [data-overlay-dark]::before { display: none !important; }

/* ---------------- без картинок ---------------- */
.a11y-alt { display: none; }
html.a11y-img-off img:not(.logo-img),
html.a11y-img-off video,
html.a11y-img-off picture {
    display: none !important;
}
html.a11y-img-off .bg-img,
html.a11y-img-off [data-background] {
    background-image: none !important;
}
html.a11y-img-off .a11y-alt {
    display: inline-block;
    padding: 4px 8px;
    border: 1px dashed currentColor;
    font-style: italic;
}

/* ---------------- интервалы ---------------- */
html.a11y-sp body *:not(i):not([class*="fa-"]):not(#a11y-none) {
    letter-spacing: 0.08em !important;
    word-spacing: 0.16em !important;
    line-height: 1.8 !important;
}

@media (max-width: 767px) {
    .a11y-panel__in { gap: 8px 14px; }
    .a11y-exit { margin-left: 0; }
}

/* кнопка в мобильном меню; десктопная кнопка живет в .navbar-right, которую тема прячет на мобиле */
.a11y-mobile { display: none; }
@media (max-width: 991px) {
    .a11y-mobile { display: block; padding: 12px 0 4px; }
}
