/* =====================================================================
   Visitor accessibility options (mattjancer.com)
   Every rule below only takes effect when a visitor switches a setting on
   (a class on <html>), except the small toolbar button/panel styles.
   To remove the feature entirely: delete the two lines in each page's
   <head> that load css/a11y.css and js/a11y.js.
   ===================================================================== */

/* ---------- Toolbar button (sits in the nav bar, left of the menu button) ---------- */
.mja11y-btn {
  margin: -5px 4px -5px auto;   /* auto pushes it right; negative margins keep the nav bar height unchanged */
  padding: 12px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--cream-text, #fff);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: none;
}
.mja11y-btn svg { width: 22px; height: 22px; display: block; }
.mja11y-btn:hover svg { opacity: .8; }
.mja11y-btn:focus-visible { outline: 2px solid oklch(80% 0.12 195); outline-offset: -3px; }

/* ---------- Panel ---------- */
.mja11y-panel {
  position: fixed;
  z-index: 90;                  /* above the nav bar (20), below the menu (100) and photo/PDF viewers (200) */
  top: 80px;
  right: 16px;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 16px 18px 14px;
  background: oklch(24% 0.045 255);
  color: #fff;
  border: 1px solid oklch(72% 0.1 195 / 0.45);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  font: 400 15px/1.4 'Work Sans', system-ui, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
  text-shadow: none;
}
.mja11y-panel[hidden] { display: none; }
.mja11y-panel * { box-sizing: border-box; }
.mja11y-panel button { font: inherit; color: inherit; letter-spacing: normal; }
.mja11y-panel button:focus-visible { outline: 2px solid oklch(80% 0.12 195); outline-offset: 2px; border-radius: 4px; }

.mja11y-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.mja11y-title { font: 600 17px/1.2 'Work Sans', system-ui, sans-serif; margin: 0; color: #fff; }
.mja11y-x { background: none; border: 0; cursor: pointer; font-size: 26px !important; line-height: 1 !important; padding: 2px 8px; margin-right: -8px; color: #fff; }

.mja11y-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.mja11y-size { display: inline-flex; align-items: center; gap: 6px; }
.mja11y-step {
  min-width: 40px; height: 34px; padding: 0 8px; cursor: pointer;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; color: #fff;
  font-weight: 600 !important;
}
.mja11y-step:disabled { opacity: .35; cursor: default; }
.mja11y-val { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }

.mja11y-sw {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 0; margin: 0; background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, .12);
  cursor: pointer; text-align: left; color: #fff;
}
.mja11y-track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, .28); transition: background .15s; }
.mja11y-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.mja11y-sw[aria-checked="true"] .mja11y-track { background: oklch(60% 0.11 195); }
.mja11y-sw[aria-checked="true"] .mja11y-track::after { transform: translateX(18px); }

.mja11y-reset {
  width: 100%; margin-top: 10px; padding: 9px 12px; cursor: pointer;
  background: none; border: 1px solid rgba(255, 255, 255, .45); border-radius: 6px; color: #fff;
}
.mja11y-reset:hover { background: rgba(255, 255, 255, .08); }
.mja11y-note { margin: 10px 0 0; font-size: 12px; line-height: 1.4; color: rgba(255, 255, 255, .75); }

/* =====================================================================
   The settings themselves (only active when switched on)
   [data-a11y-t] = normal reading text (paragraphs, lists, form fields...)
   tagged by js/a11y.js. Text laid over photos, the hero, nav and menus
   is never tagged, so those layouts can't overflow.
   ===================================================================== */

/* Larger text */
html.a11y-size [data-a11y-t] {
  font-size: calc(var(--a11y-fs) * var(--a11y-scale, 1)) !important;
  line-height: var(--a11y-lh, normal) !important;
}

/* Extra spacing (comes after text size so its line height wins when both are on) */
html.a11y-spacing [data-a11y-t] {
  line-height: 1.8 !important;
  letter-spacing: .06em !important;
  word-spacing: .12em !important;
}

/* Easy-read font (Atkinson Hyperlegible, loaded only when switched on) */
html.a11y-font body *:not(.mja11y-panel):not(.mja11y-panel *) {
  font-family: 'Atkinson Hyperlegible', 'Work Sans', Verdana, sans-serif !important;
}

/* High contrast: js/a11y.js marks each piece of text by what is behind it */
html.a11y-contrast [data-a11y-c="d"] { color: #000 !important; text-shadow: none !important; }
html.a11y-contrast [data-a11y-c="l"] { color: #fff !important; }
html.a11y-contrast [data-a11y-c="p"] { color: #fff !important; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 10px #000 !important; }

/* Highlight links */
html.a11y-links a {
  text-decoration-line: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
}
html.a11y-links a[data-a11y-inl] {
  background-color: #ffe14d !important;
  color: #000 !important;
  text-shadow: none !important;
  border-radius: 2px;
}
html.a11y-links a:focus-visible,
html.a11y-links button:focus-visible { outline: 3px solid #ffbf00 !important; outline-offset: 2px !important; }

/* Large cursor (mouse/trackpad devices only; the option is hidden on touch screens) */
html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M5 3 L5 33 L12.5 26 L17.5 37 L23 34.5 L18 24 L28 24 Z' fill='white' stroke='black' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E") 5 3, auto !important;
}
html.a11y-cursor [data-a11y-ptr],
html.a11y-cursor [data-a11y-ptr] * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M5 3 L5 33 L12.5 26 L17.5 37 L23 34.5 L18 24 L28 24 Z' fill='%2300b3b3' stroke='black' stroke-width='2.2' stroke-linejoin='round'/%3E%3Ccircle cx='31' cy='9' r='5' fill='%2300b3b3' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 5 3, pointer !important;
}
html.a11y-cursor input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.a11y-cursor textarea { cursor: text !important; }

/* Pause animations */
html.a11y-motion,
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
