/**
 * @package     Akim.Plugin
 * @subpackage  System.ak_access
 * @copyright   (C) 2026 Akim. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 *
 * Версия для слабовидящих: панель, цветовые схемы, интервалы, гарнитура, изображения.
 * Режимы — классы ak-a11y-* на <html>. Панель (#ak-access-panel) всегда в своих контрастных цветах.
 */

/* ---------- Плавающая кнопка ---------- */
.ak-access-float {
	position: fixed;
	left: 16px;
	bottom: 96px;
	z-index: 1000;
	width: 52px;
	height: 52px;
	border: 2px solid #000;
	border-radius: 50%;
	background: #fff;
	color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
.ak-access-float:hover { background: #000; color: #fff; }
.ak-access-float:focus-visible { outline: 3px solid #ff8c00; outline-offset: 3px; }
@media (min-width: 1200px) {
	.ak-access-float--mobile { display: none; }
}

/* ---------- Модуль «Версия для слабовидящих» ---------- */
.mod-ak-access-link { display: inline-flex; align-items: center; gap: 6px; }
.mod-ak-access-icon { flex: none; }

/* ---------- Ссылка «Перейти к содержимому» ---------- */
.ak-access-skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 10001;
	padding: 12px 20px;
	background: #000 !important;
	color: #fff !important;
	font: 700 18px/1.2 Arial, sans-serif !important;
}
.ak-access-skip:focus { top: 16px; }

/* ---------- Панель ---------- */
#ak-access-panel {
	position: relative;
	z-index: 10000;
	background: #fff !important;
	color: #000 !important;
	border-bottom: 3px solid #000 !important;
	font: 16px/1.4 Arial, Helvetica, sans-serif !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
}
#ak-access-panel * {
	font-family: Arial, Helvetica, sans-serif !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	line-height: 1.3 !important;
	text-shadow: none !important;
	box-shadow: none !important;
	filter: none !important;
}
#ak-access-panel .ak-access-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 12px 16px;
	background: #fff !important;
}
#ak-access-panel .ak-access-head {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: #fff !important;
}
#ak-access-panel .ak-access-exit { margin-left: auto; }
#ak-access-panel .ak-access-groups {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 28px;
	margin-top: 12px;
	background: #fff !important;
}
#ak-access-panel .ak-access-group { background: #fff !important; }
#ak-access-panel .ak-access-group-title {
	margin-bottom: 6px;
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #000 !important;
	background: #fff !important;
}
#ak-access-panel .ak-access-group-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	background: #fff !important;
}
#ak-access-panel .ak-access-btn {
	min-width: 44px;
	min-height: 44px;
	padding: 6px 12px;
	border: 2px solid #000 !important;
	border-radius: 6px;
	background: #fff !important;
	color: #000 !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	text-transform: none !important;
	cursor: pointer;
}
#ak-access-panel .ak-access-btn:hover { background: #e6e6e6 !important; }
#ak-access-panel .ak-access-btn[aria-pressed="true"] { background: #000 !important; color: #fff !important; }
#ak-access-panel .ak-access-btn:focus-visible { outline: 3px solid #ff8c00 !important; outline-offset: 2px; }
#ak-access-panel .ak-access-hint { margin-top: 6px; font-size: 14px !important; color: #000 !important; background: #fff !important; max-width: 420px; }
#ak-access-panel .ak-access-ff-serif { font-family: "Times New Roman", Georgia, serif !important; }

/* Образцы цвета: сам образец в цветах схемы, выбранный — с толстой рамкой */
#ak-access-panel .ak-access-swatch { width: 44px; padding: 0; font-size: 20px !important; }
#ak-access-panel .ak-access-swatch-white,
#ak-access-panel .ak-access-swatch-white[aria-pressed="true"] { background: #fff !important; color: #000 !important; }
#ak-access-panel .ak-access-swatch-black,
#ak-access-panel .ak-access-swatch-black[aria-pressed="true"] { background: #000 !important; color: #fff !important; }
#ak-access-panel .ak-access-swatch-blue,
#ak-access-panel .ak-access-swatch-blue[aria-pressed="true"] { background: #9dd1ff !important; color: #063462 !important; }
#ak-access-panel .ak-access-swatch-yellow,
#ak-access-panel .ak-access-swatch-yellow[aria-pressed="true"] { background: #ffff00 !important; color: #000 !important; }
#ak-access-panel .ak-access-swatch-brown,
#ak-access-panel .ak-access-swatch-brown[aria-pressed="true"] { background: #f7f3d6 !important; color: #4d4b43 !important; }
#ak-access-panel .ak-access-swatch[aria-pressed="true"] { border-width: 5px !important; border-color: #ff8c00 !important; }

/* На телефоне настройки прячутся под кнопку «Настройки» */
#ak-access-panel .ak-access-more { display: none; }
@media (max-width: 959px) {
	#ak-access-panel .ak-access-more { display: inline-block; }
	#ak-access-panel:not(.ak-access-open) .ak-access-groups { display: none; }
	#ak-access-panel .ak-access-exit { margin-left: 0; }
}

/* ---------- Видимый фокус, подчёркнутые ссылки, перенос длинных слов при крупном шрифте ---------- */
html.ak-a11y :focus-visible { outline: 3px solid #ff8c00 !important; outline-offset: 2px !important; }
html.ak-a11y body h1, html.ak-a11y body h2, html.ak-a11y body h3,
html.ak-a11y body [class*="heading"], html.ak-a11y body [class*="uk-h"] { overflow-wrap: anywhere; hyphens: auto; }
html.ak-a11y body a:not(.uk-button):not([class*="btn"]):not(#ak-access-panel *) { text-decoration: underline !important; }

/* ---------- Цветовые схемы ---------- */
html.ak-a11y-cs-white body,
html.ak-a11y-cs-white body *:not(svg):not(svg *):not(img):not(picture):not(video):not(iframe):not(canvas):not(#ak-access-panel):not(#ak-access-panel *):not(.ak-access-skip):not(.ak-access-float) {
	background-color: #fff !important; color: #000 !important; border-color: #000 !important;
	box-shadow: none !important; text-shadow: none !important;
}
html.ak-a11y-cs-black body,
html.ak-a11y-cs-black body *:not(svg):not(svg *):not(img):not(picture):not(video):not(iframe):not(canvas):not(#ak-access-panel):not(#ak-access-panel *):not(.ak-access-skip):not(.ak-access-float) {
	background-color: #000 !important; color: #fff !important; border-color: #fff !important;
	box-shadow: none !important; text-shadow: none !important;
}
html.ak-a11y-cs-blue body,
html.ak-a11y-cs-blue body *:not(svg):not(svg *):not(img):not(picture):not(video):not(iframe):not(canvas):not(#ak-access-panel):not(#ak-access-panel *):not(.ak-access-skip):not(.ak-access-float) {
	background-color: #9dd1ff !important; color: #063462 !important; border-color: #063462 !important;
	box-shadow: none !important; text-shadow: none !important;
}
html.ak-a11y-cs-yellow body,
html.ak-a11y-cs-yellow body *:not(svg):not(svg *):not(img):not(picture):not(video):not(iframe):not(canvas):not(#ak-access-panel):not(#ak-access-panel *):not(.ak-access-skip):not(.ak-access-float) {
	background-color: #ffff00 !important; color: #000 !important; border-color: #000 !important;
	box-shadow: none !important; text-shadow: none !important;
}
html.ak-a11y-cs-brown body,
html.ak-a11y-cs-brown body *:not(svg):not(svg *):not(img):not(picture):not(video):not(iframe):not(canvas):not(#ak-access-panel):not(#ak-access-panel *):not(.ak-access-skip):not(.ak-access-float) {
	background-color: #f7f3d6 !important; color: #4d4b43 !important; border-color: #4d4b43 !important;
	box-shadow: none !important; text-shadow: none !important;
}
/* Иконки — цветом текста; полупрозрачные подложки и затемнения картинок — убрать */
html[class*="ak-a11y-cs-"] body svg:not(#ak-access-panel svg) { color: inherit; }
html[class*="ak-a11y-cs-"] body *::before,
html[class*="ak-a11y-cs-"] body *::after { background-color: transparent !important; box-shadow: none !important; }
html[class*="ak-a11y-cs-"] body ::placeholder { color: inherit !important; opacity: .75; }

/* ---------- Интервалы ---------- */
html.ak-a11y-ls-2 body *:not(#ak-access-panel):not(#ak-access-panel *) { letter-spacing: .12em !important; word-spacing: .16em !important; }
html.ak-a11y-ls-3 body *:not(#ak-access-panel):not(#ak-access-panel *) { letter-spacing: .25em !important; word-spacing: .3em !important; }
html.ak-a11y-lh-2 body *:not(#ak-access-panel):not(#ak-access-panel *) { line-height: 1.8 !important; }
html.ak-a11y-lh-3 body *:not(#ak-access-panel):not(#ak-access-panel *) { line-height: 2.3 !important; }

/* ---------- Гарнитура (иконочные шрифты не трогаем) ---------- */
html.ak-a11y-ff-sans body *:not(#ak-access-panel):not(#ak-access-panel *):not(i):not([class*="icon"]):not([uk-icon]) {
	font-family: Arial, Helvetica, sans-serif !important;
}
html.ak-a11y-ff-serif body *:not(#ak-access-panel):not(#ak-access-panel *):not(i):not([class*="icon"]):not([uk-icon]) {
	font-family: "Times New Roman", Georgia, serif !important;
}

/* ---------- Изображения ---------- */
html.ak-a11y-img-gray body img:not(#ak-access-panel *),
html.ak-a11y-img-gray body picture,
html.ak-a11y-img-gray body video,
html.ak-a11y-img-gray body [style*="background-image"],
html.ak-a11y-img-gray body .uk-background-cover,
html.ak-a11y-img-gray body .uk-background-contain { filter: grayscale(1) !important; }

html.ak-a11y-img-off body img:not(#ak-access-panel *),
html.ak-a11y-img-off body picture,
html.ak-a11y-img-off body video { display: none !important; }
html.ak-a11y-img-off body *:not(#ak-access-panel):not(#ak-access-panel *) { background-image: none !important; }
.ak-a11y-alt { display: none; }
html.ak-a11y-img-off .ak-a11y-alt {
	display: inline-block;
	margin: 4px 0;
	padding: 4px 8px;
	border: 2px dashed currentColor;
	font-style: italic;
}
