/* ==========================================================================
   WCAG — trigger (jak easy-wishlist/counter) + tooltip
   ========================================================================== */

.wcag-counter-box {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 21px;
	height: 44px;
	padding: 0;
	margin: 0;
	line-height: 0;
	vertical-align: middle;
	box-sizing: border-box;
}

.wcag-counter-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 21px;
	height: 21px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	line-height: 0;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

.wcag-counter-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 4px;
}

.wcag-counter-icon {
	display: block;
	line-height: 0;
	width: 21px;
	height: 21px;
}

.wcag-counter-icon svg,
.wcag-counter-icon img {
	display: block;
	width: 21px;
	height: 21px;
	object-fit: contain;
	fill: currentColor;
}

.wcag-counter-box::after {
	content: attr(data-tooltip);
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX(-50%);
	margin-top: 6px;
	padding: 6px 12px;
	background: #101828;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
	border-radius: 4px;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0.15s ease;
	z-index: 100000;
}

.wcag-counter-box:hover::after,
.wcag-counter-box:focus-within::after {
	opacity: 1;
	visibility: visible;
}

body.wcag-a11y-open .wcag-counter-box::after {
	opacity: 0 !important;
	visibility: hidden !important;
}

/* ==========================================================================
   Panel / modal z prawej (wzorowany na Teatr Śląski)
   ========================================================================== */

.wcag-accessibility {
	position: fixed;
	inset: 0;
	z-index: 100050;
	pointer-events: none;
}

.wcag-accessibility[hidden] {
	display: none !important;
}

.wcag-accessibility.is-open {
	pointer-events: auto;
}

.wcag-accessibility::before {
	content: "";
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.35s ease-out;
	pointer-events: none;
}

.wcag-accessibility.is-open::before {
	opacity: 1;
	pointer-events: auto;
}

.wcag-accessibility__sidebar {
	position: absolute;
	top: 0;
	right: 0;
	width: min(470px, 100vw);
	height: 100%;
	max-height: 100dvh;
	padding: 110px 65px 40px;
	box-sizing: border-box;
	background: #fff;
	color: #101828;
	overflow-y: auto;
	overflow-x: hidden;
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 0.35s ease-out, visibility 0.35s ease-out;
	z-index: 1;
	pointer-events: none;
}

.wcag-accessibility.is-open .wcag-accessibility__sidebar {
	transform: translateX(0);
	visibility: visible;
	pointer-events: auto;
}

.wcag-accessibility__close {
	position: absolute;
	top: 110px;
	right: 60px;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.wcag-accessibility__close img {
	display: block;
	width: 20px;
	height: 20px;
}

.wcag-accessibility__close:focus-visible {
	outline: 2px solid #101828;
	outline-offset: 2px;
	border-radius: 4px;
}

.wcag-accessibility__title {
	margin: 0 0 8px;
	padding: 0;
	padding-right: 40px;
	font-size: 28px;
	font-weight: 600;
	line-height: 1.2;
	color: #101828;
}

.wcag-accessibility__buttons {
	width: 100%;
	margin-top: 20px;
	margin-bottom: 20px;
}

.wcag-accessibility__group {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wcag-accessibility__group > li {
	width: 50%;
	margin: -1px -1px 0 0;
	padding: 0;
	list-style: none;
	box-sizing: border-box;
}

.wcag-accessibility__item--fontsize {
	width: 33.333% !important;
}

.wcag-accessibility__item--fontsize + .wcag-accessibility__item--fontsize + .wcag-accessibility__item--fontsize {
	width: calc(33.333% + 1px) !important;
}

.wcag-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 70px;
	height: 70px;
	padding: 8px 6px;
	margin: 0;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.25;
	color: #101828;
	border: 1px solid #3a3a3a;
	background: #fff;
	cursor: pointer;
	position: relative;
	box-sizing: border-box;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wcag-btn:hover {
	background: #f1f1f1;
}

.wcag-btn.is-active {
	color: #fff;
	background: var(--wcag-active, #1570ef);
	border-color: var(--wcag-active, #1570ef);
}

.wcag-btn.is-active::before {
	content: "◥";
	position: absolute;
	top: 5px;
	right: 5px;
	width: 20px;
	height: 20px;
	font-size: 9px;
	line-height: 20px;
	text-align: center;
	color: #000;
	border-radius: 50%;
	background: #fff;
}

.wcag-btn.is-active .wcag-btn__icon {
	filter: invert(1);
}

.wcag-btn:focus-visible {
	outline: 2px solid var(--wcag-active, #1570ef);
	outline-offset: -2px;
	border-radius: 4px;
	z-index: 1;
}

.wcag-btn__icon {
	display: block;
	width: auto;
	max-height: 20px;
	object-fit: contain;
	margin: 0 auto;
}

.wcag-btn__icon--font {
	height: 18px;
	max-width: 48px;
}

.wcag-btn__text {
	display: block;
	font-size: 12px;
	text-align: center;
}

.wcag-accessibility__links-heading {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
	color: #667085;
}

.wcag-accessibility__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wcag-accessibility__nav a {
	font-size: 14px;
	color: #101828;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wcag-accessibility__nav a:hover {
	color: var(--wcag-active, #1570ef);
}

/* ==========================================================================
   Efekty body[data-wcag-*]
   ========================================================================== */

body[data-wcag-color="contrast"] {
	background: #f0f004 !important;
}

body[data-wcag-color="contrast"].using-keyboard *:focus,
body[data-wcag-color="contrast"] *:focus-visible {
	outline: 5px auto #000 !important;
	background: #fff !important;
	color: #000 !important;
	border-radius: 0 !important;
}

/* Skala szarości — bez panelu WCAG (jak Teatr: nie na całym body). */
body[data-wcag-color="greyscale"] > *:not(#wcag-accessibility):not(script):not(style):not(link) {
	filter: grayscale(1);
}

/* zoom / font-size ustawiane inline przez JS (skale z ustawień wtyczki).
   Panel WCAG dostaje odwrotny zoom (#wcag-accessibility), żeby nie psuć layoutu. */
#wcag-accessibility {
	zoom: var(--wcag-zoom-inv, 1);
}

/* Na mobile header i footer nie powiększają się razem ze stroną. */
@media (max-width: 767px) {
	html[data-wcag-fontsize] header,
	html[data-wcag-fontsize] footer {
		zoom: var(--wcag-zoom-inv, 1);
	}

	html.wcag-no-zoom[data-wcag-fontsize] header,
	html.wcag-no-zoom[data-wcag-fontsize] footer {
		font-size: calc(100% * var(--wcag-zoom-inv, 1));
	}
}

#wcag-ruler {
	width: 100%;
	height: 10px;
	position: fixed;
	z-index: 100060;
	top: 0;
	left: 0;
	pointer-events: none;
	border-top: 2px solid #fff;
	border-bottom: 2px solid #fff;
	background: var(--wcag-ruler, #1570ef);
}

body[data-wcag-cursor="true"] {
	cursor: url("../icons/cursor_arrow.png"), auto !important;
}

body[data-wcag-cursor="true"] a,
body[data-wcag-cursor="true"] a *,
body[data-wcag-cursor="true"] button,
body[data-wcag-cursor="true"] button *,
body[data-wcag-cursor="true"] [role="button"],
body[data-wcag-cursor="true"] [role="button"] *,
body[data-wcag-cursor="true"] input[type="button"],
body[data-wcag-cursor="true"] input[type="submit"],
body[data-wcag-cursor="true"] input[type="reset"],
body[data-wcag-cursor="true"] summary,
body[data-wcag-cursor="true"] summary * {
	cursor: url("../icons/cursor_hand.png"), auto !important;
}

body[data-wcag-links="true"] a {
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	text-decoration-thickness: 2px !important;
}

body[data-wcag-links="true"] a,
body[data-wcag-links="true"] button:not(.wcag-btn),
body[data-wcag-links="true"] [role="button"]:not(.wcag-btn),
body[data-wcag-links="true"] input[type="button"],
body[data-wcag-links="true"] input[type="submit"],
body[data-wcag-links="true"] summary {
	outline: 2px solid var(--wcag-links, #1570ef) !important;
	outline-offset: 2px;
	/* Kanciasty pierścień WCAG (nawet gdy element ma zaokrąglone rogi). */
	border-radius: 0 !important;
}

body[data-wcag-animation="true"] *,
body[data-wcag-animation="true"] *::before,
body[data-wcag-animation="true"] *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

body.wcag-a11y-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.wcag-accessibility__sidebar {
		width: 100vw;
		padding: 72px 20px 24px;
	}

	.wcag-accessibility__close {
		top: 20px;
		right: 16px;
	}

	.wcag-accessibility__title {
		font-size: 22px;
	}
}

@media (forced-colors: active) {
	.wcag-btn.is-active .wcag-btn__icon {
		filter: none;
	}
}
