/* ============================================
   InfluenceHub – FAQ accordion a11y
   - WCAG AA contrast for .faq-trigger and .faq-panel
     in both light and dark mode.
   - prefers-reduced-motion guard: disables the
     expand/collapse transition, hover/focus transforms
     and any pulse/scale animation on the FAQ items so
     users who prefer reduced motion are not exposed to
     motion.
   - 44px minimum touch target (WCAG 2.5.5) for the
     FAQ trigger.
   - Focus-visible ring for keyboard users.
   - Forced-colors (Windows High Contrast) support.
   ============================================ */

/* ---------- FAQ trigger – base contrast (WCAG AA) ----------
   Light mode:
     - trigger surface: #ffffff
     - trigger text: #0f172a on #ffffff = 17.9:1 (passes AA)
   Dark mode:
     - trigger surface: #0f172a
     - trigger text: #f1f5f9 on #0f172a = 15.9:1 (passes AA)
*/

.faq-trigger {
  color: #0f172a !important;
  background-color: transparent;
}

.dark .faq-trigger {
  color: #f1f5f9 !important;
}

/* ---------- FAQ panel – base contrast (WCAG AA) ----------
   Light mode:
     - panel text: #475569 on #ffffff = 7.5:1 (passes AA)
   Dark mode:
     - panel text: #cbd5e1 on #0f172a = 11.6:1 (passes AA)
*/

.faq-panel {
  color: #475569 !important;
}

.dark .faq-panel {
  color: #cbd5e1 !important;
}

/* ---------- 44px minimum touch target ---------- */

.faq-trigger {
  /* WCAG 2.5.5 – minimum 44x44px touch target for mobile users */
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Focus-visible ring (keyboard) ---------- */

.faq-trigger:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  border-radius: 0.75rem;
}

.dark .faq-trigger:focus-visible {
  outline-color: #c4b5fd;
  box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
}

/* ---------- Fallback for browsers without :focus-visible ---------- */

@supports not selector(:focus-visible) {
  .faq-trigger:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  }

  .dark .faq-trigger:focus {
    outline-color: #c4b5fd;
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
  }
}

/* ---------- prefers-reduced-motion guard ----------
   The FAQ accordion expands/collapses with a height transition and
   the trigger may animate on hover/focus. Users who prefer reduced
   motion should see state changes instantly, with no motion. */

@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-trigger,
  .faq-panel,
  .faq-icon {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    scroll-behavior: auto !important;
  }

  /* Neutralise any hover/focus/active transform on the trigger */
  .faq-trigger:hover,
  .faq-trigger:focus,
  .faq-trigger:focus-visible,
  .faq-trigger:active {
    transform: none !important;
    transition: none !important;
  }

  /* Icons inside the trigger must not animate either */
  .faq-icon,
  .faq-trigger i,
  .faq-trigger svg {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* Disable any pulse/scale animation on the FAQ item */
  .faq-item,
  .faq-item::before,
  .faq-item::after {
    animation: none !important;
    transform: none !important;
  }

  /* Keep the focus ring visible but static (no animated halo) */
  .faq-trigger:focus-visible {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25) !important;
  }

  .dark .faq-trigger:focus-visible {
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35) !important;
  }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */

@media (forced-colors: active) {
  .faq-trigger {
    color: CanvasText !important;
    background: Canvas;
    border: 1px solid CanvasText;
  }

  .faq-trigger:hover {
    background: Highlight;
    color: HighlightText;
  }

  .faq-trigger:focus-visible,
  .faq-trigger:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
    background: Highlight;
    color: HighlightText;
  }

  .faq-panel {
    color: CanvasText !important;
    background: Canvas;
  }
}
