/* =========================================================
   Accessibility — shared across all pages
   - Skip link + visible keyboard focus (WCAG 2.0 AA / IS 5568)
   - Accessibility menu widget styles
   - User-adjustable display modes
   ========================================================= */

/* ---- Skip to main content ---- */
.skip-link {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  transform: translateY(-120%);
  z-index: 10000;
  background: #0B1F3A;
  color: #fff;
  padding: .75rem 1.25rem;
  font: 600 .9rem/1 Inter, Heebo, system-ui, sans-serif;
  border-radius: 0 0 .5rem 0;
  text-decoration: none;
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); outline: 3px solid #4DD0E1; }

/* ---- Visible focus indicator everywhere (works on light & dark) ---- */
:focus-visible {
  outline: 2px solid #0B1F3A;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #4DD0E1;
  border-radius: 3px;
}

/* =========================================================
   Adjustable display modes (toggled on <html>)
   ========================================================= */

/* Invert colours — keep real photos/logos true via counter-invert */
html.acc-invert img,
html.acc-invert video,
html.acc-invert iframe { filter: invert(1) hue-rotate(180deg); }
/* Marquee logos are already white-filtered; keep them dark on the inverted (light) strip */
html.acc-invert .tlogo { filter: brightness(0) !important; }

/* Highlight links */
html.acc-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  outline: 2px dashed currentColor !important;
  outline-offset: 2px !important;
}

/* Readable font */
html.acc-readable,
html.acc-readable :not(svg):not(svg *) {
  font-family: Arial, Helvetica, "Segoe UI", Heebo, sans-serif !important;
  letter-spacing: .01em !important;
}
html.acc-readable p,
html.acc-readable li { line-height: 1.7 !important; }

/* Big cursor */
html.acc-cursor,
html.acc-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='M6 2 6 32 14 24 20 38 26 35 20 22 32 22z' fill='%23000' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 6 2, auto !important;
}

/* Stop animations */
html.acc-noanim *,
html.acc-noanim *::before,
html.acc-noanim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* =========================================================
   Accessibility menu widget
   ========================================================= */
#a11y-root { font-family: Inter, Heebo, system-ui, sans-serif; }

#a11y-btn {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  z-index: 9999;
  width: 54px; height: 54px;
  border-radius: 9999px;
  background: #1565C0;
  color: #fff;
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
#a11y-btn:hover { transform: translateY(-2px); background: #0D47A1; }
#a11y-btn svg { width: 30px; height: 30px; }

#a11y-panel {
  position: fixed;
  bottom: 84px;
  inset-inline-end: 20px;
  z-index: 9999;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: #fff;
  color: #0B1F3A;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.32);
  padding: 14px;
}
#a11y-panel[hidden] { display: none; }

#a11y-panel .a11y-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
#a11y-panel .a11y-title { font: 700 1rem/1.2 "Space Grotesk", Heebo, sans-serif; }
#a11y-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #0B1F3A;
  cursor: pointer; font-size: 16px; line-height: 1;
}

#a11y-panel .a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

#a11y-panel button.a11y-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px;
  border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc; color: #0B1F3A;
  font: 600 .72rem/1.15 Inter, Heebo, sans-serif;
  text-align: center; cursor: pointer;
  min-height: 64px;
  transition: background .15s ease, border-color .15s ease;
}
#a11y-panel button.a11y-opt:hover { background: #eef2f7; }
#a11y-panel button.a11y-opt[aria-pressed="true"] {
  background: #1565C0; color: #fff; border-color: #1565C0;
}
#a11y-panel button.a11y-opt svg { width: 22px; height: 22px; }

#a11y-reset {
  margin-top: 10px; width: 100%;
  padding: 9px; border-radius: 10px;
  border: 1px solid #e2e8f0; background: #fff; color: #b91c1c;
  font: 700 .8rem/1 Inter, Heebo, sans-serif; cursor: pointer;
}
#a11y-reset:hover { background: #fef2f2; }

#a11y-statement {
  display: block; text-align: center; margin-top: 10px;
  font: 600 .75rem/1 Inter, Heebo, sans-serif; color: #1565C0;
}
#a11y-statement:hover { text-decoration: underline; }

/* Respect OS-level reduced motion automatically */
@media (prefers-reduced-motion: reduce) {
  #a11y-btn, #a11y-panel button.a11y-opt { transition: none; }
}
