/* Etikos Accessibility 2.0 – All-in-One style widget (WCAG 2.1) */

:root {
	--etikos-a11y-accent: #1e4d8c;
}

/* Skip link */
.etikos-a11y-skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	z-index: 100000;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.etikos-a11y-skip-link:focus,
.etikos-a11y-skip-link:focus-visible {
	position: fixed;
	left: 1rem;
	top: 1rem;
	width: auto;
	height: auto;
	overflow: visible;
	padding: 0.75rem 1.25rem;
	background: var(--etikos-a11y-accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border-radius: 4px;
	outline: 3px solid #fff;
	outline-offset: 2px;
}

body.etikos-a11y-focus :is(a, button, input, select, textarea, summary, [tabindex]):focus {
	outline: none;
}

body.etikos-a11y-focus :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--etikos-a11y-accent);
	outline-offset: 2px;
}

.skip-link:focus,
.skip-link:focus-visible {
	position: fixed;
	left: 1rem;
	top: 4rem;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background: var(--etikos-a11y-accent);
	color: #fff;
	clip: auto;
	clip-path: none;
}

/* Floating widget */
.etikos-a11y-widget {
	position: fixed;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: #1d2327;
}

.etikos-a11y-widget[data-position='bottom-right'] {
	right: 1rem;
	bottom: 1rem;
}

.etikos-a11y-widget[data-position='bottom-left'] {
	left: 1rem;
	bottom: 1rem;
}

.etikos-a11y-widget[data-position='top-right'] {
	right: 1rem;
	top: 1rem;
}

.etikos-a11y-widget[data-position='top-left'] {
	left: 1rem;
	top: 1rem;
}

.etikos-a11y-widget[data-position^='top'] .etikos-a11y-widget__panel {
	top: calc(100% + 0.65rem);
	bottom: auto;
}

.etikos-a11y-widget__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.35rem;
	height: 3.35rem;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--etikos-a11y-accent);
	color: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
	cursor: pointer;
}

.etikos-a11y-widget__toggle:hover,
.etikos-a11y-widget__toggle:focus-visible {
	filter: brightness(1.08);
	transform: scale(1.04);
}

.etikos-a11y-widget__icon {
	display: flex;
	line-height: 0;
}

.etikos-a11y-widget__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.65rem);
	width: min(20rem, calc(100vw - 2rem));
	max-height: min(32rem, calc(100vh - 6rem));
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border: 2px solid var(--etikos-a11y-accent);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

.etikos-a11y-widget__panel[hidden] {
	display: none !important;
}

.etikos-a11y-widget__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid #e0e0e0;
	background: #f6f8fa;
}

.etikos-a11y-widget__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
}

.etikos-a11y-widget__reset {
	margin: 0;
	padding: 0.25rem 0.5rem;
	border: 0;
	background: transparent;
	color: var(--etikos-a11y-accent);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.etikos-a11y-widget__body {
	overflow-y: auto;
	padding: 0.5rem 0.65rem 0.65rem;
}

.etikos-a11y-widget__section + .etikos-a11y-widget__section {
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid #eee;
}

.etikos-a11y-widget__section-title {
	margin: 0 0 0.4rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #50575e;
}

.etikos-a11y-widget__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.4rem;
}

.etikos-a11y-widget__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-height: 4.25rem;
	margin: 0;
	padding: 0.4rem 0.35rem;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background: #fff;
	color: #1d2327;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
}

.etikos-a11y-widget__tile:hover,
.etikos-a11y-widget__tile:focus-visible {
	border-color: var(--etikos-a11y-accent);
	background: #f0f6fc;
}

.etikos-a11y-widget__tile[aria-pressed='true'] {
	border-color: var(--etikos-a11y-accent);
	background: var(--etikos-a11y-accent);
	color: #fff;
}

.etikos-a11y-widget__tile-icon {
	display: flex;
	opacity: 0.9;
}

.etikos-a11y-widget__tile-label {
	display: block;
}

.etikos-a11y-widget__footer {
	padding: 0.5rem 0.75rem;
	border-top: 1px solid #e0e0e0;
	text-align: center;
	font-size: 0.8rem;
}

.etikos-a11y-widget__footer a {
	color: var(--etikos-a11y-accent);
	font-weight: 600;
}

/* Reading guide */
.etikos-a11y-reading-guide {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99980;
	height: 40px;
	margin-top: -20px;
	pointer-events: none;
	background: rgba(255, 235, 59, 0.35);
	border-top: 2px solid #1e4d8c;
	border-bottom: 2px solid #1e4d8c;
}

.etikos-a11y-reading-guide[hidden] {
	display: none !important;
}

/* Content adjustments */
body.etikos-a11y-font-sm {
	font-size: 93.75%;
}

body.etikos-a11y-font-md {
	font-size: 106.25%;
}

body.etikos-a11y-font-lg {
	font-size: 118.75%;
}

body.etikos-a11y-readable-font {
	font-family: Verdana, Arial, Helvetica, sans-serif !important;
}

body.etikos-a11y-readable-font :is(p, li, a, span, div, td, th, label, button, input, select, textarea) {
	font-family: inherit !important;
}

body.etikos-a11y-line-height :is(p, li, div, article, section) {
	line-height: 1.85 !important;
}

body.etikos-a11y-letter-spacing :is(p, li, a, span, div, label) {
	letter-spacing: 0.06em !important;
}

body.etikos-a11y-hide-images img {
	visibility: hidden !important;
}

body.etikos-a11y-hide-images img[alt]:not([alt='']) {
	visibility: visible !important;
	outline: 3px dashed #c62828;
}

/* Color modes */
body.etikos-a11y-high-contrast {
	background: #000 !important;
	color: #fff !important;
}

body.etikos-a11y-high-contrast a {
	color: #ffeb3b !important;
	text-decoration: underline !important;
}

body.etikos-a11y-high-contrast
	:is(
		button:not(.etikos-search__button):not(.etikos-a11y-widget__toggle):not(
				.etikos-a11y-widget__tile
			):not(.etikos-a11y-widget__reset),
		.button,
		.wp-block-button__link
	) {
	background: #ffeb3b !important;
	color: #000 !important;
	border: 2px solid #fff !important;
}

body.etikos-a11y-monochrome {
	filter: grayscale(100%);
}

body.etikos-a11y-invert {
	filter: invert(1) hue-rotate(180deg);
}

body.etikos-a11y-invert img,
body.etikos-a11y-invert video {
	filter: invert(1) hue-rotate(180deg);
}

/* Navigation aids */
body.etikos-a11y-highlight-links a {
	outline: 2px solid #ffeb3b !important;
	outline-offset: 2px;
	background: rgba(255, 235, 59, 0.15) !important;
}

body.etikos-a11y-big-cursor,
body.etikos-a11y-big-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M4 4 L4 26 L12 20 L16 28 L20 26 L16 18 L26 18 Z'/%3E%3C/svg%3E")
			4 4,
		auto !important;
}

body.etikos-a11y-reduce-motion *,
body.etikos-a11y-reduce-motion *::before,
body.etikos-a11y-reduce-motion *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}

/* High contrast + paieškos filtras */
body.etikos-a11y-high-contrast .etikos-search-block {
	color: #fff !important;
}

body.etikos-a11y-high-contrast .etikos-search__heading,
body.etikos-a11y-high-contrast .etikos-search__filters-legend,
body.etikos-a11y-high-contrast .etikos-search__field label {
	color: #fff !important;
}

body.etikos-a11y-high-contrast .etikos-search__hint,
body.etikos-a11y-high-contrast .etikos-search__status,
body.etikos-a11y-high-contrast .etikos-search__meta,
body.etikos-a11y-high-contrast .etikos-search__snippet {
	color: #e8e8e8 !important;
}

body.etikos-a11y-high-contrast .etikos-search__input,
body.etikos-a11y-high-contrast .etikos-search-block select.etikos-search__input {
	background: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
	color-scheme: dark;
}

body.etikos-a11y-high-contrast .etikos-search__button--primary {
	background: #ffeb3b !important;
	color: #000 !important;
	border-color: #fff !important;
}

body.etikos-a11y-high-contrast .etikos-search__button--secondary {
	background: #000 !important;
	color: #ffeb3b !important;
	border-color: #ffeb3b !important;
}

body.etikos-a11y-high-contrast .etikos-search__result-title a,
body.etikos-a11y-high-contrast .etikos-search__open {
	color: #ffeb3b !important;
}

/* Widget in high contrast */
body.etikos-a11y-high-contrast .etikos-a11y-widget__panel {
	background: #000 !important;
	border-color: #ffeb3b !important;
	color: #fff !important;
}

body.etikos-a11y-high-contrast .etikos-a11y-widget__header {
	background: #111 !important;
	border-color: #444 !important;
}

body.etikos-a11y-high-contrast .etikos-a11y-widget__tile {
	background: #000 !important;
	color: #fff !important;
	border-color: #ffeb3b !important;
}

body.etikos-a11y-high-contrast .etikos-a11y-widget__tile[aria-pressed='true'] {
	background: #ffeb3b !important;
	color: #000 !important;
}

body.etikos-a11y-high-contrast .etikos-a11y-widget__toggle {
	background: #ffeb3b !important;
	color: #000 !important;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto !important;
	}
}

@media (max-width: 480px) {
	.etikos-a11y-widget__grid {
		grid-template-columns: 1fr;
	}
}

@media (forced-colors: active) {
	.etikos-a11y-skip-link:focus-visible,
	.etikos-a11y-widget__toggle:focus-visible,
	.etikos-a11y-widget__tile:focus-visible {
		outline: 3px solid CanvasText;
	}
}
