/* The accessibility menu (תפריט נגישות) of the public site, and the few rules
   every public page wants whether the menu is opened or not: a visible focus
   ring, a skip link, and respect for a reader who asked for less motion.
   Loaded by /, /accessibility/ and /terms/; the Hebrew names of the
   adjustments are the ones Israeli sites use (ת"י 5568). Prompt p279. */

/* ---- on every page, menu or no menu ------------------------------------ */

:focus-visible {
  outline: 3px solid #22d3ee;
  outline-offset: 3px;
}

.a11y-skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: #22d3ee;
  color: #06111f;
  font-weight: 700;
  text-decoration: none;
}

.a11y-skip:focus {
  top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

/* ---- the launcher and the panel --------------------------------------- */

.a11y-launch {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 900;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0b74c7;
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  padding: 0;
}

.a11y-launch svg {
  width: 1.9rem;
  height: 1.9rem;
  fill: currentColor;
}

.a11y-panel {
  position: fixed;
  left: 1rem;
  bottom: 4.6rem;
  z-index: 901;
  width: min(22rem, calc(100vw - 2rem));
  max-height: calc(100vh - 6rem);
  overflow: auto;
  background: #ffffff;
  color: #0b1a2b;
  border-radius: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font: 15px/1.4 Arial, Helvetica, sans-serif;
  direction: rtl;
  text-align: right;
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: #0b74c7;
  color: #ffffff;
  border-radius: 0.9rem 0.9rem 0 0;
}

.a11y-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.a11y-head small {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.9;
}

.a11y-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.a11y-size {
  padding: 0.6rem 1rem 0;
  font-size: 0.85rem;
  color: #3b4a5a;
}

.a11y-launch.a11y-active {
  background: #0a9a4a;
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.8rem;
}

.a11y-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3.5rem;
  padding: 0.4rem 0.4rem;
  border: 1px solid #c9d4e0;
  border-radius: 0.6rem;
  background: #f4f7fa;
  color: #0b1a2b;
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.a11y-grid button span {
  font-size: 0.78rem;
  color: #3b4a5a;
}

.a11y-grid button[aria-pressed="true"] {
  background: #0b74c7;
  border-color: #0b74c7;
  color: #ffffff;
}

.a11y-grid button[aria-pressed="true"] span {
  color: #e6f2ff;
}

.a11y-grid .a11y-wide {
  grid-column: 1 / -1;
  min-height: 2.8rem;
}

.a11y-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
  padding: 0.6rem 1rem 0.9rem;
  border-top: 1px solid #e1e8ef;
  font-size: 0.85rem;
}

.a11y-foot a {
  color: #0b5aa0;
}

/* ---- the adjustments: a class on <html> each ---------------------------- */

html.a11y-contrast,
html.a11y-contrast body {
  background: #000000 !important;
  color: #ffffff !important;
}

html.a11y-contrast *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-launch):not(.a11y-launch *):not(.logo-chip):not(.logo-chip *) {
  background-color: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* more specific than the rule above it, which it has to beat on colour */
html.a11y-contrast a:not(.a11y-panel a):not(.a11y-panel *):not(.a11y-launch):not(.a11y-launch *):not(.a11y-skip):not(.logo-chip):not(.logo-chip *),
html.a11y-contrast button:not(.a11y-panel button):not(.a11y-panel *):not(.a11y-launch):not(.a11y-launch *):not(.a11y-skip):not(.logo-chip):not(.logo-chip *) {
  color: #ffff00 !important;
  text-decoration: underline;
}

/* the white chip a client's logo sits on keeps its white, or a dark logo would vanish on the black */
html.a11y-contrast .logo-chip {
  background: #ffffff !important;
  color: #0b1a2b !important;
}

html.a11y-light {
  filter: invert(1) hue-rotate(180deg);
  background: #ffffff;
}

html.a11y-light img,
html.a11y-light video,
html.a11y-light .a11y-panel,
html.a11y-light .a11y-launch {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-grey {
  filter: grayscale(1);
}

html.a11y-light.a11y-grey {
  filter: invert(1) hue-rotate(180deg) grayscale(1);
}

html.a11y-links a:not(.a11y-panel a):not(.a11y-skip) {
  text-decoration: underline !important;
  outline: 2px solid #ffb000 !important;
  outline-offset: 2px;
  background: rgba(255, 176, 0, 0.18) !important;
}

html.a11y-headings h1,
html.a11y-headings h2,
html.a11y-headings h3,
html.a11y-headings h4 {
  text-decoration: underline;
  outline: 2px dashed #ffb000;
  outline-offset: 4px;
}

html.a11y-font,
html.a11y-font body,
html.a11y-font *:not(.a11y-panel):not(.a11y-panel *) {
  font-family: Arial, Helvetica, Verdana, sans-serif !important;
}

html.a11y-spacing *:not(.a11y-panel):not(.a11y-panel *) {
  letter-spacing: 0.08em !important;
  word-spacing: 0.16em !important;
  line-height: 1.9 !important;
}

html.a11y-cursor,
html.a11y-cursor *:not(.a11y-panel):not(.a11y-panel *) {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M8 4 L8 38 L17 29 L23 43 L29 40 L23 27 L35 27 Z' fill='%23000' stroke='%23fff' stroke-width='3'/></svg>") 8 4, auto !important;
}

html.a11y-still *,
html.a11y-still *::before,
html.a11y-still *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.a11y-guide {
  position: fixed;
  left: 0;
  right: 0;
  height: 12px;
  margin-top: -6px;
  background: rgba(255, 176, 0, 0.55);
  border-top: 2px solid #ffb000;
  border-bottom: 2px solid #ffb000;
  pointer-events: none;
  z-index: 899;
}

.a11y-guide[hidden] {
  display: none;
}
