/* --- Skip link --- */
.mibeno-wcag-skip-link {
	position: fixed;
	top: -100px;
	left: 8px;
	z-index: 999999;
	background: #000;
	color: #fff;
	padding: 12px 20px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	transition: top 0.15s ease-in-out;
}
.mibeno-wcag-skip-link:focus {
	top: 8px;
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}

/* --- Widżet dostępności --- */
/* Pozycja (top/bottom/left/right) i odstępy są ustawiane inline przez JS
   na podstawie ustawień w panelu wtyczki - tu tylko wygląd. */

.mibeno-wcag-toolbar-toggle {
	cursor: pointer;
	white-space: normal !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 0;
	/* border-radius, background, color, border i box-shadow ustawiane
	   inline z JS (zob. frontend.js) - motyw/Elementor bywa mocniejszy
	   niż zewnętrzny arkusz stylów na gołym elemencie <button>. */
}
.mibeno-wcag-toolbar-toggle:hover,
.mibeno-wcag-toolbar-toggle:focus {
	filter: brightness(1.2);
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}

.mibeno-wcag-toolbar-panel,
.mibeno-wcag-toolbar-panel * {
	box-sizing: border-box;
}
.mibeno-wcag-toolbar-panel {
	width: 480px;
	max-width: calc(100vw - 32px);
	max-height: 80vh;
	overflow-y: auto;
	overflow-x: hidden;
	background: #fff;
	color: #111;
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.25);
	padding: 16px;
}

/* Na wąskich ekranach dwie kolumny nie mają szans pomieścić polskich
   etykiet niezależnie od tego, jak bardzo poszerzymy panel - jedna
   kolumna daje każdej karcie pełną szerokość zamiast ciasnoty. */
@media (max-width: 520px) {
	.mibeno-wcag-card-grid {
		grid-template-columns: 1fr;
	}
}

.mibeno-wcag-group-title {
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #555;
	margin: 16px 0 8px;
}
.mibeno-wcag-group-title:first-child {
	margin-top: 0;
}

.mibeno-wcag-card-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 10px;
}

.mibeno-wcag-card {
	white-space: normal !important;
	display: flex !important;
	align-items: center;
	gap: 10px;
	padding: 12px;
	border: none;
	border-radius: 10px;
	background: #f2f2f4;
	cursor: pointer;
	text-align: left;
	font-size: 13px;
	line-height: 1.25;
	color: #111;
	min-width: 0;
}
.mibeno-wcag-card:hover,
.mibeno-wcag-card:focus {
	background: #e6e6ea;
	outline: 2px solid #1a1a1a;
	outline-offset: 1px;
}
.mibeno-wcag-card.is-active {
	background: #1a1a1a;
	color: #fff;
}
.mibeno-wcag-card-icon {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	color: #111;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 6px;
}
.mibeno-wcag-card-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}
.mibeno-wcag-card-text {
	display: flex !important;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
	min-width: 0;
}
.mibeno-wcag-card-label {
	white-space: normal !important;
	overflow-wrap: break-word;
	word-break: break-word;
}
.mibeno-wcag-card-value {
	white-space: normal !important;
	font-size: 12px;
	font-weight: 700;
	opacity: 0.8;
}
.mibeno-wcag-card-bar {
	display: flex !important;
	gap: 3px;
	margin-top: 2px;
}
.mibeno-wcag-bar-segment {
	flex: 1 1 0;
	height: 5px;
	border-radius: 3px;
	background: rgba(0,0,0,0.15);
}
.mibeno-wcag-card.is-active .mibeno-wcag-bar-segment {
	background: rgba(255,255,255,0.3);
}
.mibeno-wcag-bar-segment.is-filled {
	background: #1a1a1a;
}
.mibeno-wcag-card.is-active .mibeno-wcag-bar-segment.is-filled {
	background: #fff;
}

.mibeno-wcag-reset-btn {
	white-space: normal !important;
	display: flex !important;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin-top: 16px;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #f5f5f5;
	cursor: pointer;
	font-weight: 600;
}
.mibeno-wcag-reset-btn:hover,
.mibeno-wcag-reset-btn:focus {
	outline: 2px solid #1a1a1a;
	outline-offset: 1px;
}
.mibeno-wcag-reset-btn .mibeno-wcag-card-icon {
	width: 24px;
	height: 24px;
	padding: 4px;
}

/* --- Efekty stosowane na całej stronie --- */

/* Tekst */
/* Skalowanie tekstu i wysokości linii jest teraz realizowane w JS
   (frontend.js: applyBiggerText / applyLineHeightLevel) - nadpisuje
   obliczony rozmiar każdego elementu bezpośrednio, inline, z !important.
   Zwykła reguła CSS na <html> nie działała na typografii Elementora,
   bo ta jest generowana w sztywnych pikselach, nie w em/rem. */

/* Wyrównanie tekstu jest teraz realizowane w JS (applyTextAlignLevel)
   z tego samego powodu co rozmiar tekstu i wysokość linii - Elementor
   ustawia text-align per-widget ze specyficznością, którą prosta
   reguła CSS na <html> przegrywa. */
html.mibeno-wcag-readable-font body,
html.mibeno-wcag-readable-font p,
html.mibeno-wcag-readable-font li,
html.mibeno-wcag-readable-font span,
html.mibeno-wcag-readable-font a,
html.mibeno-wcag-readable-font h1,
html.mibeno-wcag-readable-font h2,
html.mibeno-wcag-readable-font h3,
html.mibeno-wcag-readable-font h4,
html.mibeno-wcag-readable-font h5,
html.mibeno-wcag-readable-font h6 {
	font-family: Arial, Helvetica, sans-serif !important;
	letter-spacing: 0.01em !important;
}

/* Wizualny */
html.mibeno-wcag-contrast body {
	background: #000 !important;
	color: #fff !important;
}
html.mibeno-wcag-contrast body * {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
}
html.mibeno-wcag-contrast img,
html.mibeno-wcag-contrast svg {
	filter: grayscale(100%) contrast(1.2);
}
html.mibeno-wcag-grayscale {
	filter: grayscale(100%) !important;
}
html.mibeno-wcag-hide-images img,
html.mibeno-wcag-hide-images svg:not(.mibeno-wcag-card-icon svg):not(.mibeno-wcag-toolbar-toggle svg) {
	opacity: 0 !important;
	visibility: hidden !important;
}
html.mibeno-wcag-pause-animations *,
html.mibeno-wcag-pause-animations *::before,
html.mibeno-wcag-pause-animations *::after {
	animation-duration: 0.001ms !important;
	animation-delay: 0ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}
html.mibeno-wcag-pause-animations .swiper-wrapper {
	transition-duration: 0.001ms !important;
}

/* Orientacja */
html.mibeno-wcag-highlight-links a {
	text-decoration: underline !important;
	background-color: #fff3b0 !important;
	color: #000 !important;
}
html.mibeno-wcag-focus-outline :focus {
	outline: 4px solid #ff5f1f !important;
	outline-offset: 3px !important;
}

/* --- Maska czytania --- */
.mibeno-wcag-mask-overlay {
	position: fixed;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.65);
	z-index: 999997;
	pointer-events: none;
}
.mibeno-wcag-mask-top {
	top: 0;
	height: 0;
}
.mibeno-wcag-mask-bottom {
	bottom: 0;
	top: 100%;
}

/* --- Panel "Struktura strony" --- */
.mibeno-wcag-structure-panel {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	width: min(420px, 90vw);
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	color: #111;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0,0,0,0.3);
	z-index: 999999;
	padding: 12px 0;
}
.mibeno-wcag-structure-header {
	font-weight: 700;
	padding: 4px 16px 12px;
	border-bottom: 1px solid #eee;
	margin-bottom: 8px;
}
.mibeno-wcag-structure-list {
	list-style: none;
	margin: 0;
	padding: 0 8px;
}
.mibeno-wcag-structure-list li {
	margin: 2px 0;
}
.mibeno-wcag-structure-list button {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	padding: 8px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}
.mibeno-wcag-structure-list button:hover,
.mibeno-wcag-structure-list button:focus {
	background: #f0f0f0;
	outline: 2px solid #1a1a1a;
}

/* --- Linki otwierane w nowej karcie ---
   Wizualna strzałka celowo usunięta na życzenie - informacja
   "otwiera się w nowej karcie" trafia tylko do aria-label (JS),
   bez widocznego znaku. */

/* --- Region aria-live, niewidoczny wizualnie, ale dostępny dla czytników ekranu --- */
.mibeno-wcag-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
