/* ITPS WCAG 2.2 – front-end fixes. Each block is scoped to a body class the plugin adds only when that fix is enabled. */

/* Screen-reader-only text */
.itps-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* 2.4.1 Bypass Blocks – skip link */
.itps-skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 1000000;
	padding: 12px 18px;
	background: #111;
	color: #fff !important;
	font: 600 16px/1.2 system-ui, sans-serif;
	text-decoration: underline;
	border-radius: 4px;
	transform: translateY(-200%);
	transition: transform .15s;
}
.itps-skip-link:focus {
	transform: none;
	outline: 3px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--itps-focus, #1a56db);
}
#itps-main:focus { outline: none; }

/* 2.4.7 Focus Visible (+ close to 2.4.13 Focus Appearance) */
body.itps-fv :focus-visible {
	outline: 3px solid var(--itps-focus, #1a56db) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #fff !important;
	border-radius: 2px;
}
body.itps-fv .elementor-button:focus-visible,
body.itps-fv .elementor-item:focus-visible,
body.itps-fv .elementor-tab-title:focus-visible,
body.itps-fv .e-n-tab-title:focus-visible,
body.itps-fv .elementor-toggle-title:focus-visible,
body.itps-fv .elementor-menu-toggle:focus-visible {
	outline: 3px solid var(--itps-focus, #1a56db) !important;
	outline-offset: 2px !important;
}

/* 2.4.11 Focus Not Obscured (Minimum) – leave room under sticky header/footer */
html:has(body.itps-fno) {
	scroll-padding-top: var(--itps-sticky, 100px);
	scroll-padding-bottom: 80px;
}

/* 2.5.8 Target Size (Minimum) – 24x24 CSS px */
body.itps-ts button,
body.itps-ts [role="button"],
body.itps-ts input[type="submit"],
body.itps-ts input[type="button"],
body.itps-ts input[type="reset"],
body.itps-ts select,
body.itps-ts .elementor-icon,
body.itps-ts .elementor-social-icon,
body.itps-ts .elementor-menu-toggle,
body.itps-ts .swiper-pagination-bullet,
body.itps-ts .elementor-swiper-button {
	min-width: 24px;
	min-height: 24px;
}
body.itps-ts input[type="checkbox"],
body.itps-ts input[type="radio"] {
	min-width: 20px;
	min-height: 20px;
	margin: 2px;
}
body.itps-ts .swiper-pagination-bullet {
	/* keep the visual dot small, grow the hit area */
	position: relative;
	background-clip: content-box;
	padding: 8px;
	box-sizing: content-box;
	width: 8px;
	height: 8px;
	min-width: 0;
	min-height: 0;
}
body.itps-ts a.itps-icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	min-height: 24px;
}

/* 1.4.1 Use of Color – underline links in body copy */
body.itps-lu :is(main, article, .entry-content, .elementor-widget-text-editor, .elementor-widget-theme-post-content) p a:not(.elementor-button):not([class*="button"]),
body.itps-lu :is(main, article, .entry-content, .elementor-widget-text-editor, .elementor-widget-theme-post-content) li a:not(.elementor-button):not([class*="button"]):not(.elementor-item):not(.elementor-sub-item) {
	text-decoration: underline !important;
	text-underline-offset: .15em;
}

/* 2.2.2 / 2.3.3 – respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	body.itps-rm *,
	body.itps-rm *::before,
	body.itps-rm *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	body.itps-rm .elementor-invisible { visibility: visible !important; }
}

/* 2.2.2 Pause button added to auto-playing carousels */
.itps-carousel-pause {
	position: absolute;
	z-index: 20;
	right: 8px;
	bottom: 8px;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: rgba(0, 0, 0, .75);
	color: #fff;
	cursor: pointer;
}
.itps-carousel-pause svg { width: 16px; height: 16px; fill: currentColor; }

/* Scanner highlight (admin-only preview mode) */
[data-itps-issue] { outline: 3px dashed #d63638 !important; outline-offset: 2px; }
