/* A11y Debug Overlay — visual markers and tooltips. Only visible in debug mode. */

/* ── Element markers — controlled by body classes set by debug-toolbar.js ─────
 *
 *  body.a11y-overlay-ok-on    → show green outlines on passing elements
 *  body.a11y-overlay-fixed-on → show amber outlines on corrected elements
 *
 *  Classes are toggled live from the floating debug toolbar or set on page load
 *  from admin settings / localStorage prefs, so no page reload is needed.
 * ─────────────────────────────────────────────────────────────────────────── */

.a11y-debug-ok,
.a11y-debug-fixed {
	outline: none;
	outline-offset: 2px;
}

.a11y-debug-fixed {
	position: relative;
}

/* OK — green */
body.a11y-overlay-ok-on .a11y-debug-ok {
	outline: 2px solid #10b981 !important;
}

body.a11y-overlay-ok-on .a11y-debug-ok::before {
	content: '✓ A11y OK';
	position: absolute;
	top: -18px;
	left: 0;
	font: 600 10px/1 system-ui, sans-serif;
	color: #fff;
	background: #10b981;
	padding: 2px 5px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 9998;
	pointer-events: none;
}

/* Fixed — amber */
body.a11y-overlay-fixed-on .a11y-debug-fixed {
	outline: 2px solid #f59e0b !important;
}

body.a11y-overlay-fixed-on .a11y-debug-fixed::before {
	content: '⚠ A11y Fixed';
	position: absolute;
	top: -18px;
	left: 0;
	font: 600 10px/1 system-ui, sans-serif;
	color: #fff;
	background: #f59e0b;
	padding: 2px 5px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 9998;
	pointer-events: none;
}

/* ── Custom tooltip ────────────────────────────────────────────────────────────── */
.a11y-debug-tooltip {
	position: fixed;
	z-index: 999999;
	max-width: 320px;
	background: #1e293b;
	color: #f1f5f9;
	border-radius: 8px;
	font: 12px/1.5 system-ui, sans-serif;
	box-shadow: 0 4px 24px rgba(0,0,0,.45);
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .15s ease, transform .15s ease;
	overflow: hidden;
}

.a11y-debug-tooltip--visible {
	opacity: 1;
	transform: translateY(0);
}

.a11y-debug-tooltip__header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	font-weight: 700;
	font-size: 12px;
}

.a11y-debug-tooltip__header.a11y-debug-tooltip__fixed {
	background: #92400e;
}

.a11y-debug-tooltip__header.a11y-debug-tooltip__ok {
	background: #064e3b;
}

.a11y-debug-tooltip__icon {
	font-size: 14px;
}

.a11y-debug-tooltip__body {
	padding: 8px 12px 10px;
	border-top: 1px solid rgba(255,255,255,.08);
}

.a11y-debug-tooltip__ok-body {
	color: #6ee7b7;
	font-weight: 600;
}

.a11y-debug-tooltip__status {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #94a3b8;
	margin-bottom: 4px;
}

.a11y-debug-tooltip__list {
	margin: 0;
	padding: 0 0 0 14px;
	color: #fbbf24;
}

.a11y-debug-tooltip__list li {
	margin-bottom: 2px;
}

/* ── Elementor editor: never show overlays inside the editor ────────────────── */
.elementor-edit-mode .a11y-debug-fixed,
.elementor-edit-mode .a11y-debug-ok {
	outline: none !important;
}

.elementor-edit-mode .a11y-debug-fixed::before,
.elementor-edit-mode .a11y-debug-ok::before {
	display: none;
}
