/* =========================================================
   SLIC Accessibility Widget
   Palette: --blue #00adbb, --dark-green #004f55,
            --light-blue #71b8be, --bg-color #d9f2f4
   ========================================================= */

:root {
  --a11y-blue: #00adbb;
  --a11y-dark-green: #004f55;
  --a11y-light-blue: #71b8be;
  --a11y-bg: #d9f2f4;
  --a11y-white: #ffffff;
  --a11y-shadow: 0 10px 30px rgba(0, 79, 85, 0.25);
}

/* ---------- Floating action button ---------- */
.a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 100px; /* sits above Intercom */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--a11y-dark-green);
  color: var(--a11y-white);
  border: 3px solid var(--a11y-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 99998;
  box-shadow: var(--a11y-shadow);
  transition: transform 0.2s ease, background 0.2s ease;
}

.a11y-fab:hover,
.a11y-fab:focus {
  background: var(--a11y-blue);
  transform: scale(1.06);
  outline: none;
}

.a11y-fab i {
  pointer-events: none;
}

/* ---------- Panel ---------- */
.a11y-panel {
  position: fixed;
  right: 20px;
  bottom: 170px;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--a11y-white);
  border-radius: 16px;
  box-shadow: var(--a11y-shadow);
  z-index: 99999;
  font-family: "Onest", sans-serif;
  color: var(--a11y-dark-green);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
}

.a11y-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.a11y-panel__header {
  background: var(--a11y-dark-green);
  color: var(--a11y-white);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.a11y-panel__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.a11y-panel__close {
  background: transparent;
  border: 0;
  color: var(--a11y-white);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.a11y-panel__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.a11y-panel__body {
  padding: 14px 18px 18px;
  max-height: 70vh;
  overflow-y: auto;
}

/* ---------- Sections ---------- */
.a11y-section {
  margin-bottom: 14px;
}

.a11y-section__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--a11y-light-blue);
  margin-bottom: 8px;
}

/* ---------- Font size controls ---------- */
.a11y-fontsize {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--a11y-bg);
  padding: 8px;
  border-radius: 10px;
}

.a11y-fontsize button {
  flex: 1;
  background: var(--a11y-white);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--a11y-dark-green);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.a11y-fontsize button:hover {
  background: var(--a11y-blue);
  color: var(--a11y-white);
}

.a11y-fontsize__value {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--a11y-dark-green);
}

/* ---------- Toggle grid ---------- */
.a11y-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.a11y-toggle {
  background: var(--a11y-bg);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--a11y-dark-green);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.a11y-toggle i {
  font-size: 18px;
}

.a11y-toggle:hover {
  background: #c4ebee;
}

.a11y-toggle.active {
  background: var(--a11y-blue);
  color: var(--a11y-white);
  border-color: var(--a11y-dark-green);
}

/* ---------- Reset button ---------- */
.a11y-reset {
  width: 100%;
  margin-top: 6px;
  background: transparent;
  border: 2px solid var(--a11y-dark-green);
  color: var(--a11y-dark-green);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.a11y-reset:hover {
  background: var(--a11y-dark-green);
  color: var(--a11y-white);
}

/* =========================================================
   Effects applied to the page when toggles are active
   ========================================================= */

/* High contrast */
body.a11y-contrast,
body.a11y-contrast * {
  background-color: #000 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}
body.a11y-contrast a,
body.a11y-contrast a * {
  color: #00e5ff !important;
}
body.a11y-contrast img,
body.a11y-contrast video,
body.a11y-contrast iframe {
  background: #000 !important;
}
/* Keep the widget itself readable in contrast mode */
body.a11y-contrast .a11y-panel,
body.a11y-contrast .a11y-panel * {
  background-color: #000 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}
body.a11y-contrast .a11y-fab {
  background: #000 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}

/* Grayscale */
body.a11y-grayscale {
  filter: grayscale(100%);
}

/* Readable font */
body.a11y-readable-font,
body.a11y-readable-font * {
  font-family: Verdana, Arial, "Helvetica Neue", Helvetica, sans-serif !important;
  letter-spacing: 0.3px !important;
}

/* Highlight links */
body.a11y-highlight-links a,
body.a11y-highlight-links a * {
  text-decoration: underline !important;
  background-color: #fff59d !important;
  color: #004f55 !important;
  outline: 1px solid #004f55 !important;
}

/* Big cursor — SVG arrow, 48x48, dark-green fill with white outline */
body.a11y-big-cursor,
body.a11y-big-cursor * {
  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='M6 4 L6 38 L16 28 L22 42 L28 40 L22 26 L36 26 Z' fill='%23004f55' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/></svg>") 4 4, auto !important;
}
body.a11y-big-cursor a,
body.a11y-big-cursor a *,
body.a11y-big-cursor button,
body.a11y-big-cursor button *,
body.a11y-big-cursor [role="button"],
body.a11y-big-cursor input[type="submit"],
body.a11y-big-cursor input[type="button"] {
  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='M16 4 L16 24 L10 24 L24 44 L38 24 L32 24 L32 4 Z' fill='%2300adbb' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/></svg>") 24 4, pointer !important;
}

/* Font scaling via body zoom — works across the px-heavy stylesheet */
body[data-a11y-scale="90"]  { zoom: 0.9;  }
body[data-a11y-scale="100"] { zoom: 1;    }
body[data-a11y-scale="110"] { zoom: 1.1;  }
body[data-a11y-scale="120"] { zoom: 1.2;  }
body[data-a11y-scale="130"] { zoom: 1.3;  }
body[data-a11y-scale="140"] { zoom: 1.4;  }
body[data-a11y-scale="150"] { zoom: 1.5;  }

/* The widget itself should not scale with the page zoom */
.a11y-fab,
.a11y-panel {
  zoom: 1 !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .a11y-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 170px;
  }
  .a11y-fab {
    right: 14px;
    bottom: 90px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
}
