/* ===== ВЕРСИЯ ДЛЯ СЛАБОВИДЯЩИХ ===== */

/* --------------------------------------------------
   Кнопка-триггер — всегда видна, снизу слева
-------------------------------------------------- */
#accessibility-toggle-btn {
    position: fixed;
    bottom: 0;
    left: 20px;
    z-index: 100001;
    background: #007F13;
    color: #fff;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 7px 16px 9px;
    cursor: pointer;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.4;
    transition: background 0.2s;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.25);
    white-space: nowrap;
}
#accessibility-toggle-btn:hover {
    background: #005c0e;
}
#accessibility-toggle-btn .a11y-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='4' r='2'/%3E%3Cpath d='M19 7h-6l-1 5 3 2-1 6h-2l1-5-3-2-1 5H7l1-5-3-2 1-4H2v-2h20v2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* --------------------------------------------------
   Панель настроек — фиксирована над кнопкой, открывается вверх
   bottom: 42px = примерная высота кнопки
-------------------------------------------------- */
#accessibility-bar {
    position: fixed;
    bottom: 42px;
    left: 0;
    right: 0;
    z-index: 100000;
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 6px;
    flex-wrap: wrap;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.5);
    transition: transform 0.25s ease;
}

/* Скрыта — уезжает вниз за кнопку */
#accessibility-bar.a11y-hidden {
    transform: translateY(calc(100% + 42px));
    pointer-events: none;
}

#accessibility-bar label {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    margin-right: 2px;
    user-select: none;
}

.a11y-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 12px;
    border-right: 1px solid #444;
    margin-right: 2px;
}
.a11y-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-left: auto;
}

#accessibility-bar button {
    background: #2e2e2e;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: Arial, sans-serif;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}
#accessibility-bar button:hover {
    background: #484848;
    border-color: #888;
}
#accessibility-bar button.a11y-active {
    background: #007F13;
    border-color: #007F13;
    color: #fff;
}

/* Отступ снизу когда панель открыта, чтобы контент не прятался */
body.a11y-bar-open {
    padding-bottom: 100px !important;
}

/* ===================================
   ЦВЕТОВЫЕ СХЕМЫ
   =================================== */

/* Белый фон + чёрный текст */
body.a11y-contrast-bw,
body.a11y-contrast-bw .wrap_content,
body.a11y-contrast-bw .header,
body.a11y-contrast-bw .footer,
body.a11y-contrast-bw .container,
body.a11y-contrast-bw .mainHeaderMenu,
body.a11y-contrast-bw section,
body.a11y-contrast-bw article,
body.a11y-contrast-bw div,
body.a11y-contrast-bw p,
body.a11y-contrast-bw span,
body.a11y-contrast-bw li,
body.a11y-contrast-bw td,
body.a11y-contrast-bw th {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
body.a11y-contrast-bw a {
    color: #0000cc !important;
}
body.a11y-contrast-bw a:visited {
    color: #551a8b !important;
}
body.a11y-contrast-bw img {
    filter: grayscale(30%) contrast(1.1);
}

/* Чёрный фон + белый текст */
body.a11y-contrast-wb,
body.a11y-contrast-wb .wrap_content,
body.a11y-contrast-wb .header,
body.a11y-contrast-wb .footer,
body.a11y-contrast-wb .container,
body.a11y-contrast-wb .mainHeaderMenu,
body.a11y-contrast-wb section,
body.a11y-contrast-wb article,
body.a11y-contrast-wb div,
body.a11y-contrast-wb p,
body.a11y-contrast-wb span,
body.a11y-contrast-wb li,
body.a11y-contrast-wb td,
body.a11y-contrast-wb th {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
body.a11y-contrast-wb a {
    color: #ffff00 !important;
}
body.a11y-contrast-wb a:visited {
    color: #ffa500 !important;
}
body.a11y-contrast-wb img {
    filter: invert(1) grayscale(50%);
}

/* Сепия */
body.a11y-contrast-sepia,
body.a11y-contrast-sepia .wrap_content,
body.a11y-contrast-sepia .header,
body.a11y-contrast-sepia .footer,
body.a11y-contrast-sepia .container,
body.a11y-contrast-sepia .mainHeaderMenu,
body.a11y-contrast-sepia section,
body.a11y-contrast-sepia article,
body.a11y-contrast-sepia div,
body.a11y-contrast-sepia p,
body.a11y-contrast-sepia span,
body.a11y-contrast-sepia li,
body.a11y-contrast-sepia td,
body.a11y-contrast-sepia th {
    background-color: #f8f0dc !important;
    color: #3b2a1a !important;
    border-color: #8b6f47 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
body.a11y-contrast-sepia a {
    color: #7a3b00 !important;
}
body.a11y-contrast-sepia img {
    filter: sepia(40%);
}

/* Панель и кнопка не трогаются цветовыми схемами */
body.a11y-contrast-bw #accessibility-bar,
body.a11y-contrast-bw #accessibility-bar *,
body.a11y-contrast-bw #accessibility-toggle-btn,
body.a11y-contrast-wb #accessibility-bar,
body.a11y-contrast-wb #accessibility-bar *,
body.a11y-contrast-wb #accessibility-toggle-btn,
body.a11y-contrast-sepia #accessibility-bar,
body.a11y-contrast-sepia #accessibility-bar *,
body.a11y-contrast-sepia #accessibility-toggle-btn {
    background-color: unset !important;
    color: unset !important;
    border-color: unset !important;
}
#accessibility-bar button.a11y-active {
    background: #007F13 !important;
    border-color: #007F13 !important;
    color: #fff !important;
}

/* ===================================
   РАЗМЕР ШРИФТА
   А+  = ×1.5  (150% от базового 16px → 24px)
   А++ = ×2.0  (200% от базового 16px → 32px)
   =================================== */
body.a11y-font-large p,
body.a11y-font-large span,
body.a11y-font-large a,
body.a11y-font-large li,
body.a11y-font-large td,
body.a11y-font-large th,
body.a11y-font-large div {
    font-size: 24px !important;
    line-height: 1.6 !important;
}
body.a11y-font-large h1 { font-size: 42px !important; }
body.a11y-font-large h2 { font-size: 36px !important; }
body.a11y-font-large h3 { font-size: 30px !important; }

body.a11y-font-xlarge p,
body.a11y-font-xlarge span,
body.a11y-font-xlarge a,
body.a11y-font-xlarge li,
body.a11y-font-xlarge td,
body.a11y-font-xlarge th,
body.a11y-font-xlarge div {
    font-size: 32px !important;
    line-height: 1.7 !important;
}
body.a11y-font-xlarge h1 { font-size: 56px !important; }
body.a11y-font-xlarge h2 { font-size: 48px !important; }
body.a11y-font-xlarge h3 { font-size: 40px !important; }

/* Не применять к панели и кнопке */
body.a11y-font-large #accessibility-bar,
body.a11y-font-large #accessibility-bar *,
body.a11y-font-large #accessibility-toggle-btn,
body.a11y-font-xlarge #accessibility-bar,
body.a11y-font-xlarge #accessibility-bar *,
body.a11y-font-xlarge #accessibility-toggle-btn {
    font-size: 13px !important;
    line-height: 1.4 !important;
}

/* ===================================
   МЕЖБУКВЕННЫЙ ИНТЕРВАЛ
   =================================== */
body.a11y-letter-spacing p,
body.a11y-letter-spacing span,
body.a11y-letter-spacing a,
body.a11y-letter-spacing li,
body.a11y-letter-spacing h1,
body.a11y-letter-spacing h2,
body.a11y-letter-spacing h3,
body.a11y-letter-spacing td {
    letter-spacing: 0.12em !important;
    word-spacing: 0.25em !important;
}

/* ===================================
   МЕЖСТРОЧНЫЙ ИНТЕРВАЛ
   =================================== */
body.a11y-line-height p,
body.a11y-line-height span,
body.a11y-line-height li,
body.a11y-line-height a,
body.a11y-line-height td {
    line-height: 2.2 !important;
}

/* ===================================
   СКРЫТЬ ИЗОБРАЖЕНИЯ
   =================================== */
body.a11y-no-images img {
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    display: inline-block !important;
}
