/* ===== Lorian accessibility system ===== */
/* Always-on fixes: focus visibility, focus-not-obscured, skip link */
html{scroll-padding-top:7.5rem;scroll-padding-bottom:2rem}
html body :focus-visible{outline:3px solid #fcebc7!important;outline-offset:3px!important}
#main-content:focus{outline:none!important}
.a11y-sr-only{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.a11y-skip{position:fixed;top:-100px;right:16px;z-index:100001;padding:12px 20px;border-radius:12px;background:#fcebc7;color:#14151b;font:700 16px/1.3 Rubik,Arial,sans-serif;text-decoration:none;transition:top .15s}
.a11y-skip:focus{top:12px}
.a11y-foot-btn{all:unset;box-sizing:border-box;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.a11y-foot-btn:hover{color:#fff}

/* ===== Widget UI (px based so it stays stable while the page text scales) ===== */
#a11y-root{direction:rtl;font:400 16px/1.45 Rubik,Arial,Helvetica,sans-serif;color:#f5f3ef}
#a11y-root *,#a11y-root *::before,#a11y-root *::after{box-sizing:border-box}
#a11y-root [hidden]{display:none!important}
.a11y-fab{position:fixed;left:16px;bottom:calc(20px + env(safe-area-inset-bottom,0px));z-index:100000;width:58px;height:58px;border-radius:50%;border:2px solid #14151b;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#14151b;background:linear-gradient(135deg,#fcebc7 0%,#d4af37 55%,#ba9329 100%);box-shadow:0 8px 24px rgba(0,0,0,.55),0 0 0 3px rgba(252,235,199,.35);transition:transform .15s,box-shadow .15s}
.a11y-fab:hover{transform:scale(1.07);box-shadow:0 10px 28px rgba(0,0,0,.6),0 0 0 4px rgba(252,235,199,.55)}
.a11y-fab:active{transform:scale(.96)}
.a11y-fab[aria-expanded="true"]{background:#14151b;color:#fcebc7;border-color:#d4af37}
.a11y-fab svg{width:32px;height:32px;fill:currentColor}
.a11y-panel{position:fixed;left:16px;bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:100000;width:min(400px,calc(100vw - 32px));max-height:calc(100vh - 108px - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 108px - env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;background:#14151b;border:1px solid rgba(212,175,55,.55);border-radius:22px;box-shadow:0 24px 60px rgba(0,0,0,.65);overflow:hidden}
.a11y-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:linear-gradient(135deg,rgba(212,175,55,.22),rgba(20,21,27,.9));border-bottom:1px solid rgba(212,175,55,.35)}
.a11y-title{display:flex;align-items:center;gap:10px;margin:0;font-size:19px;font-weight:700;color:#fff}
.a11y-title svg{width:26px;height:26px;fill:#d4af37;flex:none}
.a11y-title:focus{outline:none}
.a11y-close{width:44px;height:44px;flex:none;border-radius:50%;border:1px solid rgba(212,175,55,.5);background:rgba(255,255,255,.06);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.a11y-close:hover{background:rgba(212,175,55,.25)}
.a11y-close svg{width:22px;height:22px}
.a11y-body{overflow-y:auto;overscroll-behavior:contain;padding:6px 16px 16px}
.a11y-group{margin:16px 0 0;padding:0;border:0}
.a11y-group-title{margin:0 0 8px;font-size:13px;font-weight:700;letter-spacing:.04em;color:#d4af37}
.a11y-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.a11y-opt{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:4px;min-height:44px;padding:10px;text-align:right;font:inherit;color:#f5f3ef;background:#1d1f28;border:1.5px solid rgba(212,175,55,.28);border-radius:14px;cursor:pointer;transition:background .15s,border-color .15s}
.a11y-opt:hover{background:#262935;border-color:rgba(212,175,55,.7)}
.a11y-opt-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.a11y-ico{width:34px;height:34px;border-radius:10px;background:rgba(212,175,55,.16);color:#d4af37;display:flex;align-items:center;justify-content:center;flex:none}
.a11y-ico svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.a11y-badge{direction:ltr;font-size:11px;font-weight:700;letter-spacing:.05em;padding:2px 8px;border-radius:999px;color:#fcebc7;background:rgba(255,255,255,.08);border:1px solid rgba(212,175,55,.35)}
.a11y-opt-title{font-size:15px;font-weight:700;color:#fff;line-height:1.3}
.a11y-opt-desc{font-size:12.5px;color:#c7c4be;line-height:1.4}
.a11y-opt-status{margin-top:2px;font-size:12.5px;font-weight:700;color:#c7c4be;display:flex;align-items:center;gap:6px}
.a11y-opt-status::before{content:"";width:9px;height:9px;border-radius:50%;border:2px solid #8a7a58;flex:none}
.a11y-opt.is-on{background:#d4af37;border-color:#fcebc7}
.a11y-opt.is-on .a11y-opt-title,.a11y-opt.is-on .a11y-opt-desc,.a11y-opt.is-on .a11y-opt-status{color:#14151b}
.a11y-opt.is-on .a11y-ico{background:rgba(20,21,27,.15);color:#14151b}
.a11y-opt.is-on .a11y-badge{color:#14151b;background:rgba(20,21,27,.12);border-color:rgba(20,21,27,.5)}
.a11y-opt.is-on .a11y-opt-status::before{background:#14151b;border-color:#14151b}
.a11y-opt[aria-disabled="true"]{opacity:.62;cursor:not-allowed}
.a11y-wide{grid-column:1/-1}
.a11y-mini{margin-top:8px;width:100%;min-height:44px;padding:8px 12px;font:600 14px/1.3 inherit;font-family:inherit;color:#fcebc7;background:transparent;border:1.5px dashed rgba(212,175,55,.55);border-radius:12px;cursor:pointer}
.a11y-mini:hover{background:rgba(212,175,55,.14)}
.a11y-mini[aria-disabled="true"]{opacity:.55;cursor:not-allowed}
.a11y-reset{width:100%}
.a11y-reset .a11y-ico{background:rgba(255,255,255,.1)}
.a11y-note{margin:14px 0 0;font-size:12.5px;line-height:1.5;color:#c7c4be}
.a11y-note.warn{color:#ffd9a0;font-weight:600}
.a11y-kbhint{position:fixed;left:86px;right:16px;bottom:calc(20px + env(safe-area-inset-bottom,0px));z-index:99999;padding:10px 14px;border-radius:14px;background:#000;color:#fff;border:2px solid #ffe14d;font:500 14px/1.5 Rubik,Arial,sans-serif;direction:rtl;box-shadow:0 10px 30px rgba(0,0,0,.6)}
.a11y-kbhint kbd{font:700 13px/1 monospace;padding:2px 6px;border-radius:6px;background:#ffe14d;color:#000;margin-inline:2px}
.a11y-kbhint .a11y-kbcur{display:block;margin-top:4px;color:#ffe14d;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.a11y-kb .a11y-panel{bottom:calc(132px + env(safe-area-inset-bottom,0px));max-height:calc(100vh - 148px - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 148px - env(safe-area-inset-bottom,0px))}
@media (max-width:480px){
  html.a11y-kb .a11y-panel{bottom:calc(176px + env(safe-area-inset-bottom,0px));max-height:calc(100vh - 192px - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 192px - env(safe-area-inset-bottom,0px))}
  .a11y-fab{width:54px;height:54px;left:12px}
  .a11y-panel{left:8px;width:calc(100vw - 16px);bottom:calc(84px + env(safe-area-inset-bottom,0px));border-radius:18px}
  .a11y-kbhint{left:76px;right:8px}
}

/* ===== Site adjustments ===== */
/* 1) Text size (rem based sizes scale with html; the two px-based utilities are scaled explicitly) */
html.a11y-fs{font-size:calc(100% * var(--a11y-fs,1))}
html.a11y-fs .text-\[11px\]{font-size:calc(11px * var(--a11y-fs,1))!important}
@media (min-width:1024px){html.a11y-fs .lg\:text-\[54px\]{font-size:calc(54px * var(--a11y-fs,1))!important}}
html.a11y-fs .a11y-hdr header{height:auto!important;min-height:5rem;flex-wrap:wrap;row-gap:.5rem;padding-top:.75rem;padding-bottom:.75rem;border-radius:2.5rem}
html.a11y-fs-lg .a11y-hdr{position:relative!important;top:auto!important;margin-top:1rem}
html.a11y-fs-lg main.a11y-scope{padding-top:1rem!important}
html.a11y-fs-lg{scroll-padding-top:1rem}
html.a11y-fs .a11y-scope :is(input,button){max-width:100%}

/* 2) Line spacing & letter spacing (icons excluded because they are font ligatures) */
html.a11y-lh-1 .a11y-scope :where(p,h1,h2,h3,h4,h5,h6,li,blockquote,label,a,button,input,span,div,small):not(.material-symbols-outlined){line-height:1.7!important}
html.a11y-lh-2 .a11y-scope :where(p,h1,h2,h3,h4,h5,h6,li,blockquote,label,a,button,input,span,div,small):not(.material-symbols-outlined){line-height:1.95!important}
html.a11y-lh-3 .a11y-scope :where(p,h1,h2,h3,h4,h5,h6,li,blockquote,label,a,button,input,span,div,small):not(.material-symbols-outlined){line-height:2.2!important}
html.a11y-ls-1 .a11y-scope :where(p,h1,h2,h3,h4,h5,h6,li,blockquote,label,a,button,input,span,div,small):not(.material-symbols-outlined){letter-spacing:.05em!important}
html.a11y-ls-2 .a11y-scope :where(p,h1,h2,h3,h4,h5,h6,li,blockquote,label,a,button,input,span,div,small):not(.material-symbols-outlined){letter-spacing:.1em!important}
html.a11y-ls-3 .a11y-scope :where(p,h1,h2,h3,h4,h5,h6,li,blockquote,label,a,button,input,span,div,small):not(.material-symbols-outlined){letter-spacing:.16em!important}

/* icon ligatures inherit spacing from their parent: neutralise it so icons never break */
html[class*="a11y-ls-"] .a11y-scope .material-symbols-outlined{letter-spacing:normal!important}
html[class*="a11y-lh-"] .a11y-scope .material-symbols-outlined{line-height:1!important}

/* 3) Readable font */
html.a11y-rf body *:not(.material-symbols-outlined){font-family:Arial,"Helvetica Neue",Helvetica,"Segoe UI",sans-serif!important}

/* 4) Grayscale (filter on the root element does not break fixed positioning) */
html.a11y-gray{filter:grayscale(1)}

/* 5) High contrast */
html.a11y-hc body{background:#000!important;color:#fff!important}
html.a11y-hc .a11y-scope *{color:#fff!important;-webkit-text-fill-color:#fff!important;background-color:transparent!important;background-image:none!important;border-color:#fff!important;box-shadow:none!important;text-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important}
html.a11y-hc .a11y-scope .glass-panel,html.a11y-hc .a11y-scope .glass-gold-subtle{border:2px solid #fff!important}
html.a11y-hc .a11y-scope a,html.a11y-hc .a11y-scope a *{color:#ffe14d!important;-webkit-text-fill-color:#ffe14d!important}
html.a11y-hc .a11y-scope a{text-decoration:underline!important;text-underline-offset:.2em}
html.a11y-hc .a11y-scope :is(a[class*="bg-gradient"],a[class*="bg-[#d4af37]"],button[type="submit"]){background-color:#ffe14d!important;border:2px solid #fff!important;text-decoration:none!important}
html.a11y-hc .a11y-scope :is(a[class*="bg-gradient"],a[class*="bg-[#d4af37]"],button[type="submit"]),html.a11y-hc .a11y-scope :is(a[class*="bg-gradient"],a[class*="bg-[#d4af37]"],button[type="submit"]) *{color:#000!important;-webkit-text-fill-color:#000!important}
html.a11y-hc .a11y-scope :is(input,textarea,select){background-color:#000!important;border:2px solid #fff!important}
html.a11y-hc .a11y-scope ::placeholder{color:#e6e6e6!important;-webkit-text-fill-color:#e6e6e6!important;opacity:1}
html.a11y-hc .a11y-scope .absolute.bottom-6{background-color:#000!important;padding:.5rem .75rem;border-radius:.5rem}
html.a11y-hc .a11y-scope .absolute.inset-0{display:none!important}
html.a11y-hc .a11y-scope img{border:1px solid #fff}
html.a11y-hc .a11y-panel{background:#000;border-color:#fff}
html.a11y-hc .a11y-head{background:#000;border-color:#fff}
html.a11y-hc .a11y-opt{background:#000;border-color:#fff}
html.a11y-hc .a11y-opt.is-on{background:#ffe14d;border-color:#fff}
html.a11y-hc .a11y-opt-desc,html.a11y-hc .a11y-opt-status,html.a11y-hc .a11y-note,html.a11y-hc .a11y-group-title{color:#fff}
html.a11y-hc .a11y-opt.is-on .a11y-opt-title,html.a11y-hc .a11y-opt.is-on .a11y-opt-desc,html.a11y-hc .a11y-opt.is-on .a11y-opt-status{color:#000}

/* 6) Highlight headings / links / buttons (declared after high contrast so they win in combination) */
html.a11y-hh .a11y-scope :is(h1,h2,h3,h4,h5,h6){background:#ffe14d!important;background-color:#ffe14d!important;color:#111!important;-webkit-text-fill-color:#111!important;font-weight:800!important;padding:.1em .45em;border-radius:.4rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}
html.a11y-hh .a11y-scope :is(h1,h2,h3,h4,h5,h6) *{color:#111!important;-webkit-text-fill-color:#111!important;background:none!important;background-color:transparent!important}
html.a11y-hl .a11y-scope a{text-decoration:underline!important;text-decoration-thickness:2px!important;text-underline-offset:.25em!important}
html.a11y-hb .a11y-scope :is(button,[role="button"],input,textarea,select,a[class*="rounded-full"]):not(:disabled):not([aria-disabled="true"]){box-shadow:0 0 0 2px #0e0f14,0 0 0 5px #ffe14d!important}

/* 7) Focus highlight and keyboard assist (stronger focus ring) */
html.a11y-focus body :focus-visible,html.a11y-kb body :focus-visible{outline:5px solid #ffe14d!important;outline-offset:4px!important;box-shadow:0 0 0 4px #000!important}
html.a11y-kb{scroll-padding-bottom:7rem}

/* 8) Reduced motion (class driven so the user can override the OS preference in both directions) */
html.a11y-rm *,html.a11y-rm *::before,html.a11y-rm *::after{animation:none!important;animation-duration:0s!important;transition:none!important;scroll-behavior:auto!important}
html.a11y-rm .a11y-scope :is(*:hover,*:active){transform:none!important}
html.a11y-rm .a11y-scope .group:hover :is(img){transform:none!important}
@media (prefers-reduced-motion:reduce){
  html:not(.a11y-motion-ok) *,html:not(.a11y-motion-ok) *::before,html:not(.a11y-motion-ok) *::after{animation:none!important;animation-duration:0s!important;transition:none!important;scroll-behavior:auto!important}
  html:not(.a11y-motion-ok) .a11y-scope :is(*:hover,*:active){transform:none!important}
  html:not(.a11y-motion-ok) .a11y-scope .group:hover img{transform:none!important}
}

/* side position (desktop) */
@media (min-width:481px){
  .a11y-fab{bottom:auto;top:50%;transform:translateY(-50%)}
  .a11y-fab:hover{transform:translateY(-50%) scale(1.07)}
  .a11y-fab:active{transform:translateY(-50%) scale(.96)}
  .a11y-panel{left:90px;top:auto;bottom:16px;width:min(400px,calc(100vw - 106px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px)}
  html.a11y-kb .a11y-panel{bottom:140px;max-height:calc(100vh - 156px);max-height:calc(100dvh - 156px)}
}
