/*
 * Версия для слабовидящих (inc/a11y.php, assets/js/a11y.js). 10.10.2026.
 * 1. Кнопка «Для слабовидящих» в шапке и панель настроек — всегда.
 * 2. Режим — только при html.dva11y: шрифт, цвет, изображения, интервал.
 * Блоки сайта сверстаны в px разными авторами, поэтому режим не масштабирует их, а задаёт
 * размеры, цвета и переносы напрямую (!important). Состояния «скрыто/показано» (display, hidden,
 * opacity) не трогаем — иначе всплывут закрытые меню и окна. Проверка — tools/a11y-check.py.
 */

/* ------------------------------------------------------------ кнопка в шапке */
.dvb-h01-hero .dvh .dva11y-btn { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; height: 52px; padding: 0 10px 0 9px; border: 1.5px solid #9fd3e6; border-radius: 10px; background: #fff; color: #222221; font: 700 12.5px/1.15 Gilroy, Manrope, system-ui, sans-serif; text-align: left; white-space: nowrap; cursor: pointer; transition: border-color .2s, background .2s; }
.dvb-h01-hero .dvh .dva11y-btn:hover { border-color: #1da3cb; background: #f1f9fc; }
.dvb-h01-hero .dvh .dva11y-btn:focus-visible { outline: 3px solid #d57959; outline-offset: 2px; }
.dvb-h01-hero .dvh .dva11y-btn[aria-pressed="true"] { border-color: #222221; }
.dva11y-eye { flex: none; width: 30px; height: 30px; fill: #222221; }
.dva11y-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.dvb-h01-hero .dvh .dva11y-btn--mobile { display: none; }
/* Слоган у логотипа — только от 1800 px: на 1501–1799 он отнимал у поиска ~190 px (замер 10.10.2026). */
@media (max-width: 1799px) { .dvb-h01-hero .dvh-brand__tag { display: none; } }
/* Подписи «Для слабовидящих» хватает места, только когда контейнер шапки максимальный (1600 px,
   экран от 1641 px) и зазоры 16 px: иначе поиск сжимается так, что не видно подсказки «Марка или модель»
   (замер 10.10.2026: при зазоре 20 px полю не хватало 21 px). Ниже — только глаз
   (имя кнопки для экранных дикторов — в .dva11y-sr, подсказка — title). */
@media (min-width: 1641px) { .dvb-h01-hero .dvh-top__inner { gap: 16px; } }
@media (max-width: 1640px) {
	.dvb-h01-hero .dvh .dva11y-btn--top { justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 10px; }
	.dvb-h01-hero .dvh .dva11y-btn--top .dva11y-btn__label { display: none; }
	.dvb-h01-hero .dvh .dva11y-btn--top .dva11y-eye { width: 26px; height: 26px; }
}
/* Место под кнопку на ноутбуках (замер 10.10.2026, 1366 px: поле поиска сжалось со 137 до 84 px и
   подсказка «Марка или модель» обрезалась): плотнее зазоры, без счётчиков под странами (они есть
   в меню «Направления»), мессенджеры — с 1280 px в мобильное меню, как раньше с 1180. */
@media (max-width: 1500px) {
	.dvb-h01-hero .dvh-dir small { display: none; }
}
@media (max-width: 1440px) {
	.dvb-h01-hero .dvh-top__inner { gap: 12px; }
}
@media (max-width: 1280px) {
	.dvb-h01-hero .dvh-top .dvh-msgr { display: none; }
}
@media (max-width: 1199px) {
	.dvb-h01-hero .dvh .dva11y-btn--top { display: none; }
	.dvb-h01-hero .dvh .dva11y-btn--mobile { display: inline-flex; justify-content: center; width: 44px; height: 44px; padding: 0; }
	.dvb-h01-hero .dvh .dva11y-btn--mobile .dva11y-btn__label { display: none; }
	.dvb-h01-hero .dvh .dva11y-btn--mobile .dva11y-eye { width: 26px; height: 26px; }
}

/* ------------------------------------------------------------ панель настроек */
.dva11y-panel[hidden] { display: none !important; }
.dva11y-panel { position: sticky; top: 0; z-index: 1000; border-bottom: 3px solid #000; background: #fff; color: #000; font: 700 18px/1.3 Arial, Helvetica, sans-serif; }
.dva11y-panel__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; max-width: 1360px; margin: 0 auto; padding: 10px 16px; box-sizing: border-box; }
.dva11y-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dva11y-group__label { margin-right: 4px; }
.dva11y-panel button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 4px 12px; border: 2px solid #000; border-radius: 6px; background: #fff; color: #000; font: inherit; cursor: pointer; }
.dva11y-panel button:focus-visible { outline: 4px solid #000; outline-offset: 2px; }
.dva11y-panel .dva11y-opt--fs1 { font-size: 18px; }
.dva11y-panel .dva11y-opt--fs2 { font-size: 23px; }
.dva11y-panel .dva11y-opt--fs3 { font-size: 28px; }
.dva11y-reset { margin-left: auto; }

/* ------------------------------------------------------------ режим: размеры */
html.dva11y { --a11y-fs: 20px; --a11y-bg: #fff; --a11y-fg: #000; --a11y-link: #000; }
html.dva11y[data-a11y-fs="2"] { --a11y-fs: 24px; }
html.dva11y[data-a11y-fs="3"] { --a11y-fs: 28px; }
html.dva11y[data-a11y-scheme="wb"] { --a11y-bg: #000; --a11y-fg: #fff; --a11y-link: #fff; }
html.dva11y[data-a11y-scheme="blue"] { --a11y-bg: #9dd1ff; --a11y-fg: #063462; --a11y-link: #063462; }

html.dva11y body :is(p, li, a, span, small, em, strong, b, i, u, td, th, dd, dt, label, input, select, textarea, button, blockquote, figcaption, summary, legend, div, cite, time, address, q, mark, sup, sub, output) {
	font-size: var(--a11y-fs) !important;
	line-height: 1.5 !important;
	font-family: Arial, Helvetica, sans-serif !important;
}
html.dva11y body h1 { font-size: calc(var(--a11y-fs) * 1.7) !important; line-height: 1.25 !important; font-family: Arial, Helvetica, sans-serif !important; }
html.dva11y body h2 { font-size: calc(var(--a11y-fs) * 1.45) !important; line-height: 1.3 !important; font-family: Arial, Helvetica, sans-serif !important; }
html.dva11y body h3 { font-size: calc(var(--a11y-fs) * 1.2) !important; line-height: 1.35 !important; font-family: Arial, Helvetica, sans-serif !important; }
html.dva11y body :is(h4, h5, h6) { font-size: calc(var(--a11y-fs) * 1.1) !important; line-height: 1.4 !important; font-family: Arial, Helvetica, sans-serif !important; }
/* Крупный текст должен переноситься, а не выезжать за экран: снимаем nowrap, капс и сжатие. */
html.dva11y body * { white-space: normal !important; overflow-wrap: anywhere; hyphens: auto; text-overflow: clip !important; text-transform: none !important; flex-wrap: wrap !important; }
/* Кнопки, ссылки-плашки, поля и строки шапки с фиксированной высотой растут вместе с текстом. */
html.dva11y body :is(button, a, input, select, label, li, nav, [class*="btn"], [class*="button"], [class*="chip"], [class*="tag"], [class*="badge"], [class*="item"], [class*="card"], [class*="__inner"], [class*="field"]) { height: auto !important; min-height: 44px; }
html.dva11y body :is(img, svg, video, picture, iframe, canvas) { min-height: 0 !important; }
/* Сетки — в одну-две колонки: при шрифте 28 px четыре карточки в ряд не помещаются. */
html.dva11y body * { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important; grid-template-areas: none !important; }
html.dva11y body * > * { grid-column: auto !important; grid-row: auto !important; }

/* ------------------------------------------------------------ режим: цвет */
html.dva11y body,
html.dva11y body *:not(svg):not(svg *):not(img):not(video):not(picture) {
	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: var(--a11y-fg) !important;
}
html.dva11y body *::before,
html.dva11y body *::after { background-color: transparent !important; background-image: none !important; border-color: var(--a11y-fg) !important; color: var(--a11y-fg) !important; box-shadow: none !important; }
html.dva11y body a { color: var(--a11y-link) !important; text-decoration: underline !important; text-underline-offset: 3px; }
html.dva11y body :is(button, input, select, textarea, [role="button"]) { border: 2px solid var(--a11y-fg) !important; border-radius: 6px !important; }
html.dva11y body input::placeholder,
html.dva11y body textarea::placeholder { color: var(--a11y-fg) !important; opacity: .75 !important; -webkit-text-fill-color: var(--a11y-fg) !important; }
html.dva11y body svg { fill: currentColor; }
html.dva11y body svg [fill]:not([fill="none"]) { fill: currentColor !important; }
html.dva11y body svg [stroke]:not([stroke="none"]) { stroke: currentColor !important; }
html.dva11y body :focus-visible { outline: 4px solid var(--a11y-fg) !important; outline-offset: 3px !important; }
html.dva11y body ::selection { background: var(--a11y-fg); color: var(--a11y-bg); -webkit-text-fill-color: var(--a11y-bg); }

/* Панель в режиме — своими цветами схемы, нажатая кнопка инвертирована. */
html.dva11y .dva11y-panel { border-bottom-color: var(--a11y-fg) !important; }
html.dva11y .dva11y-panel .dva11y-opt[aria-pressed="true"] { background-color: var(--a11y-fg) !important; color: var(--a11y-bg) !important; -webkit-text-fill-color: var(--a11y-bg) !important; }
/* Образцы схем показывают свои цвета в любом режиме. */
html .dva11y-panel .dva11y-opt--bw { background-color: #fff !important; color: #000 !important; -webkit-text-fill-color: #000 !important; border-color: #000 !important; }
html .dva11y-panel .dva11y-opt--wb { background-color: #000 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border-color: #000 !important; }
html .dva11y-panel .dva11y-opt--blue { background-color: #9dd1ff !important; color: #063462 !important; -webkit-text-fill-color: #063462 !important; border-color: #063462 !important; }
html .dva11y-panel .dva11y-opt:is(.dva11y-opt--bw, .dva11y-opt--wb, .dva11y-opt--blue)[aria-pressed="true"] { outline: 4px solid var(--a11y-fg, #000) !important; outline-offset: 3px; text-decoration: underline !important; }
html.dva11y .dva11y-panel .dva11y-opt--fs1 { font-size: 18px !important; }
html.dva11y .dva11y-panel .dva11y-opt--fs2 { font-size: 23px !important; }
html.dva11y .dva11y-panel .dva11y-opt--fs3 { font-size: 28px !important; }

/* ------------------------------------------------------------ режим: изображения и интервал */
.dva11y-alt { display: none; }
html.dva11y[data-a11y-img="off"] body :is(img, picture, video, canvas, iframe) { display: none !important; }
html.dva11y[data-a11y-img="off"] .dva11y-alt { display: inline-block !important; margin: 4px 0; padding: 4px 10px; border: 2px dashed var(--a11y-fg) !important; }
/* Иконка-глаз и флаги стран — смысловые: в режиме без картинок флаг заменяется подписью страны рядом. */
html.dva11y[data-a11y-img="off"] .dva11y-btn .dva11y-eye { display: inline-block !important; }
html.dva11y[data-a11y-ls="wide"] body * { letter-spacing: .12em !important; word-spacing: .2em !important; }

/* Анимации — выключены: отвлекают и мешают читать. */
html.dva11y body *, html.dva11y body *::before, html.dva11y body *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

@media print { .dva11y-panel, .dva11y-btn { display: none !important; } }
