/**
 * Panel pristupačnosti — neovisan o temi. Sve klase s prefiksom mun-a11y.
 * Skaliranje teksta (inline iz front.php) ovisi o postavci teme (em / rem).
 */

/* ---------- Gumb i panel ---------- */

.mun-a11y {
	position: fixed;
	bottom: 16px;
	z-index: 99990;
	font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: #1a1a1a;
	letter-spacing: normal;
	word-spacing: normal;
}

.mun-a11y--left { left: 16px; }
.mun-a11y--right { right: 16px; }

.mun-a11y__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.mun-a11y__toggle {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #0b4f8a;
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
	cursor: pointer;
}

.mun-a11y__toggle:hover,
.mun-a11y__toggle[aria-expanded="true"] { background: #083a66; }

.mun-a11y button:focus-visible,
.mun-a11y a:focus-visible {
	outline: 3px solid #f2b800;
	outline-offset: 2px;
}

.mun-a11y__panel {
	position: absolute;
	bottom: 64px;
	width: min(320px, calc(100vw - 32px));
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	padding: 16px;
	border: 1px solid #c7c7c7;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
	text-align: left;
}

.mun-a11y--left .mun-a11y__panel { left: 0; }
.mun-a11y--right .mun-a11y__panel { right: 0; }
.mun-a11y__panel[hidden] { display: none; }

.mun-a11y__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.mun-a11y .mun-a11y__title {
	margin: 0;
	padding: 0;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.3;
	font-family: inherit;
	color: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.mun-a11y__close {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.mun-a11y__close:hover { background: #eee; }

.mun-a11y__group { margin-bottom: 14px; }

.mun-a11y__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
}

.mun-a11y__sizes { display: flex; gap: 8px; }

.mun-a11y__size {
	flex: 1;
	height: 44px;
	padding: 0;
	border: 2px solid #c7c7c7;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	font-weight: 700;
	font-size: 16px;
	line-height: 1;
	font-family: inherit;
	cursor: pointer;
}

.mun-a11y__size--md { font-size: 20px; }
.mun-a11y__size--lg { font-size: 24px; }

.mun-a11y__size:hover,
.mun-a11y__switch:hover { border-color: #0b4f8a; }

.mun-a11y__size[aria-pressed="true"] {
	border-color: #0b4f8a;
	background: #0b4f8a;
	color: #fff;
}

.mun-a11y__switch {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	margin-bottom: 6px;
	padding: 8px 10px;
	border: 2px solid #c7c7c7;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	font-size: 15px;
	line-height: 1.3;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
}

.mun-a11y__box {
	flex: none;
	width: 18px;
	height: 18px;
	border: 2px solid #555;
	border-radius: 3px;
	background: #fff;
}

.mun-a11y__switch[aria-pressed="true"] { border-color: #0b4f8a; }

.mun-a11y__switch[aria-pressed="true"] .mun-a11y__box {
	border-color: #0b4f8a;
	background: #0b4f8a;
}

.mun-a11y__switch[aria-pressed="true"] .mun-a11y__box::after {
	content: "";
	display: block;
	width: 5px;
	height: 10px;
	margin: 0 auto;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.mun-a11y__reset {
	width: 100%;
	min-height: 40px;
	margin-bottom: 12px;
	border: 0;
	border-radius: 6px;
	background: #eee;
	color: #1a1a1a;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	font-family: inherit;
	cursor: pointer;
}

.mun-a11y__reset:hover { background: #ddd; }

.mun-a11y .mun-a11y__links {
	margin: 0;
	padding: 12px 0 0;
	border-top: 1px solid #ddd;
	list-style: none;
}

.mun-a11y .mun-a11y__links li { margin: 0 0 6px; padding: 0; }
.mun-a11y .mun-a11y__links li::before { content: none; }

.mun-a11y .mun-a11y__links a {
	color: #0b4f8a;
	font-size: 15px;
	text-decoration: underline;
}

/* ---------- Načini prikaza (na <html>) ---------- */

/* Visoki kontrast: crno na bijelom, poveznice plave i podcrtane. */
html.mun-a11y-contrast body,
html.mun-a11y-contrast body *:not(.mun-a11y, .mun-a11y *) {
	background-color: #fff !important;
	background-image: none !important;
	color: #000 !important;
	border-color: #000 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

html.mun-a11y-contrast body a:not(.mun-a11y a),
html.mun-a11y-contrast body a:not(.mun-a11y a) * {
	color: #0000c8 !important;
	text-decoration: underline !important;
}

html.mun-a11y-contrast body :focus-visible {
	outline: 3px solid #000 !important;
	outline-offset: 2px !important;
}

/* Tamna pozadina: inverzija stranice; slike i video vraćeni u izvorne boje. */
html.mun-a11y-dark {
	background: #fff;
	filter: invert(1) hue-rotate(180deg);
}

html.mun-a11y-dark img,
html.mun-a11y-dark video,
html.mun-a11y-dark iframe,
html.mun-a11y-dark picture,
html.mun-a11y-dark canvas,
html.mun-a11y-dark [style*="background-image"],
html.mun-a11y-dark .mun-a11y {
	filter: invert(1) hue-rotate(180deg);
}

/* Pomoć za disleksiju: razmaci iz WCAG 2.1 kriterija 1.4.12 (razmak teksta). */
html.mun-a11y-dyslexia body :is(p, li, dd, dt, td, th, blockquote, figcaption, label, a, span, h1, h2, h3, h4, h5, h6):not(.mun-a11y, .mun-a11y *) {
	letter-spacing: .12em !important;
	word-spacing: .16em !important;
	line-height: 1.5 !important;
}

html.mun-a11y-dyslexia body p:not(.mun-a11y p) { margin-bottom: 2em !important; }

/* Podcrtane poveznice. */
html.mun-a11y-links body a:not(.mun-a11y a) { text-decoration: underline !important; }

@media print {
	.mun-a11y { display: none !important; }
}
