/* Pragati Accessibility Suite — frontend.css
   Prefixed with .pas- / html.pas- to avoid theme conflicts. Lightweight,
   no external fonts or icon libraries required. */

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

/* ---------- Root wrapper + toggle button ---------- */
.pas-root {
	position: fixed;
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.pas-position-bottom-right { bottom: 20px; right: 20px; }
.pas-position-bottom-left  { bottom: 20px; left: 20px; }

.pas-toggle {
	width: 58px; height: 58px;
	border-radius: 50%;
	background: var(--pas-primary, #1a5fb4);
	color: #fff;
	border: 3px solid #fff;
	box-shadow: 0 3px 14px rgba(0,0,0,0.3);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
}
.pas-size-small .pas-toggle  { width: 46px; height: 46px; }
.pas-size-large .pas-toggle  { width: 70px; height: 70px; }
.pas-toggle:hover { filter: brightness(1.08); }
.pas-toggle:focus-visible, .pas-toggle:focus {
	outline: 3px solid #ffd54f; outline-offset: 3px;
}

/* ---------- Panel ---------- */
.pas-panel {
	position: fixed;
	bottom: 90px;
	width: var(--pas-panel-width, 380px);
	max-width: 94vw;
	max-height: 82vh;
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border-radius: var(--pas-radius, 14px);
	box-shadow: 0 10px 34px rgba(0,0,0,0.35);
	font-size: var(--pas-panel-font, 15px);
	z-index: 2147483001;
}
.pas-position-bottom-right .pas-panel { right: 20px; }
.pas-position-bottom-left .pas-panel  { left: 20px; }
.pas-panel[hidden] { display: none; }

.pas-panel-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 18px 8px;
	position: sticky; top: 0; background: #fff;
	border-bottom: 1px solid #eee;
}
.pas-panel-title { margin: 0; font-size: 1.2em; font-weight: 700; }
.pas-close {
	background: transparent; border: none; font-size: 1.5em; line-height: 1;
	cursor: pointer; padding: 6px 10px; border-radius: 6px;
}
.pas-close:hover { background: #f0f0f0; }
.pas-close:focus-visible { outline: 3px solid var(--pas-primary, #1a5fb4); outline-offset: 2px; }

.pas-keyboard-hint {
	font-size: 0.8em; color: #555; margin: 8px 18px; padding: 8px 10px;
	background: #f5f7fa; border-radius: 8px;
}

.pas-panel-body { padding: 0 18px 18px; }

.pas-section { padding: 14px 0; border-bottom: 1px solid #eee; }
.pas-section:last-child { border-bottom: none; }
.pas-section-title {
	font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.04em;
	margin: 0 0 10px; color: #333; font-weight: 700;
}

/* ---------- Controls ---------- */
.pas-button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.pas-btn {
	background: #f0f2f5; border: 1px solid #d5d9de; color: #1a1a1a;
	border-radius: 8px; padding: 10px 10px; font-size: 0.9em; cursor: pointer;
	text-align: center; min-height: 44px;
}
.pas-btn:hover { background: #e4e8ed; }
.pas-btn:focus-visible, .pas-btn:focus { outline: 3px solid var(--pas-primary, #1a5fb4); outline-offset: 2px; }
.pas-btn-primary { background: var(--pas-primary, #1a5fb4); color: #fff; border-color: var(--pas-primary, #1a5fb4); grid-column: 1 / -1; }
.pas-btn-danger { background: #fdecea; border-color: #f5c6cb; color: #7a1f1f; width: 100%; }
.pas-btn-danger:hover { background: #f8d7da; }

.pas-control-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.pas-control-label { font-size: 0.9em; flex: 1 1 auto; }
.pas-control-row select, .pas-control-row input[type="range"] { flex: 0 0 auto; min-width: 120px; }

.pas-toggle-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.9em; cursor: pointer; min-height: 44px; }
.pas-toggle-row input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }

.pas-segmented { display: inline-flex; border: 1px solid #d5d9de; border-radius: 8px; overflow: hidden; }
.pas-seg-btn { background: #f7f8fa; border: none; padding: 8px 12px; font-size: 0.85em; cursor: pointer; border-right: 1px solid #d5d9de; min-height: 40px; }
.pas-seg-btn:last-child { border-right: none; }
.pas-seg-btn[aria-pressed="true"], .pas-seg-btn.is-active { background: var(--pas-primary, #1a5fb4); color: #fff; }
.pas-seg-btn:focus-visible, .pas-seg-btn:focus { outline: 3px solid var(--pas-primary, #1a5fb4); outline-offset: 2px; }

.pas-inline-status { font-size: 0.8em; color: #444; min-height: 16px; margin: 4px 0 10px; }

/* ---------- Reading Guide bar ---------- */
#pas-reading-guide {
	position: fixed; left: 0; width: 100%; height: 34px;
	background: rgba(255, 235, 59, 0.28);
	border-top: 2px solid rgba(255, 193, 7, 0.6);
	border-bottom: 2px solid rgba(255, 193, 7, 0.6);
	pointer-events: none;
	z-index: 2147482900;
	display: none;
}
html.pas-reading-guide-on #pas-reading-guide { display: block; }

/* ---------- Reading Focus mode ---------- */
html.pas-reading-focus [data-pas-main-content] * { transition: opacity 0.15s ease; }
html.pas-reading-focus .pas-reading-active {
	background: rgba(255, 235, 59, 0.35);
	border-radius: 3px;
}

/* ---------- Text & reading controls (scoped to main content only) ---------- */
html[data-pas-font-scale] [data-pas-main-content] { font-size: calc(1em * var(--pas-font-scale, 1)); }
html.pas-font-readable [data-pas-main-content],
html.pas-font-readable [data-pas-main-content] * { font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important; }

html.pas-line-height-increased [data-pas-main-content] { line-height: 1.7 !important; }
html.pas-line-height-large [data-pas-main-content]     { line-height: 2.1 !important; }
html.pas-letter-spacing-increased [data-pas-main-content] { letter-spacing: 0.5px !important; }
html.pas-letter-spacing-large [data-pas-main-content]     { letter-spacing: 1.2px !important; }
html.pas-word-spacing-increased [data-pas-main-content]   { word-spacing: 3px !important; }

html.pas-text-align-left [data-pas-main-content]   { text-align: left !important; }
html.pas-text-align-center [data-pas-main-content] { text-align: center !important; }
html.pas-text-align-right [data-pas-main-content]  { text-align: right !important; }

html.pas-easy-reading [data-pas-main-content] p { margin-bottom: 1.2em !important; max-width: 70ch; }
html.pas-easy-reading [data-pas-main-content] { letter-spacing: 0.2px; }

/* ---------- Visual accessibility (site-wide) ---------- */
html.pas-mode-dark, html.pas-mode-dark body {
	background: #111214 !important; color: #eee !important;
}
html.pas-mode-dark a { color: #8ab4f8 !important; }
html.pas-mode-dark img, html.pas-mode-dark video { filter: brightness(0.9); }

html.pas-mode-contrast, html.pas-mode-contrast body {
	background: #000 !important; color: #fff !important;
}
html.pas-mode-contrast a { color: #ffd54f !important; }
html.pas-mode-contrast * {
	background-color: #000 !important; color: #fff !important; border-color: #fff !important;
}
html.pas-mode-contrast .pas-root, html.pas-mode-contrast .pas-root * {
	background-color: revert !important; color: revert !important; border-color: revert !important;
}

html.pas-grayscale body { filter: grayscale(100%); }
html.pas-grayscale .pas-root { filter: none; }

html[data-pas-saturation] body { filter: saturate(var(--pas-saturation, 1)); }
html.pas-grayscale[data-pas-saturation] body { filter: grayscale(100%) saturate(var(--pas-saturation, 1)); }
html.pas-mode-dark .pas-root, html.pas-mode-contrast .pas-root { filter: none; }

/* ---------- Cursor size ---------- */
html.pas-cursor-large, html.pas-cursor-large * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M4 2l14 8-6 2-2 6z" fill="black" stroke="white" stroke-width="1.5"/></svg>') 4 4, auto !important;
}
html.pas-cursor-xlarge, html.pas-cursor-xlarge * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path d="M4 2l14 8-6 2-2 6z" fill="black" stroke="white" stroke-width="1.5"/></svg>') 6 6, auto !important;
}

/* ---------- Quick tools ---------- */
html.pas-highlight-links a {
	outline: 2px solid #ff9800 !important;
	background: rgba(255, 152, 0, 0.12) !important;
}
html.pas-highlight-buttons button,
html.pas-highlight-buttons input[type="button"],
html.pas-highlight-buttons input[type="submit"] {
	outline: 2px solid #2196f3 !important;
}
html.pas-highlight-headings h1, html.pas-highlight-headings h2, html.pas-highlight-headings h3,
html.pas-highlight-headings h4, html.pas-highlight-headings h5, html.pas-highlight-headings h6 {
	background: rgba(26, 95, 180, 0.08) !important;
	border-left: 4px solid var(--pas-primary, #1a5fb4) !important;
	padding-left: 8px !important;
}
html.pas-underline-links a { text-decoration: underline !important; }

html.pas-stop-animations *, html.pas-stop-animations *::before, html.pas-stop-animations *::after {
	animation: none !important;
	transition: none !important;
}
html.pas-reduce-motion *, html.pas-reduce-motion *::before, html.pas-reduce-motion *::after {
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}

/* Keep our own panel readable/colorful even under dark/contrast/grayscale */
html.pas-mode-dark .pas-panel, html.pas-mode-contrast .pas-panel {
	background: #1c1d1f !important; color: #eee !important;
}
html.pas-mode-dark .pas-btn, html.pas-mode-contrast .pas-btn {
	background: #2a2b2e !important; color: #eee !important; border-color: #444 !important;
}

@media (max-width: 600px) {
	.pas-panel { width: 100vw; max-width: 100vw; left: 0 !important; right: 0 !important; bottom: 0; border-radius: var(--pas-radius, 14px) var(--pas-radius, 14px) 0 0; max-height: 90vh; }
}
