/* ==================================================================
   assets/a11y.css — «إعدادات العرض» accessibility panel (v77, P11.1).
   Loaded only while the panel is switched on in Settings.

   The visitor's choices live on <html> (set by a tiny inline script in
   the <head> before the page paints, so nothing jumps):
     data-a11y-fs   sm | lg | xl          text size (none = normal)
     data-a11y-lh   m | l                 line spacing (none = normal)
     .a11y-contrast                       high contrast (fixed colours)
     .a11y-links                          underline + outline every link
     .a11y-still                          no animation / transitions
   ================================================================== */

/* ---------- text size: the site is sized in rem, so the root scales it ---------- */
html[data-a11y-fs="sm"] { font-size: 90%; }
html[data-a11y-fs="lg"] { font-size: 112.5%; }
html[data-a11y-fs="xl"] { font-size: 125%; }

/* ---------- line spacing: running text only (not icons or buttons) ---------- */
html[data-a11y-lh="m"] body :where(p, li, dd, dt, td, th, blockquote, figcaption, .evt-intro, .evt-sec-desc, .faq-a-inner, .article-body, .about-body) { line-height: 2 !important; }
html[data-a11y-lh="l"] body :where(p, li, dd, dt, td, th, blockquote, figcaption, .evt-intro, .evt-sec-desc, .faq-a-inner, .article-body, .about-body) { line-height: 2.4 !important; }
html[data-a11y-lh="m"] body :where(p, li) { margin-bottom: .5em; }
html[data-a11y-lh="l"] body :where(p, li) { margin-bottom: .8em; }

/* ---------- high contrast: fixed accessible colours, not the brand's ----------
   Black text on white, dark-blue actions with white text, solid black for
   dark bands (hero, footer) with white text. Every theme token the site
   reads is overridden, so components follow without per-component rules. */
html.a11y-contrast {
  --ink:#000; --muted:#1a1a1a; --line:#000; --bg:#fff; --surface:#fff; --surface-2:#fff;
  --primary:#0a3a8c; --primary-hover:#062a66; --primary-active:#041d47; --primary-soft:#dfe8f8; --primary-tint:#eef3fb;
  --primary-overlay:rgba(0,0,0,.7);
  --brand-primary:#0a3a8c; --brand-secondary:#000; --brand-accent:#0a3a8c; --secondary:#000; --accent:#0a3a8c; --accent-soft:#fff;
  --on-primary:#fff; --on-secondary:#fff; --on-accent:#fff;
  --grad-dark:#000; --grad-hero:#000; --grad-card:#fff; --grad-accent:#0a3a8c;
  --header-bg:#fff; --header-fg:#000; --header-fg-border:#000;
  --footer-bg:#000; --footer-fg:#fff; --footer-muted:#fff; --footer-line:#fff; --footer-chip:#222;
  --cta-primary-bg:#0a3a8c; --cta-primary-fg:#fff; --cta-gold-bg:#0a3a8c; --cta-gold-fg:#fff;
  --nav-register-bg:#0a3a8c; --nav-register-fg:#fff; --hero-register-bg:#fff; --hero-register-fg:#000;
  --hero-title:#fff; --hero-text:#fff; --hero-accent:#fff; --hero-pill-bg:#000; --hero-pill-fg:#fff;
  --hero-scrim:rgba(0,0,0,.82); --hero-card-bg:#000; --hero-card-border:#fff;
  --promo-bg:#000; --promo-fg:#fff;
}
html.a11y-contrast body { background:#fff; color:#000; }
html.a11y-contrast .site-banner { background:#000 !important; color:#fff !important; }
html.a11y-contrast .page-hero { background:#000 !important; color:#fff !important; }
html.a11y-contrast .page-hero p, html.a11y-contrast .page-hero .breadcrumb, html.a11y-contrast .page-hero .breadcrumb a { color:#fff !important; opacity:1 !important; }
html.a11y-contrast .hero-bg img { opacity:.25 !important; }
html.a11y-contrast :where(.evt-sec-desc, .evt-intro, .muted) { color:#1a1a1a !important; }
html.a11y-contrast :where(button, .btn):not(.a11y-panel *) { border-width:2px; }
html.a11y-contrast .btn-ghost { border-color:currentColor !important; }
html.a11y-contrast .cookie-bar { background:#000 !important; color:#fff !important; border-top:2px solid #fff; }
html.a11y-contrast .cookie-bar .btn-ghost { color:#fff !important; border-color:#fff !important; }
html.a11y-contrast :focus-visible { outline:3px solid #ffbf00 !important; outline-offset:2px !important; }

/* ---------- highlight links ---------- */
html.a11y-links a:not(.a11y-panel *) { text-decoration:underline !important; text-decoration-thickness:2px !important; text-underline-offset:3px !important;
  outline:2px dashed currentColor; outline-offset:2px; }
html.a11y-links a:not(.a11y-panel *):focus-visible { outline:3px solid #ffbf00; }

/* ---------- reduce motion: same as the browser's own setting ---------- */
html.a11y-still { scroll-behavior:auto !important; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after {
  animation-duration:0s !important; animation-iteration-count:1 !important; animation-delay:0s !important;
  transition-duration:0s !important; transition-delay:0s !important;
}
html.a11y-still .reveal { opacity:1 !important; transform:none !important; }
html.a11y-still .hero-video-bg { display:none !important; }
html.a11y-still .sponsor-row.is-marquee { flex-wrap:wrap; justify-content:center; overflow:visible; -webkit-mask-image:none; mask-image:none; gap:20px 32px; }
html.a11y-still .sponsor-row.is-marquee .sponsor-track { animation:none !important; transform:none !important; flex-wrap:wrap; justify-content:center; gap:20px 32px; }
html.a11y-still .sponsor-row.is-marquee .sponsor-logo { padding-inline:0; }

/* ==================================================================
   The button and the panel. Pinned to the reading-END edge at mid
   height: the sponsor/booth buttons use the reading-start edge, and the
   cookie bar and phone buttons use the bottom, so nothing overlaps.
   The panel keeps fixed, readable colours whatever the theme.
   ================================================================== */
.a11y-btn {
  position:fixed; top:50%; inset-inline-end:0; z-index:960; transform:translateY(-50%);
  width:46px; height:46px; display:grid; place-items:center; cursor:pointer;
  background:#0a3a8c; color:#fff; border:2px solid #fff; border-inline-end:0;
  border-start-start-radius:12px; border-end-start-radius:12px;
  box-shadow:0 4px 16px rgba(0,0,0,.25); font-size:1.25rem; padding:0;
}
.a11y-btn:hover { background:#062a66; }
.a11y-btn:focus-visible { outline:3px solid #ffbf00; outline-offset:2px; }
.a11y-btn svg { width:24px; height:24px; }

.a11y-panel {
  position:fixed; top:50%; inset-inline-end:54px; transform:translateY(-50%); z-index:1310;
  width:min(320px, calc(100vw - 70px)); max-height:calc(100vh - 32px); overflow:auto;
  background:#fff; color:#111; border:1px solid #c9d1dc; border-radius:16px;
  box-shadow:0 18px 50px rgba(0,0,0,.28); padding:16px 16px 14px; font-size:16px; line-height:1.5;
}
.a11y-panel[hidden] { display:none; }
.a11y-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.a11y-title { font-size:17px; font-weight:800; margin:0; color:#111; }
.a11y-x { width:34px; height:34px; border-radius:10px; border:1px solid #c9d1dc; background:#fff; color:#111; font-size:20px; line-height:1; cursor:pointer; }
.a11y-group { margin:0 0 12px; padding:0; border:0; }
.a11y-label { display:block; font-size:14px; font-weight:700; color:#333; margin-bottom:6px; padding:0; }
.a11y-seg { display:flex; gap:6px; }
.a11y-seg button { flex:1; min-height:38px; border:1px solid #c9d1dc; background:#f5f7fa; color:#111; border-radius:10px; font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.a11y-seg button[aria-pressed="true"] { background:#0a3a8c; border-color:#0a3a8c; color:#fff; }
.a11y-tog { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:44px; margin:0 0 6px; padding:8px 12px;
  border:1px solid #c9d1dc; background:#f5f7fa; color:#111; border-radius:10px; font:inherit; font-size:14px; font-weight:700; cursor:pointer; text-align:start; }
.a11y-tog .a11y-state { flex:0 0 auto; width:38px; height:22px; border-radius:22px; background:#9aa5b4; position:relative; }
.a11y-tog .a11y-state::after { content:""; position:absolute; top:3px; inset-inline-start:3px; width:16px; height:16px; border-radius:50%; background:#fff; }
.a11y-tog[aria-pressed="true"] { border-color:#0a3a8c; background:#eef3fb; }
.a11y-tog[aria-pressed="true"] .a11y-state { background:#0a3a8c; }
.a11y-tog[aria-pressed="true"] .a11y-state::after { inset-inline-start:19px; }
.a11y-seg button:focus-visible, .a11y-tog:focus-visible, .a11y-x:focus-visible, .a11y-reset:focus-visible { outline:3px solid #ffbf00; outline-offset:2px; }
.a11y-reset { width:100%; min-height:40px; margin-top:6px; border:0; background:none; color:#0a3a8c; font:inherit; font-size:14px; font-weight:800; text-decoration:underline; cursor:pointer; }
.a11y-note { margin:8px 0 0; font-size:12px; color:#555; text-align:center; }
/* The panel ignores the visitor's own size/spacing choices so its controls never overflow. */
html[data-a11y-lh] .a11y-panel :where(p, li) { line-height:1.5 !important; margin-bottom:0; }
@media (max-width:600px) {
  .a11y-btn { width:42px; height:42px; }
  .a11y-panel { top:auto; bottom:16px; inset-inline-end:12px; transform:none; width:calc(100vw - 24px); max-height:calc(100vh - 100px); }
}
@media print { .a11y-btn, .a11y-panel { display:none !important; } }
