/* ===== Версия для слабовидящих ===== */

/* Кнопка в шапке */
.a11y-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    line-height: 1;
}

.a11y-toggle:hover {
    color: #bf994a;
}

/* Панель настроек: цвета через переменные, следуют теме / цветовой схеме */
.a11y-panel {
    --a11y-bg: #fff;
    --a11y-fg: #000;
    --a11y-accent: #bf994a;
    display: none;
    position: relative;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--a11y-bg) !important;
    color: var(--a11y-fg) !important;
    border-bottom: 2px solid var(--a11y-fg) !important;
    font: 16px/1.4 Arial, Helvetica, sans-serif !important;
    letter-spacing: normal !important;
}

html[data-theme="dark"] .a11y-panel { --a11y-bg: #16181c; --a11y-fg: #e2e2e2; }
html[data-a11y-color="bw"] .a11y-panel { --a11y-bg: #fff; --a11y-fg: #000; }
html[data-a11y-color="wb"] .a11y-panel { --a11y-bg: #000; --a11y-fg: #fff; }
html[data-a11y-color="blue"] .a11y-panel { --a11y-bg: #9dd1ff; --a11y-fg: #063462; }
html[data-a11y-color="brown"] .a11y-panel { --a11y-bg: #f7f3d6; --a11y-fg: #4d4b43; }

html[data-a11y="on"] .a11y-panel {
    display: block;
}

html[data-a11y="on"] .site-header.fixed {
    position: relative !important;
}

.a11y-panel__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto 10px;
}

.a11y-panel__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Свёрнутая панель */
html[data-a11y-collapsed="1"] .a11y-panel__inner { display: none; }
html[data-a11y-collapsed="1"] .a11y-panel__bar { margin-bottom: 0; }
.a11y-panel__collapse-text--collapsed,
html[data-a11y-collapsed="1"] .a11y-panel__collapse-text { display: none; }
html[data-a11y-collapsed="1"] .a11y-panel__collapse-text--collapsed { display: inline; }

.a11y-panel .a11y-panel__collapse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.a11y-panel__arrow {
    width: 10px;
    height: 10px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translateY(3px) rotate(-135deg);
}

html[data-a11y-collapsed="1"] .a11y-panel__arrow {
    transform: translateY(-3px) rotate(45deg);
}

.a11y-panel__group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.a11y-panel__label {
    font-weight: bold;
    margin-right: 4px;
}

.a11y-panel button {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 2px solid var(--a11y-fg) !important;
    border-radius: 4px;
    background: var(--a11y-bg) !important;
    color: var(--a11y-fg) !important;
    font: bold 16px/1 Arial, Helvetica, sans-serif !important;
    cursor: pointer;
    background-image: none !important;
}

.a11y-panel button[aria-pressed="true"] {
    outline: 3px solid var(--a11y-accent) !important;
    outline-offset: 2px;
}

.a11y-panel button:focus-visible {
    outline: 3px solid #1a5fd6 !important;
    outline-offset: 2px;
}

.a11y-panel .a11y-c-site { background: linear-gradient(135deg, #fff 50%, #16181c 50%) !important; color: #bf994a !important; border-color: #bf994a !important; }
.a11y-panel .a11y-c-bw { background: #fff !important; color: #000 !important; border-color: #000 !important; }
.a11y-panel .a11y-c-wb { background: #000 !important; color: #fff !important; border-color: #fff !important; box-shadow: 0 0 0 1px #000 !important; }
.a11y-panel .a11y-c-blue { background: #9dd1ff !important; color: #063462 !important; border-color: #063462 !important; }
.a11y-panel .a11y-c-brown { background: #f7f3d6 !important; color: #4d4b43 !important; border-color: #4d4b43 !important; }

/* ---- Общие правила режима ---- */
html[data-a11y="on"] body,
html[data-a11y="on"] body *:not(.icon):not([class^="icon-"]):not([class*=" icon-"]):not(.social-button) {
    font-family: Arial, Helvetica, sans-serif !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html[data-a11y="on"] a {
    text-decoration: underline !important;
}

html[data-a11y="on"] *:focus-visible {
    outline: 3px solid currentColor !important;
    outline-offset: 2px;
}

html[data-a11y="on"] *,
html[data-a11y="on"] *::before,
html[data-a11y="on"] *::after {
    animation: none !important;
    transition: none !important;
}

/* ---- Размер шрифта (масштаб страницы) ---- */
html[data-a11y="on"][data-a11y-size="2"] #page { zoom: 1.25; }
html[data-a11y="on"][data-a11y-size="3"] #page { zoom: 1.5; }

/* ---- Межбуквенный интервал ---- */
html[data-a11y="on"][data-a11y-spacing="2"] #page * { letter-spacing: .1em !important; word-spacing: .2em !important; line-height: 1.6 !important; }
html[data-a11y="on"][data-a11y-spacing="3"] #page * { letter-spacing: .2em !important; word-spacing: .4em !important; line-height: 1.8 !important; }

/* ---- Цветовые схемы ---- */
html[data-a11y="on"]:is([data-a11y-color="bw"], [data-a11y-color="wb"], [data-a11y-color="blue"], [data-a11y-color="brown"]) #page,
html[data-a11y="on"]:is([data-a11y-color="bw"], [data-a11y-color="wb"], [data-a11y-color="blue"], [data-a11y-color="brown"]) #page * {
    background-image: none !important;
}

html[data-a11y="on"][data-a11y-color="bw"] { color-scheme: light; }
html[data-a11y="on"][data-a11y-color="bw"] body,
html[data-a11y="on"][data-a11y-color="bw"] #page,
html[data-a11y="on"][data-a11y-color="bw"] #page * {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    fill: currentColor;
}

html[data-a11y="on"][data-a11y-color="wb"] { color-scheme: dark; }
html[data-a11y="on"][data-a11y-color="wb"] body,
html[data-a11y="on"][data-a11y-color="wb"] #page,
html[data-a11y="on"][data-a11y-color="wb"] #page * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    fill: currentColor;
}

html[data-a11y="on"][data-a11y-color="blue"] { color-scheme: light; }
html[data-a11y="on"][data-a11y-color="blue"] body,
html[data-a11y="on"][data-a11y-color="blue"] #page,
html[data-a11y="on"][data-a11y-color="blue"] #page * {
    background-color: #9dd1ff !important;
    color: #063462 !important;
    border-color: #063462 !important;
    fill: currentColor;
}

html[data-a11y="on"][data-a11y-color="brown"] { color-scheme: light; }
html[data-a11y="on"][data-a11y-color="brown"] body,
html[data-a11y="on"][data-a11y-color="brown"] #page,
html[data-a11y="on"][data-a11y-color="brown"] #page * {
    background-color: #f7f3d6 !important;
    color: #4d4b43 !important;
    border-color: #4d4b43 !important;
    fill: currentColor;
}

/* ---- Изображения ---- */
html[data-a11y="on"][data-a11y-images="off"] #page img,
html[data-a11y="on"][data-a11y-images="off"] #page picture,
html[data-a11y="on"][data-a11y-images="off"] #page video,
html[data-a11y="on"][data-a11y-images="off"] #page iframe,
html[data-a11y="on"][data-a11y-images="off"] #page .swiper-slide img {
    display: none !important;
}

html[data-a11y="on"][data-a11y-images="off"] #page * {
    background-image: none !important;
}

@media (max-width: 768px) {
    .a11y-panel__inner { gap: 10px 16px; }
    .a11y-panel__label { width: 100%; }
}
