/* Alat za pristupačnost: gumb, panel i prilagodbe (vidi inc/a11y.php). */

/* --- Gumb i panel --------------------------------------------------------- */

.a11y {
	position: fixed;
	right: 1em;
	bottom: 1em;
	z-index: 90;
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: 16px;
	line-height: 1.4;
}

.a11y__toggle {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #1b1464;
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.a11y__toggle:hover {
	transform: scale(1.06);
}

.a11y__toggle.is-active {
	background: #1e7a2c;
}

.a11y__toggle:focus-visible,
.a11y button:focus-visible,
.a11y a:focus-visible {
	outline: 3px solid #ff931e;
	outline-offset: 3px;
}

.a11y__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.75em);
	width: min(340px, calc(100vw - 2em));
	max-height: min(640px, calc(100dvh - 6em));
	overflow-y: auto;
	padding: 1.1em;
	border-radius: 10px;
	background: #fff;
	color: #0a0b10;
	box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.45);
}

.a11y__panel[hidden] {
	display: none;
}

.a11y__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.9em;
}

.a11y__title {
	margin: 0;
	color: #1b1464;
	font-size: 1.25em;
	line-height: 1.2;
	letter-spacing: 0;
}

.a11y__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #eeefff;
	color: #1b1464;
	cursor: pointer;
}

.a11y__size {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
	margin-bottom: 0.75em;
	padding: 0.6em 0.75em;
	border-radius: 8px;
	background: #eeefff;
	font-weight: 700;
	color: #1b1464;
}

.a11y__size-controls {
	display: flex;
	align-items: center;
	gap: 0.4em;
}

.a11y__size-controls button {
	min-width: 44px;
	height: 40px;
	border: 2px solid #1b1464;
	border-radius: 6px;
	background: #fff;
	color: #1b1464;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.a11y__size-controls button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.a11y__size-controls output {
	min-width: 3.2em;
	text-align: center;
}

.a11y__options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.a11y__option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2em;
	width: 100%;
	height: 100%;
	padding: 0.65em 0.7em;
	border: 2px solid #d6d7ea;
	border-radius: 8px;
	background: #fff;
	color: #0a0b10;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.a11y__option-label {
	font-size: 0.9em;
	font-weight: 700;
	color: #1b1464;
}

.a11y__option-desc {
	font-size: 0.75em;
	color: #4f5160;
}

.a11y__option[aria-pressed="true"] {
	border-color: #1b1464;
	background: #1b1464;
}

.a11y__option[aria-pressed="true"] .a11y__option-label,
.a11y__option[aria-pressed="true"] .a11y__option-desc {
	color: #fff;
}

.a11y__option[aria-pressed="true"] .a11y__option-label::after {
	content: " ✓";
}

.a11y__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-top: 0.9em;
	font-size: 0.85em;
}

.a11y__reset {
	padding: 0.55em 0.9em;
	border: 0;
	border-radius: 6px;
	background: #ff931e;
	color: #1b1464;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.a11y__foot a {
	color: #1b1464;
}

/* Na uskim ekranima traka za kolačiće je preko cijele širine: gumb ide iznad nje. */
@media (max-width: 680px) {
	body:has(.cookie-banner:not([hidden])) .a11y {
		bottom: 11rem;
	}
}

/* --- Prilagodbe prikaza --------------------------------------------------- */

html[data-a11y-text="1"] {
	font-size: 112%;
}

html[data-a11y-text="2"] {
	font-size: 125%;
}

html[data-a11y-text="3"] {
	font-size: 140%;
}

/* Visoki kontrast (panel alata ostaje čitljiv u svojim bojama). */
html.a11y-contrast body,
html.a11y-contrast body *:where(:not(.a11y, .a11y *, img, video, svg, svg *)) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

html.a11y-contrast body a:not(.a11y *),
html.a11y-contrast body a:not(.a11y *) * {
	color: #ffeb3b !important;
}

html.a11y-contrast body :is(.wp-element-button, .wp-block-button__link, button):not(.a11y *) {
	border: 2px solid #ffeb3b !important;
	color: #ffeb3b !important;
}

html.a11y-contrast .wp-block-cover__background,
html.a11y-contrast .wp-block-cover__image-background {
	opacity: 0.25 !important;
}

/* Istaknuti linkovi. */
html.a11y-links body a:not(.a11y *) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
	outline: 2px dashed currentColor;
	outline-offset: 2px;
}

/* Čitljiviji font. */
html.a11y-font body,
html.a11y-font body *:not(.a11y *):not(svg *) {
	font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
	letter-spacing: 0.04em !important;
	word-spacing: 0.12em !important;
	font-style: normal !important;
}

/* Veći razmak redaka. */
html.a11y-spacing body :is(p, li, dd, dt, label, td, th, blockquote, figcaption):not(.a11y *) {
	line-height: 2 !important;
}

html.a11y-spacing body p:not(.a11y *) {
	margin-bottom: 1.4em !important;
}

/* Bez animacija. */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

html.a11y-motion .reveal {
	opacity: 1 !important;
	transform: none !important;
}

/* Sivi tonovi (alat ostaje u boji jer je izvan filtriranog sadržaja). */
html.a11y-grayscale body > :not(.a11y) {
	filter: grayscale(1);
}

/* Veći pokazivač. */
html.a11y-cursor,
html.a11y-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1 3.6 7.2-2.7 1.3-3.6-7.2L5 20z' fill='%23000' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E") 4 2, auto !important;
}

@media print {
	.a11y {
		display: none;
	}
}
