/* ==========================================================================
   Accessibility Widget — Abundant Life Senior Living Advisors
   ========================================================================== */

/* === Launcher button === */
.a11y-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #4C8C3A;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.a11y-launcher:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(0,0,0,0.3); }
.a11y-launcher svg { width: 28px; height: 28px; }

.a11y-launcher.pos-bottom-left { right: auto; left: 18px; }
.a11y-launcher.pos-top-right { bottom: auto; top: 18px; }
.a11y-launcher.pos-top-left { bottom: auto; top: 18px; right: auto; left: 18px; }

/* Mini re-show tab when hidden */
.a11y-reshow-tab {
  position: fixed;
  right: 0;
  bottom: 18px;
  z-index: 9998;
  background: #4C8C3A;
  color: #fff;
  border: none;
  padding: 10px 8px;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: Arial, sans-serif;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: none;
}
.a11y-reshow-tab.show { display: block; }

/* === Panel === */
.a11y-panel {
  position: fixed;
  right: 18px;
  bottom: 80px;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  font-family: Arial, Helvetica, sans-serif;
  display: none;
}
.a11y-panel.open { display: block; }

.a11y-panel.pos-bottom-left { right: auto; left: 18px; }
.a11y-panel.pos-top-right { bottom: auto; top: 80px; }
.a11y-panel.pos-top-left { bottom: auto; top: 80px; right: auto; left: 18px; }

.a11y-panel__header {
  background: #4C8C3A;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px 10px 0 0;
}
.a11y-panel__header h2 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
}
.a11y-panel__header span.kbd {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  opacity: 1;
  margin-left: 6px;
}
.a11y-panel__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.a11y-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.a11y-toggle {
  background: #fff;
  border: none;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  color: #1f2937;
  text-align: center;
}
.a11y-toggle:nth-child(even) { border-right: none; }
.a11y-toggle:hover { background: #f3f4f6; }
.a11y-toggle.active {
  background: #E3EFDF;
  box-shadow: inset 0 0 0 2px #4C8C3A;
}
.a11y-toggle svg { width: 26px; height: 26px; }
.a11y-toggle .level-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #4C8C3A;
}

.a11y-panel__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.a11y-panel__footer .a11y-toggle { border-bottom: none; }

/* === Effect: High Contrast === */
html.a11y-contrast {
  filter: contrast(1.35) saturate(1.1);
}
html.a11y-contrast body {
  background: #fff !important;
  color: #000 !important;
}

/* === Effect: Highlight Links === */
html.a11y-highlight-links a {
  outline: 2px solid #ff6f00 !important;
  background: #fff7e0 !important;
  color: #000 !important;
  text-decoration: underline !important;
}

/* === Effect: Bigger Text (levels 1-3 via html font-size) === */
html.a11y-text-1 { font-size: 18px !important; }
html.a11y-text-2 { font-size: 20px !important; }
html.a11y-text-3 { font-size: 23px !important; }

/* === Effect: Text Spacing (levels 1-3) === */
html.a11y-spacing-1 body, html.a11y-spacing-1 body * { letter-spacing: 0.04em !important; word-spacing: 0.12em !important; }
html.a11y-spacing-2 body, html.a11y-spacing-2 body * { letter-spacing: 0.08em !important; word-spacing: 0.2em !important; }
html.a11y-spacing-3 body, html.a11y-spacing-3 body * { letter-spacing: 0.12em !important; word-spacing: 0.3em !important; }

/* === Effect: Pause Animations === */
html.a11y-pause-animations *,
html.a11y-pause-animations *::before,
html.a11y-pause-animations *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.a11y-pause-animations [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}

/* === Effect: Dyslexia Friendly === */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/open-dyslexic-regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
html.a11y-dyslexia body,
html.a11y-dyslexia body * {
  font-family: 'OpenDyslexic', Verdana, Arial, sans-serif !important;
}

/* === Effect: Big Cursor === */
html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path d="M4 2l14 8-6 2 4 6-3 2-4-6-4 5z" fill="black" stroke="white" stroke-width="1.2"/></svg>') 4 4, auto !important;
}

/* === Effect: Line Height (levels 1-3) === */
html.a11y-lineheight-1 body, html.a11y-lineheight-1 body p, html.a11y-lineheight-1 body li { line-height: 1.9 !important; }
html.a11y-lineheight-2 body, html.a11y-lineheight-2 body p, html.a11y-lineheight-2 body li { line-height: 2.2 !important; }
html.a11y-lineheight-3 body, html.a11y-lineheight-3 body p, html.a11y-lineheight-3 body li { line-height: 2.6 !important; }

/* === Effect: Text Align Left === */
html.a11y-text-left body,
html.a11y-text-left body * {
  text-align: left !important;
}

/* === Effect: Tooltips (custom styled, JS-driven) === */
.a11y-tooltip-bubble {
  position: fixed;
  z-index: 10000;
  background: #1f2937;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

@media (max-width: 480px) {
  .a11y-panel { width: calc(100vw - 24px); bottom: 80px; right: 12px; }
  .a11y-launcher { right: 12px; bottom: 12px; }
}
