/* ---- Always on ---- */
:focus-visible { outline: 3px solid #1a5fd0 !important; outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
/* The faded Gregorian date was below comfortable contrast. */
.white-greg-date { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- Reader preferences ---- */
html.wa11y-size-115 { font-size: 115%; }
html.wa11y-size-130 { font-size: 130%; }
html.wa11y-size-150 { font-size: 150%; }
html.wa11y-links a { text-decoration: underline !important; text-underline-offset: .2em; }
/* Reading text only: the header (logo, site title, tagline, menu), titles and footer keep their layout.
   No letter spacing: it breaks the joining of Persian letters. */
html.wa11y-spacing :is(.wp-block-post-content, .wp-block-post-excerpt, .wp-block-comment-content) :is(p, li, dd, blockquote) { line-height: 2.2 !important; word-spacing: .16em !important; }
html.wa11y-spacing :is(.wp-block-post-content, .wp-block-comment-content) p { margin-block-end: 1.6em; }
html.wa11y-motion *, html.wa11y-motion *::before, html.wa11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Backgrounds become transparent over a black page. Painting each element black would turn the
   see-through layers on top of cover and featured images into solid boxes that hide them.
   :where() keeps specificity low, so the link and overlay rules below can override this one. */
html.wa11y-contrast, html.wa11y-contrast body { background: #000 !important; color: #fff !important; }
html.wa11y-contrast body *:not(:where(#wa11y, #wa11y *, img, video, svg, svg *)) { background-color: transparent !important; color: #fff !important; border-color: #fff !important; text-shadow: none !important; }
html.wa11y-contrast body a, html.wa11y-contrast body a *:not(:where(img, svg, svg *)) { color: #ff0 !important; }
/* Layers that must stay solid: image lightbox backdrop and drop-down / mobile menus. */
html.wa11y-contrast body .wp-lightbox-overlay .scrim,
html.wa11y-contrast body .wp-block-navigation__responsive-container.is-menu-open,
html.wa11y-contrast body .wp-block-navigation .wp-block-navigation__submenu-container { background-color: #000 !important; }
/* Text laid over a cover image gets an outline instead of a box. */
html.wa11y-contrast body .wp-block-cover .wp-block-cover__inner-container * { text-shadow: 0 0 3px #000, 0 0 6px #000 !important; }
html.wa11y-contrast :focus-visible { outline-color: #0ff !important; box-shadow: none; }

/* ---- Menu (px units so text scaling doesn't resize it) ---- */
#wa11y { position: fixed; left: 16px; bottom: 16px; z-index: 99990; font-size: 15px; line-height: 1.6; text-align: right; }
#wa11y button { font: inherit; cursor: pointer; }
#wa11y-open { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #1a4fb0; color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
#wa11y-panel { position: absolute; left: 0; bottom: 60px; width: 352px; max-width: calc(100vw - 32px); max-height: calc(100vh - 100px); overflow-y: auto; box-sizing: border-box; padding: 14px; border: 2px solid #111; border-radius: 12px; background: #fff; color: #111; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
#wa11y-panel[hidden] { display: none; }
#wa11y-title { margin: 0 0 10px; font-weight: 700; }
#wa11y-title, #wa11y-panel > button:not([hidden]) { display: flex; align-items: center; gap: 10px; }
#wa11y [lang="en"] { direction: ltr; unicode-bidi: isolate; text-align: left; font-family: Manrope, system-ui, -apple-system, Roboto, sans-serif; font-size: 13px; }
.wa11y-caption { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
#wa11y-panel button { display: block; width: 100%; min-height: 44px; margin: 6px 0 0; padding: 6px 10px; border: 1px solid #555; border-radius: 8px; background: #fff; color: #111; text-align: right; }
#wa11y-panel button[aria-pressed="true"] { background: #1a4fb0; border-color: #1a4fb0; color: #fff; }
#wa11y .wa11y-icon { width: 20px; height: 20px; flex: none; }
#wa11y #wa11y-open .wa11y-icon { width: 28px; height: 28px; }
#wa11y .wa11y-fa { margin-left: auto; } /* icon + Persian stay together on the right, English on the left */
/* The tick keeps its space when off (and on Reset), so the English labels stay aligned. */
#wa11y #wa11y-panel .wa11y-check { width: 16px; height: 16px; visibility: hidden; }
#wa11y #wa11y-panel button[aria-pressed="true"] .wa11y-check { visibility: visible; }
#wa11y-panel button[aria-disabled="true"] { opacity: .45; cursor: default; }
.wa11y-size { display: flex; align-items: center; gap: 8px; direction: ltr; }
#wa11y-panel .wa11y-size button { display: grid; place-items: center; flex: 1; margin: 0; }
#wa11y #wa11y-panel .wa11y-size .wa11y-icon { width: 24px; height: 24px; }
.wa11y-size output { min-width: 4em; text-align: center; }
@media print { #wa11y { display: none; } }
