/* ==========================================================================
   FTS: a11y.css
   Purpose:
   - Focus ring for public UI
   - Content link underline system (hover + keyboard focus)
   - Reduced motion
   - Builder editing exceptions
   ========================================================================== */


  /* Focus ring for public UI */
  :where(a, button, input, textarea, select, summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus {
    outline: none;
  }

  :where(a, button, input, textarea, select, summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: var(--fts-focus-width) solid var(--fts-focus-ring);
    outline-offset: var(--fts-focus-offset);
  }

  :where(*):focus-visible {
    scroll-margin-top: var(--fts-focus-scroll-offset);
  }

  @media (forced-colors: active) {
    :where(a, button, input, textarea, select, summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
      outline: 2px solid CanvasText !important;
    }
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* Content link underlines: hover + keyboard focus only */
  :where(main, .entry-content, .fl-builder-content, .fl-rich-text, .fl-module-content)
  a:not(.fl-button):not(.fts-btn):not([class*="fts-btn"]):not([role="button"]):not(.wp-block-button__link) {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 50% calc(100% - 0.05em);
    background-size: 0% 2px;
    transition: background-size 220ms ease;
  }

  :where(main, .entry-content, .fl-builder-content, .fl-rich-text, .fl-module-content)
  a:not(.fl-button):not(.fts-btn):not([class*="fts-btn"]):not([role="button"]):not(.wp-block-button__link):hover,
  :where(main, .entry-content, .fl-builder-content, .fl-rich-text, .fl-module-content)
  a:not(.fl-button):not(.fts-btn):not([class*="fts-btn"]):not([role="button"]):not(.wp-block-button__link):focus-visible {
    background-size: 100% 2px !important;
  }

  @media (forced-colors: active) {
    :where(main, .entry-content, .fl-builder-content, .fl-rich-text, .fl-module-content)
    a:not(.fl-button):not(.fts-btn):not([class*="fts-btn"]):not([role="button"]):not(.wp-block-button__link) {
      background-image: none;
      text-decoration-line: underline !important;
    }
  }

  /* Never underline controls */
  :where(a.fl-button, .fl-button-wrap a, .fl-button-group a, .fl-module-button a) {
    text-decoration: none;
    background-image: none;
  }

  :where(nav, footer, .fl-page-nav, .fl-page-footer-wrap, .fl-theme-builder-footer) a {
    text-decoration: none;
    background-image: none;
  }

  /* While editing with BB on the front-end, keep focus/underlines off */
  :where(body.fl-builder, body.fl-builder-edit, body.fl-builder-preview)
  :where(a, button, input, textarea, select, summary, [role="button"], [tabindex]) {
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
    text-decoration: none !important;
  }