/* SocialLane Accessibility Widget — standalone styles, no theme dependency. */

:root {
	--saw-accent: #005D68;
	--saw-text: #1a1a1a;
	--saw-surface: #ffffff;
	--saw-surface-soft: #f2f5f6;
	--saw-border: #d7dee0;
}

#saw-root, #saw-root * {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Toggle button ---------- */

.saw-toggle {
	position: fixed;
	z-index: 999998;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--saw-accent);
	color: #fff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.saw-toggle svg {
	width: 28px;
	height: 28px;
}

.saw-toggle:focus-visible {
	outline: 3px solid #ffb703;
	outline-offset: 2px;
}

.saw-pos-bottom-right { bottom: 20px; right: 20px; }
.saw-pos-bottom-left  { bottom: 20px; left: 20px; }
.saw-pos-top-right    { top: 20px; right: 20px; }
.saw-pos-top-left     { top: 20px; left: 20px; }

/* ---------- Panel ---------- */

.saw-panel {
	position: fixed;
	z-index: 999999;
	width: min(360px, calc(100vw - 32px));
	max-height: min(640px, calc(100vh - 40px));
	overflow-y: auto;
	background: var(--saw-surface);
	color: var(--saw-text);
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	padding: 0;
}

.saw-panel[hidden] { display: none; }

.saw-panel.saw-pos-bottom-right { bottom: 84px; right: 20px; }
.saw-panel.saw-pos-bottom-left  { bottom: 84px; left: 20px; }
.saw-panel.saw-pos-top-right    { top: 84px; right: 20px; }
.saw-panel.saw-pos-top-left     { top: 84px; left: 20px; }

.saw-panel-header {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--saw-accent);
	color: #fff;
	padding: 14px 16px;
	border-radius: 12px 12px 0 0;
}

.saw-panel-header h2 {
	margin: 0 !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	color: #fff !important;
	line-height: 1.2 !important;
}

.saw-panel-close {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.saw-panel-close:focus-visible,
.saw-tool:focus-visible,
.saw-profile:focus-visible,
.saw-structure-item:focus-visible,
.saw-reset:focus-visible {
	outline: 3px solid #ffb703;
	outline-offset: 2px;
}

.saw-panel-body {
	padding: 14px 16px 18px;
}

.saw-section-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #55666b;
	margin: 16px 0 8px;
}

.saw-section-title:first-child { margin-top: 0; }

.saw-profiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.saw-profile {
	border: 1px solid var(--saw-border);
	background: var(--saw-surface-soft);
	border-radius: 8px;
	padding: 10px 8px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--saw-text);
	cursor: pointer;
	text-align: center;
}

.saw-profile[aria-pressed="true"] {
	background: var(--saw-accent);
	border-color: var(--saw-accent);
	color: #fff;
}

.saw-tools {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.saw-tool {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	border: 1px solid var(--saw-border);
	background: var(--saw-surface);
	border-radius: 8px;
	padding: 10px 10px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--saw-text);
	cursor: pointer;
	line-height: 1.25;
	text-align: left;
}

.saw-tool:hover {
	background: var(--saw-surface-soft);
}

.saw-tool[aria-pressed="true"] {
	border-color: var(--saw-accent);
	background: color-mix(in srgb, var(--saw-accent) 12%, white);
}

.saw-tool svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	color: var(--saw-accent);
}

.saw-tool span {
	flex: 1;
}

.saw-tool-check {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: var(--saw-accent);
	visibility: hidden;
}

.saw-tool[aria-pressed="true"] .saw-tool-check {
	visibility: visible;
}

.saw-reset {
	margin-top: 16px;
	width: 100%;
	background: var(--saw-surface-soft);
	border: 1px solid var(--saw-border);
	border-radius: 8px;
	padding: 10px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	color: var(--saw-text);
}

.saw-structure-section-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: var(--saw-surface-soft);
	border: 1px solid var(--saw-border);
	border-radius: 8px;
	padding: 10px 12px;
	margin: 6px 0;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--saw-text);
	cursor: pointer;
	min-height: 40px;
}

.saw-chevron {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.saw-structure-section-toggle.saw-section-open .saw-chevron {
	transform: rotate(180deg);
}

.saw-structure-section-toggle.saw-section-open {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	margin-bottom: 0;
}

.saw-structure-list {
	list-style: none;
	margin: 0 0 6px;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid var(--saw-border);
	border-top: none;
	border-radius: 0 0 8px 8px;
}

.saw-structure-item {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	border-bottom: 1px solid var(--saw-border);
	padding: 8px 10px;
	font-size: 12.5px;
	cursor: pointer;
	color: var(--saw-text);
}

.saw-structure-item:last-child { border-bottom: none; }
.saw-structure-item:hover { background: var(--saw-surface-soft); }

.saw-structure-item[data-level="1"] { font-weight: 700; }
.saw-structure-item[data-level="2"] { padding-left: 20px; }
.saw-structure-item[data-level="3"] { padding-left: 30px; }
.saw-structure-item[data-level="4"],
.saw-structure-item[data-level="5"],
.saw-structure-item[data-level="6"] { padding-left: 40px; }

.saw-empty-note {
	font-size: 12.5px;
	color: #667;
	padding: 8px 2px;
}

.saw-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Effects applied to <html> when a tool is active ---------- */

html.saw-contrast body,
html.saw-contrast body * {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
}
html.saw-contrast a, html.saw-contrast a * { color: #ffd400 !important; }
html.saw-contrast img, html.saw-contrast svg, html.saw-contrast video { filter: grayscale(0%) contrast(120%); }

html.saw-saturation-off body { filter: grayscale(100%); }

/*
 * Applied to the <html> root, not <body>: Tailwind's text-* utilities are
 * rem-based, and rem is always relative to the root element's font-size —
 * never to <body>. Scaling <body> instead would leave nearly all Tailwind
 * text sizes on the page completely unaffected.
 */
html.saw-bigger-text-1 { font-size: 110% !important; }
html.saw-bigger-text-2 { font-size: 120% !important; }
html.saw-bigger-text-3 { font-size: 135% !important; }
html.saw-bigger-text-4 { font-size: 150% !important; }

html.saw-text-spacing body,
html.saw-text-spacing body * {
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}

html.saw-line-height body,
html.saw-line-height body * { line-height: 1.9 !important; }

html.saw-text-align body,
html.saw-text-align body * { text-align: left !important; }

html.saw-dyslexia-font body,
html.saw-dyslexia-font body * {
	font-family: "OpenDyslexic", Verdana, Tahoma, "Comic Sans MS", sans-serif !important;
}

html.saw-highlight-links a,
html.saw-highlight-links a * {
	background: #ffe58a !important;
	color: #000 !important;
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
}

html.saw-hide-images img,
html.saw-hide-images picture,
html.saw-hide-images svg:not(#saw-root svg),
html.saw-hide-images video,
html.saw-hide-images [style*="background-image"] {
	visibility: hidden !important;
}

/*
 * Applied by JS (saw-widget.js: applyHideBackgroundImages) after scanning
 * computed styles — catches Tailwind's compiled bg-[url(...)] utility
 * classes, which never match the inline-style selector above.
 */
.saw-hidden-bg {
	visibility: hidden !important;
}

html.saw-big-cursor, html.saw-big-cursor * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1" d="M3 2l6.5 18 3-7.5L20 9.5z"/></svg>') 4 4, auto !important;
}

html.saw-pause-animations *,
html.saw-pause-animations *::before,
html.saw-pause-animations *::after {
	animation-play-state: paused !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* Focus target used when jumping to a heading/landmark that isn't natively focusable. */
[data-saw-focus-target]:focus {
	outline: 3px solid var(--saw-accent);
	outline-offset: 3px;
}

/* Tooltips-on toggle: reveal the native title attribute as a persistent, styled bubble. */
html.saw-tooltips [title] {
	position: relative;
}
html.saw-tooltips [title]:hover::after,
html.saw-tooltips [title]:focus::after {
	content: attr(title);
	position: absolute;
	left: 0;
	bottom: 100%;
	margin-bottom: 6px;
	background: #1a1a1a;
	color: #fff;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 6px;
	white-space: nowrap;
	z-index: 999997;
	pointer-events: none;
}
