/* Эффекты панели «для слабовидящих» — палитра, контраст, фокус (после site-theme.css) */

html[data-a11y-on] body {
  background: var(--theme-bg) !important;
  color: var(--theme-text);
}

/* Окно настроек — всегда светлое, не наследует тёмную палитру страницы */
html[data-a11y-on] #access-toolbar.voi-a11y-panel {
  --theme-bg: #ffffff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f8fafc;
  --theme-text: #0f172a;
  --theme-muted: #64748b;
  --theme-border: #cbd5e1;
  --theme-primary: #1e40af;
  --theme-primary-soft: #e8efff;
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-a11y-on][data-a11y-contrast="high"] body::before,
html[data-a11y-on][data-a11y-motion="off"] body::before {
  display: none !important;
}

html[data-a11y-on] main,
html[data-a11y-on] .official-footer {
  color: var(--theme-text);
}

html[data-a11y-on] main,
html[data-a11y-on] main .hero,
html[data-a11y-on] main .hero-card,
html[data-a11y-on] main .section,
html[data-a11y-on] main .container {
  color: var(--theme-text);
}

html[data-a11y-on] main h1,
html[data-a11y-on] main h2,
html[data-a11y-on] main h3,
html[data-a11y-on] main h4,
html[data-a11y-on] main #siteTitle,
html[data-a11y-on] main .hero h1,
html[data-a11y-on] main p,
html[data-a11y-on] main li,
html[data-a11y-on] main label,
html[data-a11y-on] main span,
html[data-a11y-on] main a,
html[data-a11y-on] main button,
html[data-a11y-on] main .hero-card {
  color: var(--theme-text) !important;
}

html[data-a11y-on] main .hero p,
html[data-a11y-on] main .hero-kicker,
html[data-a11y-on] main .muted,
html[data-a11y-on] main .notice {
  color: var(--theme-muted) !important;
}

html[data-a11y-on] main .hero-card {
  background: var(--theme-surface) !important;
  background-image: none !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] main .hero-actions a {
  color: var(--theme-text) !important;
  background: var(--theme-surface-soft) !important;
  border-color: var(--theme-border) !important;
}

html[data-a11y-on] main .hero-card,
html[data-a11y-on] main .card,
html[data-a11y-on] main .events-plan-wrap,
html[data-a11y-on] main .events-plan-card,
html[data-a11y-on] main .partners-wrap,
html[data-a11y-on] main .partner-card,
html[data-a11y-on] main .home-survey,
html[data-a11y-on] main .masterclass-card,
html[data-a11y-on] main .faq-block,
html[data-a11y-on] main .faq-toc,
html[data-a11y-on] main .ner-voi-card,
html[data-a11y-on] main .service-card,
html[data-a11y-on] main .contact-item,
html[data-a11y-on] main .map-card,
html[data-a11y-on] main .kpi-item,
html[data-a11y-on] main .file-doc-row,
html[data-a11y-on] main .docs-files-toolbar,
html[data-a11y-on] main .doc-inline-dialog,
html[data-a11y-on] main .vk-news-layout,
html[data-a11y-on] main #vk-news-cards .vk-post,
html[data-a11y-on] main #vk-news-cards .card,
html[data-a11y-on] .official-footer-card {
  background: var(--theme-surface) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .vk-post p:last-child a,
html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .card p:last-child a,
html[data-a11y-on][data-a11y-scheme="dark"] .vk-cta-btn {
  background: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  border-color: var(--theme-primary) !important;
}

html[data-a11y-on] .official-footer-card h3,
html[data-a11y-on] .official-footer-card p,
html[data-a11y-on] .official-footer-card .notice {
  color: var(--theme-text) !important;
}

html[data-a11y-on] .official-footer-nav a {
  background: var(--theme-surface-soft) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-a11y-on] .official-footer-nav a:hover {
  color: #ffffff !important;
  background: color-mix(in srgb, var(--theme-primary-soft) 55%, var(--theme-surface-soft)) !important;
}

html[data-a11y-on] .qr-footer {
  background: var(--theme-surface) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-a11y-on] .qr-footer strong,
html[data-a11y-on] .qr-footer div,
html[data-a11y-on] .qr-footer .bank-details {
  color: var(--theme-text) !important;
}

html[data-a11y-on] .qr-footer .bank-details {
  color: var(--theme-muted) !important;
}

html[data-a11y-on] .qr-footer a {
  color: var(--theme-primary) !important;
}

html[data-a11y-on] .nerav-page .ner-hero-card {
  background: var(--theme-surface) !important;
  background-image: none !important;
}

html[data-a11y-on] main .muted,
html[data-a11y-on] main .hero-kicker,
html[data-a11y-on] main .notice,
html[data-a11y-on] main .events-plan-card__meta,
html[data-a11y-on] main .vk-news-meta {
  color: var(--theme-muted) !important;
}

html[data-a11y-on] main a {
  color: var(--theme-primary);
}

html[data-a11y-on] main #vk-news-cards .vk-post p:last-child a,
html[data-a11y-on] main #vk-news-cards .card p:last-child a {
  color: var(--theme-primary);
}

html[data-a11y-on][data-a11y-links-underline="on"] main a,
html[data-a11y-on][data-links="underlined"] main a {
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

/* Палитры (перекрывают data-theme) */
html[data-a11y-on][data-a11y-scheme="light"] {
  --theme-bg: #f3f6fc;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f7f9ff;
  --theme-text: #18243d;
  --theme-muted: #5f6d8c;
  --theme-primary: #243b84;
  --theme-primary-soft: #dbe4fb;
  --theme-border: #d4deef;
  color-scheme: light;
}

html[data-a11y-on][data-a11y-scheme="dark"] {
  --theme-bg: #101a30;
  --theme-surface: #16213a;
  --theme-surface-soft: #1c2948;
  --theme-text: #eef3ff;
  --theme-muted: #c7d4f3;
  --theme-primary: #8ab0ff;
  --theme-primary-soft: #243a69;
  --theme-border: #33456d;
  color-scheme: dark;
}

/* Тёмная a11y: фон страницы и блоки без светлых градиентов (в т.ч. inline-стили страниц) */
html[data-a11y-on][data-a11y-scheme="dark"],
html[data-a11y-on][data-a11y-scheme="dark"] body {
  background: var(--theme-bg) !important;
  background-color: var(--theme-bg) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] body::before {
  opacity: 0.08 !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] main .hero-card,
html[data-a11y-on][data-a11y-scheme="dark"] main .card,
html[data-a11y-on][data-a11y-scheme="dark"] main .hero-premium,
html[data-a11y-on][data-a11y-scheme="dark"] main .events-plan-wrap,
html[data-a11y-on][data-a11y-scheme="dark"] main .partners-wrap,
html[data-a11y-on][data-a11y-scheme="dark"] main .brand-note,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__q,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__grant-block,
html[data-a11y-on][data-a11y-scheme="dark"] main .masterclass-card,
html[data-a11y-on][data-a11y-scheme="dark"] main .mc-mem,
html[data-a11y-on][data-a11y-scheme="dark"] main .faq-block,
html[data-a11y-on][data-a11y-scheme="dark"] main .faq-toc,
html[data-a11y-on][data-a11y-scheme="dark"] main .service-card,
html[data-a11y-on][data-a11y-scheme="dark"] main .map-card,
html[data-a11y-on][data-a11y-scheme="dark"] main .kpi-item,
html[data-a11y-on][data-a11y-scheme="dark"] main .vk-news-layout,
html[data-a11y-on][data-a11y-scheme="dark"] main #vk-news-cards .vk-post,
html[data-a11y-on][data-a11y-scheme="dark"] main #vk-news-cards .card,
html[data-a11y-on][data-a11y-scheme="dark"] main .doc-inline-dialog,
html[data-a11y-on][data-a11y-scheme="dark"] main .docs-files-toolbar,
html[data-a11y-on][data-a11y-scheme="dark"] main .file-doc-row,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card {
  background: var(--theme-surface) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  box-shadow: none !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] main .hero-actions a,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__btn,
html[data-a11y-on][data-a11y-scheme="dark"] main .mc-submit,
html[data-a11y-on][data-a11y-scheme="dark"] main .events-plan-form .btn-e,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-nav a,
html[data-a11y-on][data-a11y-scheme="dark"] .footer-social-link {
  background: var(--theme-surface-soft) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__btn--primary,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__btn--primary:hover,
html[data-a11y-on][data-a11y-scheme="dark"] main .mc-submit,
html[data-a11y-on][data-a11y-scheme="dark"] main .events-plan-form .btn-e {
  background: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  border-color: var(--theme-primary) !important;
}

html[data-a11y-on][data-a11y-scheme="dark"] main input,
html[data-a11y-on][data-a11y-scheme="dark"] main textarea,
html[data-a11y-on][data-a11y-scheme="dark"] main select,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__txt,
html[data-a11y-on][data-a11y-scheme="dark"] main .home-survey__ta,
html[data-a11y-on][data-a11y-scheme="dark"] main .mc-form input {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-a11y-on][data-a11y-scheme="blue"] {
  --theme-bg: #e8f4ff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #edf7ff;
  --theme-text: #0f2f57;
  --theme-muted: #31537c;
  --theme-primary: #1b5fa8;
  --theme-primary-soft: #d1e8ff;
  --theme-border: #b8d4f2;
  color-scheme: light;
}

html[data-a11y-on][data-a11y-scheme="brown"] {
  --theme-bg: #f6f0e7;
  --theme-surface: #fffaf4;
  --theme-surface-soft: #f4eadc;
  --theme-text: #3e2b1d;
  --theme-muted: #6a513f;
  --theme-primary: #7b4a1f;
  --theme-primary-soft: #eddcc6;
  --theme-border: #d7bea4;
  color-scheme: light;
}

/* Высокий контраст: чёрное на белом (светлые палитры) */
html[data-a11y-on][data-a11y-contrast="high"]:not([data-a11y-scheme="dark"]) {
  --theme-bg: #ffffff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #ffffff;
  --theme-text: #000000;
  --theme-muted: #1a1a1a;
  --theme-primary: #0000cc;
  --theme-primary-soft: #e8e8ff;
  --theme-border: #000000;
  color-scheme: light;
}

/* Высокий контраст: белое на чёрном (тёмная палитра) */
html[data-a11y-on][data-a11y-contrast="high"][data-a11y-scheme="dark"] {
  --theme-bg: #000000;
  --theme-surface: #000000;
  --theme-surface-soft: #111111;
  --theme-text: #ffffff;
  --theme-muted: #f0f0f0;
  --theme-primary: #ffff00;
  --theme-primary-soft: #333300;
  --theme-border: #ffffff;
  color-scheme: dark;
}

html[data-a11y-on][data-a11y-contrast="high"] main a {
  color: #0000cc !important;
  font-weight: 700;
}

html[data-a11y-on][data-a11y-contrast="high"][data-a11y-scheme="dark"] main a {
  color: #ffff00 !important;
}

html[data-a11y-on][data-a11y-contrast="high"] main button,
html[data-a11y-on][data-a11y-contrast="high"] main .btn,
html[data-a11y-on][data-a11y-contrast="high"] main .hero-actions a {
  border: 2px solid #000000 !important;
}

html[data-a11y-on][data-a11y-motion="off"] *,
html[data-a11y-on][data-a11y-motion="off"] *::before,
html[data-a11y-on][data-a11y-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

html[data-a11y-on][data-a11y-focus="on"] :focus-visible {
  outline: 4px solid #ff6600 !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 6px rgba(255, 102, 0, 0.35) !important;
}

html[data-a11y-on][data-a11y-cursor="on"],
html[data-a11y-on][data-a11y-cursor="on"] * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='10' fill='%23000' stroke='%23fff' stroke-width='3'/%3E%3C/svg%3E")
      16 16,
    auto !important;
}
