/* =========================================================
   Satoshiat — Accessibility widget (Arabic / RTL)
   ========================================================= */

.st-a11y {
	--st-a11y: #985321;
	--st-a11y-dark: #7a4219;
	--st-a11y-soft: #f5ebe0;
	position: relative;
	z-index: 99990;
}

.st-a11y__fab {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	left: auto;
	z-index: 99992;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: var(--st-a11y);
	color: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(152, 83, 33, 0.4);
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.st-a11y__fab:hover,
.st-a11y__fab:focus-visible {
	background: var(--st-a11y-dark);
	transform: translateY(-2px) scale(1.04);
	outline: none;
	box-shadow: 0 14px 32px rgba(152, 83, 33, 0.48);
}

.st-a11y__fab-icon {
	font-size: 1.45rem;
	line-height: 1;
}

.st-a11y__overlay {
	position: fixed;
	inset: 0;
	z-index: 99991;
	background: rgba(15, 23, 42, 0.42);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.st-a11y.is-open .st-a11y__overlay {
	opacity: 1;
	visibility: visible;
}

.st-a11y__panel {
	position: fixed;
	z-index: 99993;
	top: auto;
	bottom: 5.5rem;
	right: 1rem;
	left: auto;
	width: min(360px, calc(100vw - 2rem));
	max-height: min(78vh, 640px);
	display: flex;
	flex-direction: column;
	border-radius: 20px;
	overflow: hidden;
	background: #faf7f3;
	box-shadow: 0 22px 50px rgba(15, 23, 42, 0.28);
	transform: translateY(16px) scale(0.97);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
}

.st-a11y.is-open .st-a11y__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.st-a11y__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.9rem 1rem;
	background: var(--st-a11y);
	color: #fff;
	flex-shrink: 0;
}

.st-a11y__brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
}

.st-a11y__brand-icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	color: var(--st-a11y);
	flex-shrink: 0;
}

.st-a11y__brand-icon i {
	font-size: 1.05rem;
	line-height: 1;
}

.st-a11y__icon-btn i {
	font-size: 0.95rem;
	line-height: 1;
}

.st-a11y__brand h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	color: #fff;
}

.st-a11y__head-actions {
	display: flex;
	gap: 0.4rem;
}

.st-a11y__icon-btn {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: var(--st-a11y);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.st-a11y__icon-btn:hover {
	background: #fff;
	transform: scale(1.05);
}

.st-a11y__icon-btn svg {
	width: 1.1rem;
	height: 1.1rem;
}

.st-a11y__list {
	padding: 0.85rem;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.st-a11y__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.85rem;
	padding: 0.85rem 0.95rem;
	border-radius: 14px;
	background: #fff;
	border: 1px solid #efe6dc;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.st-a11y__item:hover {
	border-color: rgba(152, 83, 33, 0.35);
	box-shadow: 0 4px 14px rgba(152, 83, 33, 0.08);
}

.st-a11y__item-text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.st-a11y__item-text strong {
	font-size: 0.95rem;
	font-weight: 800;
	color: #1f2937;
}

.st-a11y__item-text em {
	font-style: normal;
	font-size: 0.78rem;
	font-weight: 600;
	color: #6b7280;
}

.st-a11y__switch {
	position: relative;
	width: 48px;
	height: 28px;
	flex-shrink: 0;
}

.st-a11y__switch input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
	z-index: 2;
}

.st-a11y__switch-ui {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #9ca3af;
	transition: background 0.2s ease;
}

.st-a11y__switch-ui::after {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease;
}

.st-a11y__switch input:checked + .st-a11y__switch-ui {
	background: var(--st-a11y);
}

.st-a11y__switch input:checked + .st-a11y__switch-ui::after {
	transform: translateX(-20px);
}

.st-a11y__switch input:focus-visible + .st-a11y__switch-ui {
	box-shadow: 0 0 0 3px rgba(152, 83, 33, 0.28);
}

.st-a11y__item--stepper {
	cursor: default;
}

.st-a11y__stepper {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
	background: var(--st-a11y-soft);
	border-radius: 999px;
	padding: 0.2rem;
}

.st-a11y__step-btn {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--st-a11y);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	box-shadow: 0 1px 4px rgba(152, 83, 33, 0.12);
	transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.st-a11y__step-btn:hover:not(:disabled) {
	background: var(--st-a11y);
	color: #fff;
}

.st-a11y__step-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.st-a11y__step-value {
	min-width: 1.4rem;
	text-align: center;
	font-weight: 800;
	font-size: 0.95rem;
	color: #1f2937;
}

html.st-dark .st-a11y__stepper {
	background: #1a2230;
}

html.st-dark .st-a11y__step-btn {
	background: #2a3344;
	color: #f3f4f6;
}

html.st-dark .st-a11y__step-value {
	color: #f3f4f6;
}

/* Reading guide */
.st-a11y__guide {
	position: fixed;
	left: 0;
	right: 0;
	height: 48px;
	z-index: 99980;
	pointer-events: none;
	background: rgba(152, 83, 33, 0.14);
	border-top: 2px solid rgba(152, 83, 33, 0.55);
	border-bottom: 2px solid rgba(152, 83, 33, 0.55);
	transform: translateY(-50%);
	display: none;
}

.st-a11y__guide[hidden] {
	display: none !important;
}

html.st-a11y-reading-guide .st-a11y__guide {
	display: block;
}

/* Feature effects applied on html (levels via CSS vars) */
html {
	--st-a11y-font-scale: 1;
	--st-a11y-letter: 0em;
	--st-a11y-word: 0em;
	--st-a11y-line: normal;
}

html.st-a11y-font-size {
	font-size: calc(100% * var(--st-a11y-font-scale)) !important;
}

html.st-a11y-text-spacing body,
html.st-a11y-text-spacing .st-single__content,
html.st-a11y-text-spacing .st-post-card__excerpt,
html.st-a11y-text-spacing p,
html.st-a11y-text-spacing li,
html.st-a11y-text-spacing a {
	letter-spacing: var(--st-a11y-letter) !important;
	word-spacing: var(--st-a11y-word) !important;
}

html.st-a11y-line-height body,
html.st-a11y-line-height .st-single__content,
html.st-a11y-line-height p,
html.st-a11y-line-height li,
html.st-a11y-line-height .st-post-card__excerpt {
	line-height: var(--st-a11y-line) !important;
}

html.st-a11y-dyslexia body,
html.st-a11y-dyslexia .st-single__content,
html.st-a11y-dyslexia p,
html.st-a11y-dyslexia h1,
html.st-a11y-dyslexia h2,
html.st-a11y-dyslexia h3 {
	font-family: "Comic Sans MS", "Cairo", Tahoma, sans-serif !important;
	letter-spacing: 0.04em;
	word-spacing: 0.08em;
}

html.st-a11y-hide-images img,
html.st-a11y-hide-images video,
html.st-a11y-hide-images iframe,
html.st-a11y-hide-images .st-hero-slider__media,
html.st-a11y-hide-images .st-post-card__media,
html.st-a11y-hide-images .st-float {
	visibility: hidden !important;
}

html.st-a11y-invert {
	filter: invert(1) hue-rotate(180deg);
}

html.st-a11y-invert img,
html.st-a11y-invert video,
html.st-a11y-invert .st-a11y {
	filter: invert(1) hue-rotate(180deg);
}

html.st-a11y-colorblind {
	filter: grayscale(0.15) contrast(1.12) saturate(1.35);
}

html.st-a11y-colorblind.st-a11y-invert {
	filter: invert(1) hue-rotate(180deg) contrast(1.1);
}

@media (min-width: 768px) {
	.st-a11y__fab {
		bottom: 1.5rem;
		right: 1.5rem;
	}

	.st-a11y__panel {
		bottom: 6rem;
		right: 1.5rem;
	}
}

html.st-dark .st-a11y__panel {
	background: #1a1f2a;
}

html.st-dark .st-a11y__item {
	background: #232a38;
	border-color: #334155;
}

html.st-dark .st-a11y__item-text strong {
	color: #f3f4f6;
}

html.st-dark .st-a11y__item-text em {
	color: #9ca3af;
}

@media (prefers-reduced-motion: reduce) {
	.st-a11y__fab,
	.st-a11y__panel,
	.st-a11y__overlay,
	.st-a11y__switch-ui,
	.st-a11y__switch-ui::after {
		transition: none !important;
	}
}
