/*
 * Accessibility mode (GOST R 52872): toggled by the "eye" button, applied to every page
 * through data-a11y-* attributes on <html>: font size, color scheme, images, spacing.
 */

/* Settings panel */
.a11y-panel {
    background: #fff;
    border-bottom: 3px solid #000;
    color: #000;
}

.a11y-panel[hidden] {
    display: none;
}

.a11y-panel__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    padding-top: 12px;
    padding-bottom: 12px;
}

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

.a11y-panel__label {
    margin-right: 4px;
    font-size: 16px;
    font-weight: 700;
}

.a11y-panel__btn,
.a11y-panel__exit {
    min-width: 40px;
    padding: 6px 12px;
    border: 2px solid #000;
    border-radius: 4px;
    background: #fff;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.a11y-panel__btn.is-active {
    outline: 3px solid var(--color-accent-gold);
    outline-offset: 2px;
}

.a11y-panel__btn--font-1 { font-size: 15px; }
.a11y-panel__btn--font-2 { font-size: 19px; }
.a11y-panel__btn--font-3 { font-size: 23px; }

/* Swatches keep their own colors in every scheme, hence the extra specificity. */
html .a11y-panel .a11y-panel__btn--scheme-bw { background: #fff !important; color: #000 !important; border-color: #000 !important; }
html .a11y-panel .a11y-panel__btn--scheme-wb { background: #000 !important; color: #fff !important; border-color: #fff !important; }
html .a11y-panel .a11y-panel__btn--scheme-blue { background: #9dd1ff !important; color: #063462 !important; border-color: #063462 !important; }

.a11y-panel__exit {
    margin-left: auto;
}

/* Common rules of the mode */
html[data-a11y="on"] body,
html[data-a11y="on"] body * {
    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"] img {
    filter: grayscale(100%);
}

/* Font size */
html[data-a11y-font="2"] body { zoom: 1.2; }
html[data-a11y-font="3"] body { zoom: 1.4; }

/* Color schemes */
html[data-a11y-scheme="bw"] body,
html[data-a11y-scheme="bw"] body * {
    background-color: #fff !important;
    background-image: none !important;
    color: #000 !important;
    border-color: #000 !important;
}

html[data-a11y-scheme="wb"] body,
html[data-a11y-scheme="wb"] body * {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
}

html[data-a11y-scheme="blue"] body,
html[data-a11y-scheme="blue"] body * {
    background-color: #9dd1ff !important;
    background-image: none !important;
    color: #063462 !important;
    border-color: #063462 !important;
}

/* Images off */
html[data-a11y-images="off"] img,
html[data-a11y-images="off"] picture,
html[data-a11y-images="off"] iframe {
    display: none !important;
}

/* Wide spacing */
html[data-a11y-spacing="wide"] body * {
    letter-spacing: .12em !important;
    word-spacing: .2em !important;
    line-height: 1.8 !important;
}
