/* ==========================================================================
   Accessibility menu (every page)

   The panel itself (.a11y-*), then what each setting does to the page. A
   setting that is on is an attribute on <html>, data-a11y-<feature>="<level>",
   set before first paint by the inline script in inc/_head.blade.php and
   switched by public/site/js/a11y.js. Settings that need measuring (bigger
   text, smart contrast, read aloud, tooltips, the reading guide and mask)
   are done in a11y.js.

   Everything under .a11y-ui (the button, the panel, the page-structure
   dialog, the tooltip, the reading guide) is left out of the page settings,
   so the menu stays usable whatever is switched on.
   ========================================================================== */

@font-face {
  font-family: 'OpenDyslexic';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/OpenDyslexic/opendyslexic-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'OpenDyslexic';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/OpenDyslexic/opendyslexic-latin-700-normal.woff2') format('woff2');
}

/* Omran's colours, darkened where text sits on them so it passes WCAG AA. */
.a11y, .a11y-ui {
  --a11y-accent: #00736f;
  --a11y-head: #003d3b;
  --a11y-surface: #f5f8f8;
  --a11y-card: #ffffff;
  --a11y-ink: #1f2626;
  --a11y-text: #5f6b6b;
  --a11y-muted: #5f6b6b;
  --a11y-line: #dde6e6;
  --a11y-tint: #e6f4f3;
  --a11y-focus: 0 0 0 3px rgba(0, 173, 169, .6);
  --a11y-shadow: 0 14px 34px -20px rgba(0, 61, 59, .35);
  --a11y-font: 'Fedra', 'Helvetica Neue', Arial, sans-serif;
}

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

/* --- The floating button -------------------------------------------------- */

.a11y[hidden] { display: none; }
.a11y-button { padding: 0; border: 0; cursor: pointer; }
.a11y-button:focus-visible { outline: 3px solid #00ada9; outline-offset: 3px; }
.a11y-applied {
  position: absolute; top: 0; right: 0; display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: #14b8a6; color: #fff; font-size: 11px; line-height: 1;
}
.a11y-applied[hidden] { display: none; }

/* --- The panel ------------------------------------------------------------ */

.a11y-ui, .a11y-ui *, .a11y-ui *::before, .a11y-ui *::after { box-sizing: border-box; }

.a11y-panel {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 100001;
  display: flex; flex-direction: column; width: 440px; max-width: 100vw;
  background: var(--a11y-surface); color: var(--a11y-ink);
  font: 400 14px/1.4 var(--a11y-font); letter-spacing: normal; text-align: start;
  box-shadow: 0 0 60px -10px rgba(0, 61, 59, .45);
}
.a11y-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .a11y-panel:not([hidden]) { animation: a11y-in .22s ease-out; }
  @keyframes a11y-in { from { transform: translateX(var(--a11y-from, 40px)); opacity: 0; } }
  [dir="rtl"] .a11y-panel { --a11y-from: -40px; }
}

.a11y-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 16px 22px; background: var(--a11y-head); color: #fff;
}
[dir="rtl"] .a11y-head { padding: 16px 22px 16px 16px; }
.a11y-ui .a11y-title { margin: 0; padding: 0; font: 500 17px/1.3 var(--a11y-font); letter-spacing: 0; text-transform: none; color: #fff; }
.a11y-title span { font-size: .75em; font-weight: 400; opacity: .8; }
.a11y-close {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
}
/* A bare cross, like the newsletter popup's close. */
.a11y-close-icon { width: 24px; height: 24px; }
.a11y-close:hover { background: rgba(255, 255, 255, .15); }
.a11y-close:focus-visible { outline: none; box-shadow: var(--a11y-focus); }

.a11y-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 18px 18px; }

.a11y-row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--a11y-line); }
.a11y-row-label { flex: 1; font-weight: 500; }
.a11y-lang-badge {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--a11y-accent); color: #fff; font: 500 12px/1 var(--a11y-font);
}
.a11y-row:nth-child(2) .a11y-lang-badge { background: none; color: var(--a11y-ink); font-size: 15px; }
.a11y-ui .a11y-lang-link { padding: 6px 12px; border: 1px solid var(--a11y-line); border-radius: 999px; color: var(--a11y-accent); font-weight: 500; text-decoration: none; }
.a11y-ui .a11y-lang-link:hover { background: var(--a11y-tint); }
.a11y-lang-link:focus-visible { outline: none; box-shadow: var(--a11y-focus); }

.a11y-switch {
  position: relative; flex: none; width: 46px; height: 26px; padding: 0; border: 0; border-radius: 999px;
  background: var(--a11y-muted); cursor: pointer; transition: background-color .2s;
}
.a11y-switch::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .2s;
}
.a11y-switch[aria-checked="true"] { background: var(--a11y-accent); }
.a11y-switch[aria-checked="true"]::after { transform: translateX(20px); }
[dir="rtl"] .a11y-switch[aria-checked="true"]::after { transform: translateX(-20px); }
.a11y-switch:focus-visible { outline: none; box-shadow: var(--a11y-focus); }

.a11y-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }

.a11y-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 116px; padding: 16px 8px 14px; border: 2px solid transparent; border-radius: 12px;
  background: var(--a11y-card); color: var(--a11y-ink); box-shadow: 0 1px 2px rgba(0, 61, 59, .06);
  font: 500 13px/1.25 var(--a11y-font); letter-spacing: 0; text-align: center; text-transform: none; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.a11y-tile:hover { border-color: var(--a11y-line); }
.a11y-tile:focus-visible { outline: none; box-shadow: var(--a11y-focus); }
.a11y-tile-icon { width: 22px; height: 22px; color: var(--a11y-accent); }
.a11y-tile[aria-pressed="true"] { border-color: var(--a11y-accent); background: var(--a11y-tint); }
.a11y-tick { position: absolute; top: 8px; inset-inline-end: 8px; width: 16px; height: 16px; color: var(--a11y-accent); visibility: hidden; }
.a11y-tile[aria-pressed="true"] .a11y-tick { visibility: visible; }
.a11y-tile[data-unavailable], .a11y-cell:has(> .a11y-tile[data-unavailable]) { display: none; }

/* Clear: turns one setting off. A small badge on the tile's top corner (the
   tick moves to the other corner); ::before widens what can be pressed. */
.a11y-cell { position: relative; display: flex; }
.a11y-cell > .a11y-tile { flex: 1; min-width: 0; }
.a11y-cell .a11y-tick { inset-inline-end: auto; inset-inline-start: 8px; }
.a11y-clear {
  position: absolute; top: -7px; inset-inline-end: -7px; z-index: 1; display: grid; place-items: center;
  width: 18px; height: 18px; padding: 0; border: 2px solid var(--a11y-surface); border-radius: 50%;
  background: #ce368c; color: #fff; font-size: 9px; line-height: 1; cursor: pointer;
}
.a11y-clear-icon { width: 9px; height: 9px; }
.a11y-clear::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; }
.a11y-clear[hidden] { display: none; }
.a11y-clear:hover { background: #a82a72; }
.a11y-clear:focus-visible { outline: none; box-shadow: var(--a11y-focus); }

.a11y-dots { display: flex; gap: 4px; }
.a11y-dots i { width: 16px; height: 4px; border-radius: 2px; background: var(--a11y-line); }
.a11y-dots i.is-on { background: var(--a11y-accent); }

.a11y-foot { padding: 14px 18px; border-top: 1px solid var(--a11y-line); background: var(--a11y-surface); }
.a11y-reset {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px;
  border: 2px solid var(--a11y-accent); border-radius: 999px; background: none; color: var(--a11y-accent);
  font: 500 14px/1.2 var(--a11y-font); letter-spacing: 0; text-transform: none; cursor: pointer;
}
.a11y-reset-icon { width: 16px; height: 16px; }
.a11y-reset:hover { background: var(--a11y-accent); color: #fff; }
.a11y-reset:focus-visible { outline: none; box-shadow: var(--a11y-focus); }

/* Larger menu */
.a11y-panel.is-xl { width: 560px; font-size: 17px; }
.a11y-panel.is-xl .a11y-title { font-size: 21px; }
.a11y-panel.is-xl .a11y-tile { min-height: 148px; font-size: 16px; }
.a11y-panel.is-xl .a11y-tile-icon { width: 28px; height: 28px; }
.a11y-panel.is-xl .a11y-clear { width: 22px; height: 22px; }
.a11y-panel.is-xl .a11y-clear-icon { width: 11px; height: 11px; }
.a11y-panel.is-xl .a11y-reset { font-size: 17px; padding: 15px; }

@media (max-width: 480px) {
  .a11y-panel, .a11y-panel.is-xl { width: 100vw; }
  .a11y-body { padding: 4px 14px 14px; }
  .a11y-grid { gap: 8px; }
  .a11y-tile { min-height: 104px; font-size: 12px; }
  .a11y-panel.is-xl .a11y-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Page structure dialog ----------------------------------------------- */

.a11y-structure {
  position: fixed; inset: 0; z-index: 100003; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 20, 20, .55); font: 400 15px/1.4 var(--a11y-font); letter-spacing: normal; text-align: start;
}
.a11y-structure[hidden] { display: none; }
.a11y-structure-box {
  display: flex; flex-direction: column; width: 640px; max-width: 100%; max-height: min(80vh, 720px);
  overflow: hidden; border-radius: 12px; background: var(--a11y-card); color: var(--a11y-ink); box-shadow: var(--a11y-shadow);
}
.a11y-tabs { display: flex; border-bottom: 1px solid var(--a11y-line); }
.a11y-tab {
  flex: 1; padding: 13px 10px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--a11y-text);
  font: 500 14px/1.2 var(--a11y-font); letter-spacing: 0; text-transform: none; cursor: pointer;
}
.a11y-tab[aria-selected="true"] { border-bottom-color: var(--a11y-accent); color: var(--a11y-ink); }
.a11y-tab:focus-visible { outline: none; box-shadow: inset var(--a11y-focus); }
.a11y-tabpanel { overflow-y: auto; padding: 8px; }
.a11y-tabpanel:focus-visible { outline: none; box-shadow: inset var(--a11y-focus); }
.a11y-ui .a11y-list { margin: 0; padding: 0; list-style: none; }
.a11y-ui .a11y-list li { margin: 0; padding: 0; }
.a11y-item {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--a11y-ink); font: 400 14.5px/1.35 var(--a11y-font); letter-spacing: 0; text-align: start; text-transform: none; cursor: pointer;
}
.a11y-item:hover, .a11y-item:focus { background: var(--a11y-tint); outline: none; }
.a11y-item:focus-visible { box-shadow: var(--a11y-focus); }
.a11y-item b {
  flex: none; min-width: 30px; padding: 2px 6px; border-radius: 4px; background: var(--a11y-accent); color: #fff;
  font: 500 11px/1.4 var(--a11y-font); text-align: center;
}
.a11y-item small { color: var(--a11y-muted); }
.a11y-nothing { margin: 0; padding: 18px 10px; color: var(--a11y-muted); }

/* --- Pieces a11y.js places on the page ------------------------------------ */

.a11y-tip {
  position: fixed; z-index: 100002; max-width: 320px; padding: 8px 12px; border-radius: 6px;
  background: var(--a11y-head); color: #fff; font: 500 14px/1.4 var(--a11y-font); letter-spacing: normal;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); pointer-events: none;
}
.a11y-tip[hidden] { display: none; }

.a11y-guide {
  position: fixed; top: 0; left: 0; z-index: 100000; width: min(640px, 90vw); height: 12px;
  border: 3px solid #f1c42b; border-radius: 6px; background: #003d3b; pointer-events: none;
}
.a11y-mask { position: fixed; left: 0; right: 0; z-index: 100000; background: rgba(0, 0, 0, .6); pointer-events: none; }
.a11y-mask--top { top: 0; }
.a11y-mask--bottom { bottom: 0; }
.a11y-guide[hidden], .a11y-mask[hidden] { display: none; }

.a11y-reading { outline: 3px solid #f1c42b !important; outline-offset: 3px; background-color: rgba(241, 196, 43, .2) !important; }

/* ==========================================================================
   What the settings do to the page
   ========================================================================== */

/* --- Contrast +: invert, and Saturation ---------------------------------- */
/* Both are filters on the page; images, video and the menu are turned back. */
html[data-a11y-contrast="1"], html[data-a11y-saturation] { filter: var(--a11y-invert, invert(0)) var(--a11y-saturate, saturate(1)); }
html[data-a11y-contrast="1"] { --a11y-invert: invert(1) hue-rotate(180deg); }
html[data-a11y-saturation="1"] { --a11y-saturate: saturate(.5); }
html[data-a11y-saturation="2"] { --a11y-saturate: saturate(2); }
html[data-a11y-saturation="3"] { --a11y-saturate: grayscale(1); }
html[data-a11y-contrast="1"] :is(img:not([data-logo-light], [src*=".svg"]), video, iframe, canvas, .a11y-reinvert, .a11y-ui) { filter: invert(1) hue-rotate(180deg) !important; }
html[data-a11y-contrast="1"] .a11y-reinvert :is(img, video, iframe, canvas) { filter: none !important; }

/* --- Contrast +: dark and light ------------------------------------------ */
html[data-a11y-contrast="2"], html[data-a11y-contrast="2"] body,
html[data-a11y-contrast="2"] body *:not(.a11y-ui, .a11y-ui *, .a11y-reading) {
  background-color: #000 !important; color: #fff !important; border-color: #fff !important;
  text-shadow: none !important; box-shadow: none !important;
}
html[data-a11y-contrast="2"] body a:not(.a11y-ui *),
html[data-a11y-contrast="2"] body a:not(.a11y-ui *) * { color: #ffe14d !important; }

html[data-a11y-contrast="3"], html[data-a11y-contrast="3"] body,
html[data-a11y-contrast="3"] body *:not(.a11y-ui, .a11y-ui *, .a11y-reading) {
  background-color: #fff !important; color: #000 !important; border-color: #000 !important;
  text-shadow: none !important; box-shadow: none !important;
}
html[data-a11y-contrast="3"] body a:not(.a11y-ui *),
html[data-a11y-contrast="3"] body a:not(.a11y-ui *) * { color: #00427a !important; }

/* --- Highlight links ------------------------------------------------------ */
html[data-a11y-links] body a:not(.a11y-ui *) {
  outline: 2px solid #f1c42b !important; outline-offset: 2px;
  text-decoration: underline !important; text-underline-offset: 3px;
}
html[data-a11y-links] body a:not(.a11y-ui *):hover,
html[data-a11y-links] body a:not(.a11y-ui *):focus { outline-width: 4px !important; }

/* --- Text spacing (Arabic letters stay joined: word spacing only) --------- */
html[data-a11y-spacing="1"] body *:not(.a11y-ui, .a11y-ui *) { word-spacing: .12em !important; }
html[data-a11y-spacing="2"] body *:not(.a11y-ui, .a11y-ui *) { word-spacing: .24em !important; }
html[data-a11y-spacing="3"] body *:not(.a11y-ui, .a11y-ui *) { word-spacing: .4em !important; }
html[data-a11y-spacing="1"]:not([dir="rtl"]) body *:not(.a11y-ui, .a11y-ui *) { letter-spacing: .05em !important; }
html[data-a11y-spacing="2"]:not([dir="rtl"]) body *:not(.a11y-ui, .a11y-ui *) { letter-spacing: .1em !important; }
html[data-a11y-spacing="3"]:not([dir="rtl"]) body *:not(.a11y-ui, .a11y-ui *) { letter-spacing: .15em !important; }

/* --- Line height ---------------------------------------------------------- */
html[data-a11y-lineheight="1"] body *:not(.a11y-ui, .a11y-ui *, i, svg, svg *) { line-height: 1.5 !important; }
html[data-a11y-lineheight="2"] body *:not(.a11y-ui, .a11y-ui *, i, svg, svg *) { line-height: 1.75 !important; }
html[data-a11y-lineheight="3"] body *:not(.a11y-ui, .a11y-ui *, i, svg, svg *) { line-height: 2 !important; }

/* --- Text align ----------------------------------------------------------- */
html[data-a11y-align="1"] body *:not(.a11y-ui, .a11y-ui *) { text-align: left !important; }
html[data-a11y-align="2"] body *:not(.a11y-ui, .a11y-ui *) { text-align: right !important; }
html[data-a11y-align="3"] body *:not(.a11y-ui, .a11y-ui *) { text-align: center !important; }

/* --- Dyslexia friendly (Arabic text falls back to the site's own face) ---- */
html[data-a11y-dyslexia] body *:not(.a11y-ui, .a11y-ui *, i, [class*="fa-"], svg, svg *) {
  font-family: 'OpenDyslexic', 'Fedra', sans-serif !important;
}
/* Its tall letters overlap at the theme's tight headline leading. */
html[data-a11y-dyslexia]:not([data-a11y-lineheight]) body *:not(.a11y-ui, .a11y-ui *, i, svg, svg *) { line-height: 1.5 !important; }

/* --- Hide images (the logo stays; a section that had a photo behind white
       text gets a deep-teal ground instead, marked by a11y.js) ------------ */
html[data-a11y-images] body :is(img, picture, video, svg image, iframe):not(.a11y-ui *, [data-logo-light]) { opacity: 0 !important; }
html[data-a11y-images] body *:not(.a11y-ui, .a11y-ui *),
html[data-a11y-images] body *:not(.a11y-ui, .a11y-ui *)::before,
html[data-a11y-images] body *:not(.a11y-ui, .a11y-ui *)::after { background-image: none !important; }
html[data-a11y-images] body .a11y-had-bg { background-color: #003d3b !important; }

/* --- Pause animations: everything jumps to its end state ------------------ */
html[data-a11y-pause] *, html[data-a11y-pause] *::before, html[data-a11y-pause] *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}

/* --- Cursor: big ---------------------------------------------------------- */
html[data-a11y-cursor="1"], html[data-a11y-cursor="1"] * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11.5-6.6.9 3.9 7.6-2.7 1.4-3.9-7.7L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, auto !important;
}
html[data-a11y-cursor="1"] :is(a, button, [role="button"], label, select, summary),
html[data-a11y-cursor="1"] :is(a, button, [role="button"], label, select, summary) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11.5-6.6.9 3.9 7.6-2.7 1.4-3.9-7.7L4 20z' fill='%2300736f' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, pointer !important;
}
html[data-a11y-cursor="1"] :is(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"]), textarea) { cursor: text !important; }
