/* weebKIT - Dostępność: przycisk, panel i ułatwienia dla odwiedzających.
 * Motyw może podmienić kolory panelu zmiennymi --wk-a11y-* (np. pod swoją ciemną wersję).
 */

/* ===================================================================== */
/* Ułatwienia - działają na każdym motywie                                */
/* ===================================================================== */

/* Wielkość tekstu: skaluje wszystko, co motyw podaje w rem (GLOB - całość). */
html.wk-a11y-t1 { font-size: 115% !important; }
html.wk-a11y-t2 { font-size: 130% !important; }

/* Podkreślone linki */
html.wk-a11y-links body a:not(.wk-a11y a):not(#wpadminbar a) {
	text-decoration-line: underline !important;
	text-decoration-thickness: max(1px, .08em) !important;
	text-underline-offset: .2em !important;
}

/* Czytelny krój: szeroki, systemowy, z większymi odstępami (bez pobierania czegokolwiek). */
html.wk-a11y-font body,
html.wk-a11y-font body :is(p, li, a, span, div, h1, h2, h3, h4, h5, h6, td, th, label, input, textarea, select, button, blockquote, figcaption, dt, dd, strong, em, b):not([class*="icon"]):not([class*="dashicons"]):not(#wpadminbar *) {
	font-family: Verdana, "Segoe UI", Tahoma, system-ui, -apple-system, Arial, sans-serif !important;
	letter-spacing: .02em !important;
	word-spacing: .08em !important;
}
html.wk-a11y-font body :is(p, li, dd, blockquote) { line-height: 1.75 !important; }

/* Zatrzymaj animacje */
html.wk-a11y-motion { scroll-behavior: auto !important; }
html.wk-a11y-motion *,
html.wk-a11y-motion *::before,
html.wk-a11y-motion *::after {
	animation-duration: .001ms !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: .001ms !important;
	transition-delay: 0s !important;
	scroll-behavior: auto !important;
}

/* Kontrast i awaryjny tryb ciemny: filtr na <html> (na korzeniu nie psuje elementów „fixed”). */
html.wk-a11y-contrast { filter: contrast(1.25); }
html.wk-dark.wk-dark-fallback { filter: invert(1) hue-rotate(180deg) contrast(.88); background: #fff; }
html.wk-dark.wk-dark-fallback.wk-a11y-contrast { filter: invert(1) hue-rotate(180deg) contrast(1.05); }
/* Zdjęcia i filmy wracają do normalnych kolorów. */
html.wk-dark.wk-dark-fallback :is(img, picture > source, video, iframe, canvas, svg image, [style*="background-image"]) { filter: invert(1) hue-rotate(180deg); }
html.wk-dark.wk-dark-fallback picture img { filter: invert(1) hue-rotate(180deg); }

/* ===================================================================== */
/* Przycisk i panel                                                       */
/* ===================================================================== */
.wk-a11y {
	--_bg: var(--wk-a11y-bg, #fff);
	--_ink: var(--wk-a11y-ink, #16191d);
	--_muted: var(--wk-a11y-muted, #5d656e);
	--_line: var(--wk-a11y-line, rgba(16, 24, 32, .1));
	--_soft: var(--wk-a11y-soft, rgba(16, 24, 32, .05));
	--_on: var(--wk-a11y-accent, var(--wk-primary, #1d2327));
	--_on-ink: var(--wk-a11y-accent-ink, #fff);
	--_btn: var(--wk-a11y-btn-bg, var(--wk-primary, #1d2327));
	--_btn-ink: var(--wk-a11y-btn-ink, var(--wk-accent, #fff));
	--_side: var(--wk-a11y-side, 16px);
	--_bottom: var(--wk-a11y-bottom, 16px);
	position: fixed;
	z-index: 99985;
	bottom: calc(var(--_bottom) + env(safe-area-inset-bottom, 0px));
	left: var(--_side);
	font: 500 14px/1.4 var(--wk-a11y-font, var(--wk-font-body, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif));
	letter-spacing: normal;
	color: var(--_ink);
	text-align: left;
}
.wk-a11y--right { left: auto; right: var(--_side); }
.wk-a11y *,
.wk-a11y *::before,
.wk-a11y *::after { box-sizing: border-box; }
.wk-a11y button {
	margin: 0;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.wk-a11y .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.wk-a11y-i { display: block; width: 20px; height: 20px; flex: none; }

.wk-a11y-btn {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, .9);
	border-radius: 50%;
	background: var(--_btn);
	color: var(--_btn-ink);
	box-shadow: 0 6px 20px rgba(10, 20, 30, .25);
	transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease;
}
.wk-a11y-btn[hidden] { display: none; }
.wk-a11y-btn .wk-a11y-i { width: 26px; height: 26px; stroke-width: 2.2; }
.wk-a11y-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 26px rgba(10, 20, 30, .3); }
.wk-a11y-btn[aria-expanded="true"] { transform: none; }
.wk-a11y :focus-visible { outline: 3px solid var(--wk-a11y-ring, var(--wk-accent, #2271b1)); outline-offset: 2px; }

.wk-a11y-panel {
	position: absolute;
	bottom: 60px;
	left: 0;
	width: 330px;
	max-width: calc(100vw - 2 * var(--_side));
	max-height: calc(100vh - 100px);
	overflow: auto;
	padding: 16px;
	border: 1px solid var(--_line);
	border-radius: 18px;
	background: var(--_bg);
	color: var(--_ink);
	box-shadow: 0 24px 60px rgba(10, 20, 30, .22), 0 2px 8px rgba(10, 20, 30, .08);
	transform-origin: bottom left;
	animation: wk-a11y-in .22s cubic-bezier(.2, .7, .2, 1);
}
.wk-a11y--right .wk-a11y-panel { left: auto; right: 0; transform-origin: bottom right; }
.wk-a11y-panel[hidden] { display: none; }
@keyframes wk-a11y-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.wk-a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.wk-a11y-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--_ink); }
.wk-a11y-close {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--_soft);
	color: var(--_muted);
}
.wk-a11y-close:hover { color: var(--_ink); }
.wk-a11y-close .wk-a11y-i { width: 16px; height: 16px; }

.wk-a11y-row { margin: 0 0 14px; }
.wk-a11y-label { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--_muted); }
.wk-a11y-seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--_soft); }
.wk-a11y-seg button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	padding: 6px 8px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--_ink);
	font-weight: 600;
	transition: background-color .15s ease, color .15s ease;
}
.wk-a11y-seg button .wk-a11y-i { width: 17px; height: 17px; }
.wk-a11y-seg button:hover { background: var(--_line); }
.wk-a11y-seg button[aria-pressed="true"] { background: var(--_on); color: var(--_on-ink); box-shadow: 0 1px 3px rgba(10, 20, 30, .15); }
.wk-a11y-seg-t button[data-val="0"] span { font-size: 13px; }
.wk-a11y-seg-t button[data-val="1"] span { font-size: 15px; }
.wk-a11y-seg-t button[data-val="2"] span { font-size: 17px; }

.wk-a11y-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wk-a11y-switch {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	min-height: 86px;
	padding: 12px;
	border: 1px solid var(--_line);
	border-radius: 12px;
	background: transparent;
	color: var(--_ink);
	text-align: left;
	transition: border-color .15s ease, background-color .15s ease;
}
.wk-a11y-switch:hover { border-color: var(--_on); }
.wk-a11y-switch-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--_soft); color: var(--_ink); }
.wk-a11y-switch-ico .wk-a11y-i { width: 18px; height: 18px; }
.wk-a11y-switch-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.wk-a11y-toggle { position: absolute; top: 14px; right: 12px; width: 30px; height: 18px; border-radius: 10px; background: var(--_line); transition: background-color .15s ease; }
.wk-a11y-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.wk-a11y-switch[aria-checked="true"] { border-color: var(--_on); background: var(--_soft); }
.wk-a11y-switch[aria-checked="true"] .wk-a11y-switch-ico { background: var(--_on); color: var(--_on-ink); }
.wk-a11y-switch[aria-checked="true"] .wk-a11y-toggle { background: var(--_on); }
.wk-a11y-switch[aria-checked="true"] .wk-a11y-toggle::after { transform: translateX(12px); }

.wk-a11y-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--_line); }
.wk-a11y-reset { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: var(--_ink); font-size: 13px; font-weight: 600; }
.wk-a11y-reset .wk-a11y-i { width: 15px; height: 15px; }
.wk-a11y-reset:hover { text-decoration: underline; }
.wk-a11y-note { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--_muted); text-align: right; }

/* Ciemny panel, gdy strona jest w trybie ciemnym (motyw z własną ciemną wersją). */
html.wk-dark:not(.wk-dark-fallback) .wk-a11y {
	--_bg: var(--wk-a11y-bg, #161b20);
	--_ink: var(--wk-a11y-ink, #e8ecef);
	--_muted: var(--wk-a11y-muted, #a3adb6);
	--_line: var(--wk-a11y-line, rgba(255, 255, 255, .1));
	--_soft: var(--wk-a11y-soft, rgba(255, 255, 255, .06));
	--_on: var(--wk-a11y-accent, var(--wk-accent, #7cc4ff));
	--_on-ink: var(--wk-a11y-accent-ink, var(--wk-primary, #0b1116));
}
html.wk-dark:not(.wk-dark-fallback) .wk-a11y-panel { box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }

/* Przycisk zgód cookies nad naszym, gdy stoją w tym samym rogu. */
html.wk-a11y-pos-left .wkc-float:not(.wkc-float--right),
html.wk-a11y-pos-right .wkc-float.wkc-float--right { bottom: calc(var(--wk-a11y-bottom, 16px) + 60px); }

@media (max-width: 640px) {
	.wk-a11y { --_side: var(--wk-a11y-side, 12px); --_bottom: var(--wk-a11y-bottom, 12px); }
	.wk-a11y-btn { width: 44px; height: 44px; }
	.wk-a11y-panel { position: fixed; left: 8px; right: 8px; bottom: calc(var(--_bottom) + 56px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
	.wk-a11y--right .wk-a11y-panel { left: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.wk-a11y-panel { animation: none; }
	.wk-a11y-btn, .wk-a11y-seg button, .wk-a11y-switch, .wk-a11y-toggle, .wk-a11y-toggle::after { transition: none; }
}
@media print { .wk-a11y { display: none !important; } }

/* Przełącznik jasny/ciemny (nagłówek motywu) - motyw może nadpisać wygląd */
.wk-dark-toggle {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--wk-dark-toggle-line, rgba(127, 127, 127, .3));
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.wk-dark-toggle:hover { border-color: currentColor; }
.wk-dark-toggle .wk-a11y-i { width: 19px; height: 19px; }
.wk-dark-toggle .wk-dark-toggle-moon,
.wk-dark-toggle .wk-dark-toggle-sun { place-items: center; }
.wk-dark-toggle .wk-dark-toggle-moon { display: grid; }
.wk-dark-toggle .wk-dark-toggle-sun,
html.wk-dark .wk-dark-toggle .wk-dark-toggle-moon { display: none; }
html.wk-dark .wk-dark-toggle .wk-dark-toggle-sun { display: grid; }
.wk-dark-toggle .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
html.wk-dark.wk-dark-fallback .wk-dark-toggle .wk-dark-toggle-sun { display: grid; }
