/* SmartEdge accessibility toolbar.

   This file and /assets/js/accessibility.js are the whole component. Nothing
   else on the page knows it exists, there is no third-party script, and the
   pair can be lifted into another site unchanged - which is the point, because
   the new Smart site will want it when it comes off WordPress.

   Brand: navy #090446, pink #DC0E7B, Montserrat.

   Two things in here look over-careful and are not:

   - Every page-wide override excludes .se-a11y-ui, so the toolbar and the skip
     link keep their own colours and stay readable in whichever mode is on.
   - grayscale and invert are applied to <html>, never to <body>. A filter makes
     an element the containing block for anything fixed inside it, which would
     unpin the sticky header and the CookieYes button - except on the root
     element, which the spec exempts.
*/

/* ---------- skip to content ---------- */

.se-a11y-skip{
  position:absolute;left:-9999px;top:0;z-index:1000000;
  padding:12px 18px;border-radius:0 0 10px 0;
  background:#090446;color:#fff;text-decoration:none;
  font:700 14px/1.2 "Montserrat",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
}
.se-a11y-skip:focus{left:0;outline:3px solid #DC0E7B;outline-offset:-3px}

/* ---------- the toolbar ---------- */

.se-a11y{
  --se-navy:#090446;
  --se-pink:#DC0E7B;
  --se-tint:#F6F5FC;
  --se-line:#E8E5F4;
  --se-font:"Montserrat",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  position:fixed;left:0;top:50%;transform:translateY(-50%);
  z-index:9500;               /* above the page, below the CookieYes banner */
  display:flex;align-items:center;
  font-family:var(--se-font);
}

.se-a11y-tab{
  flex:0 0 auto;display:flex;align-items:center;justify-content:center;
  width:42px;height:54px;padding:0;
  /* The white edge is what makes a navy tab visible on the dark hero as well
     as on a white page. Without it the tab all but disappears on the home
     page. */
  border:2px solid #fff;border-left:0;
  border-radius:0 10px 10px 0;
  background:var(--se-navy);color:#fff;cursor:pointer;
  box-shadow:0 4px 16px rgba(9,4,70,.35);
}
.se-a11y-tab:hover{background:var(--se-pink)}
.se-a11y-tab:focus-visible{outline:3px solid #fff;outline-offset:-5px}
.se-a11y-tab svg{width:22px;height:22px;display:block}

.se-a11y-panel{
  flex:0 0 auto;width:250px;
  max-height:calc(100vh - 160px);   /* keeps the CookieYes button clear */
  overflow-y:auto;
  margin-left:-1px;padding:14px 14px 12px;
  background:#fff;border:1px solid var(--se-line);border-left:0;
  border-radius:0 12px 12px 0;
  box-shadow:0 12px 34px rgba(9,4,70,.22);
}

.se-a11y-title{
  margin:0 0 10px;padding:0 2px;
  font:700 14px/1.3 var(--se-font);color:var(--se-navy);
}

.se-a11y-list{list-style:none;margin:0;padding:0}
.se-a11y-list li{margin:0 0 2px}

.se-a11y-opt{
  display:block;width:100%;min-height:40px;
  padding:9px 12px;border:1px solid transparent;border-radius:8px;
  background:transparent;color:var(--se-navy);
  font:600 13.5px/1.3 var(--se-font);text-align:left;cursor:pointer;
}
.se-a11y-opt:hover{background:var(--se-tint)}
.se-a11y-opt:focus-visible{outline:3px solid var(--se-pink);outline-offset:1px}
.se-a11y-opt[aria-pressed="true"]{background:var(--se-pink);color:#fff}
.se-a11y-opt[aria-pressed="true"]:hover{background:#B30A63}

.se-a11y-reset{
  margin-top:8px;border-color:var(--se-line);color:var(--se-pink);
}
.se-a11y-reset:hover{background:var(--se-pink);color:#fff;border-color:var(--se-pink)}

/* Announcements for a screen reader: present, never shown. */
.se-a11y-live{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

@media (max-width:600px){
  .se-a11y-tab{width:34px;height:46px}
  .se-a11y-tab svg{width:19px;height:19px}
  .se-a11y-panel{width:min(258px,calc(100vw - 46px));padding:12px}
}

@media print{.se-a11y,.se-a11y-skip{display:none !important}}

/* ---------- the modes ---------- */

html.se-a11y-grayscale{filter:grayscale(100%)}

html.se-a11y-invert{filter:invert(100%)}
html.se-a11y-invert .se-a11y-ui{filter:invert(100%)}   /* back to itself */

html.se-a11y-contrast,
html.se-a11y-contrast body{background:#000 !important;color:#fff !important}
html.se-a11y-contrast body *:not(.se-a11y-ui):not(.se-a11y-ui *){
  background-color:transparent !important;background-image:none !important;
  color:#fff !important;border-color:#fff !important;
  box-shadow:none !important;text-shadow:none !important;
}
/* These link rules repeat BOTH :not() tests from the rule above on purpose.
   One class less and the catch-all wins on specificity, and links come out
   white instead of yellow - which is exactly how it failed first time. */
html.se-a11y-contrast body a:not(.se-a11y-ui):not(.se-a11y-ui *),
html.se-a11y-contrast body a:not(.se-a11y-ui):not(.se-a11y-ui *) *{color:#ffff00 !important}
html.se-a11y-contrast body button:not(.se-a11y-ui *),
html.se-a11y-contrast body .btn:not(.se-a11y-ui *),
html.se-a11y-contrast body input:not(.se-a11y-ui *),
html.se-a11y-contrast body select:not(.se-a11y-ui *),
html.se-a11y-contrast body textarea:not(.se-a11y-ui *){
  border:1px solid #fff !important;
}
html.se-a11y-contrast body img:not(.se-a11y-ui *){filter:grayscale(1) contrast(1.15)}
/* The tick marks in the course lists are ::before content, which a * selector
   cannot reach - left alone they stay brand pink, and pink on black is about
   2.6:1. Colour only: backgrounds are left so decorative bars survive. */
html.se-a11y-contrast body *:not(.se-a11y-ui):not(.se-a11y-ui *)::before,
html.se-a11y-contrast body *:not(.se-a11y-ui):not(.se-a11y-ui *)::after{color:#fff !important}

html.se-a11y-light,
html.se-a11y-light body{background:#fff !important;color:#000 !important}
html.se-a11y-light body *:not(.se-a11y-ui):not(.se-a11y-ui *){
  background-color:transparent !important;background-image:none !important;
  color:#000 !important;border-color:#000 !important;
  box-shadow:none !important;text-shadow:none !important;
}
html.se-a11y-light body a:not(.se-a11y-ui):not(.se-a11y-ui *),
html.se-a11y-light body a:not(.se-a11y-ui):not(.se-a11y-ui *) *{
  color:#0000cc !important;text-decoration:underline !important;
}
html.se-a11y-light body *:not(.se-a11y-ui):not(.se-a11y-ui *)::before,
html.se-a11y-light body *:not(.se-a11y-ui):not(.se-a11y-ui *)::after{color:#000 !important}

/* A bar drawn purely as a background colour - a hamburger menu's three lines, a
   rule, a progress fill - carries no text for the colour rules above to catch,
   and the catch-all strips its background, so it disappears completely. Mark any
   such element .se-a11y-bar and it is repainted in the mode's foreground colour.
   Both :not() tests are repeated on purpose: one class fewer and the catch-all
   wins on specificity and the bar stays invisible, which is exactly how the
   menu icon failed. Grayscale and negative contrast are filters, so they carry
   these elements correctly without help. */
html.se-a11y-contrast body .se-a11y-bar:not(.se-a11y-ui):not(.se-a11y-ui *){
  background:#fff !important;
}
html.se-a11y-light body .se-a11y-bar:not(.se-a11y-ui):not(.se-a11y-ui *){
  background:#000 !important;
}

html.se-a11y-underline body a:not(.se-a11y-ui *){text-decoration:underline !important}

html.se-a11y-readable body *:not(.se-a11y-ui):not(.se-a11y-ui *){
  font-family:Verdana,"DejaVu Sans","Segoe UI",Tahoma,sans-serif !important;
  letter-spacing:.012em !important;
}
