/**
 * Pi Web Content Accessibility — front (namespace: pi-wca-).
 */

/* Kontener treści — na nim nakładane są filtry (grayscale, sepia, negatyw), nie na `body`,
   żeby `position: fixed` pływaka nie było liczone względem całej wysokości dokumentu. */
#pi-wca-filter-root {
	display: block;
}

/* —— Launcher —— */
.pi-wca-launcher {
	position: fixed;
	z-index: 99990;
	right: 1rem;
	bottom: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0.5rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	background: #1a1a1a;
	color: #fff;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.pi-wca-launcher .bi {
	font-size: 1.35rem;
	line-height: 1;
	vertical-align: -0.125em;
}

.pi-wca-launcher:hover,
.pi-wca-launcher:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* —— Panel —— */
.pi-wca-panel {
	position: fixed;
	z-index: 99991;
	right: 1rem;
	bottom: 5rem;
	width: min(22rem, calc(100vw - 2rem));
	max-height: min(85vh, 40rem);
	overflow: auto;
	border: 2px solid #1a1a1a;
	border-radius: 0.75rem;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.pi-wca-panel__inner {
	padding: 1rem 1.25rem 1.25rem;
}

.pi-wca-panel__title {
	margin: 0 0 1rem;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
}

.pi-wca-panel__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pi-wca-panel__item + .pi-wca-panel__item {
	margin-top: 0.75rem;
}

.pi-wca-switch {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.pi-wca-switch input {
	margin-top: 0.2rem;
	width: 1.15rem;
	height: 1.15rem;
	flex-shrink: 0;
	accent-color: #1a1a1a;
}

.pi-wca-switch__label {
	flex: 1;
}

/* —— Skalowanie tekstu (+ / −) —— */
.pi-wca-text-scale {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.pi-wca-text-scale__label {
	font-weight: 600;
}

.pi-wca-text-scale__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.pi-wca-text-scale__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 2px solid #1a1a1a;
	border-radius: 0.375rem;
	background: #fff;
	color: #1a1a1a;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}

.pi-wca-text-scale__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.pi-wca-text-scale__btn .bi {
	font-size: 1.25rem;
}

.pi-wca-text-scale__btn:focus-visible {
	outline: 3px solid #1a1a1a;
	outline-offset: 2px;
}

.pi-wca-text-scale__value {
	flex: 1;
	text-align: center;
	font-weight: 600;
	min-height: 1.4em;
}

.pi-wca-panel__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid #ddd;
}

.pi-wca-btn {
	min-height: 44px;
	padding: 0.4rem 0.9rem;
	border: 2px solid #1a1a1a;
	border-radius: 0.375rem;
	background: #fff;
	color: #1a1a1a;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

.pi-wca-btn:focus-visible {
	outline: 3px solid #1a1a1a;
	outline-offset: 2px;
}

.pi-wca-btn--primary {
	background: #1a1a1a;
	color: #fff;
}

/* —— Tryby na body —— */
/* Filtry kolorów (kontrast, sepia, szarość, negatyw) ustawiane inline w JS: body.style.filter */

body.pi-wca--underline-links a[href] {
	text-decoration: underline !important;
	text-decoration-thickness: 0.1em;
	text-underline-offset: 0.2em;
}

/*
 * Rozmiar tekstu: reguły typu `.fs-3 { font-size: 1.75rem !important }` (WPBakery, Bootstrap)
 * wygrywają z samym `font-size` na `body`. `zoom` na `#pi-wca-filter-root` skaluje cały blok treści,
 * więc działa także na utility z !important.
 * Gdy jest wrapper — reset `body` do 100%, żeby nie mnożyć skali (body + zoom).
 */
body.pi-wca--text-1 {
	font-size: 122.5%;
}

body.pi-wca--text-2 {
	font-size: 165%;
}

@supports (zoom: 1) {
	body.pi-wca--text-1:has(#pi-wca-filter-root) {
		font-size: 100%;
	}

	body.pi-wca--text-2:has(#pi-wca-filter-root) {
		font-size: 100%;
	}

	body.pi-wca--text-1 #pi-wca-filter-root {
		zoom: 1.125;
	}

	body.pi-wca--text-2 #pi-wca-filter-root {
		zoom: 1.45;
	}
}

body.pi-wca--reduce-motion *,
body.pi-wca--reduce-motion *::before,
body.pi-wca--reduce-motion *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
	body.pi-wca--reduce-motion *,
	body.pi-wca--reduce-motion *::before,
	body.pi-wca--reduce-motion *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
