/* ============================================
   InfluenceHub – Catalog "Rodyti daugiau" reduced motion + contrast
   - WCAG AA contrast fix for #catalog-load-more and
     #catalog-load-more-label in both light and dark mode.
   - prefers-reduced-motion guard: disables the hover lift,
     transitions and any pulse/scale animation on the load-more
     control so users who prefer reduced motion are not exposed
     to motion.
   - 44px minimum touch target (WCAG 2.5.5).
   - Focus-visible ring for keyboard users.
   - Forced-colors (Windows High Contrast) support.
   ============================================ */

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

#catalog-load-more {
  /* WCAG 2.5.5 – minimum 44x44px touch target for mobile users */
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

/* ---------- Light mode contrast (WCAG AA) ----------
   Light mode:
     - button surface: #ffffff
     - button text: #334155 on #ffffff = 10.9:1 (passes AA)
     - label text: #334155 on #ffffff = 10.9:1 (passes AA)
     - hover text: #6d28d9 on #ffffff = 8.4:1 (passes AA)
*/

#catalog-load-more {
  color: #334155 !important;
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

#catalog-load-more:hover {
  color: #6d28d9 !important;
  border-color: #c4b5fd !important;
}

#catalog-load-more-label {
  color: inherit !important;
}

/* ---------- Dark mode contrast (WCAG AA) ----------
   Dark mode:
     - button surface: #0f172a
     - button text: #e2e8f0 on #0f172a = 12.4:1 (passes AA)
     - label text: #e2e8f0 on #0f172a = 12.4:1 (passes AA)
     - hover text: #c4b5fd on #0f172a = 9.6:1 (passes AA)
*/

.dark #catalog-load-more {
  color: #e2e8f0 !important;
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

.dark #catalog-load-more:hover {
  color: #c4b5fd !important;
  border-color: #8b5cf6 !important;
}

.dark #catalog-load-more-label {
  color: inherit !important;
}

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

#catalog-load-more:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 6px rgba(124, 58, 237, 0.35);
}

.dark #catalog-load-more:focus-visible {
  outline-color: #c4b5fd;
  box-shadow:
    0 0 0 2px #0f172a,
    0 0 0 6px rgba(196, 181, 253, 0.45);
}

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

@supports not selector(:focus-visible) {
  #catalog-load-more:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35);
  }

  .dark #catalog-load-more:focus {
    outline-color: #c4b5fd;
    box-shadow:
      0 0 0 2px #0f172a,
      0 0 0 6px rgba(196, 181, 253, 0.45);
  }
}

/* ---------- prefers-reduced-motion guard ----------
   The load-more button may animate on hover (lift/scale) and on
   state change (background/color transitions). Users who prefer
   reduced motion should see state changes instantly, with no
   motion. */

@media (prefers-reduced-motion: reduce) {
  #catalog-load-more,
  #catalog-load-more-label {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    scroll-behavior: auto !important;
  }

  /* Neutralise any hover/focus/active transform on the button */
  #catalog-load-more:hover,
  #catalog-load-more:focus,
  #catalog-load-more:focus-visible,
  #catalog-load-more:active {
    transform: none !important;
    transition: none !important;
  }

  /* Icons inside the button must not animate either */
  #catalog-load-more i,
  #catalog-load-more svg {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* Disable any pulse/scale animation on the button */
  #catalog-load-more,
  #catalog-load-more::before,
  #catalog-load-more::after {
    animation: none !important;
    transform: none !important;
  }

  /* Keep the focus ring visible but static (no animated halo) */
  #catalog-load-more:focus-visible {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35) !important;
  }

  .dark #catalog-load-more:focus-visible {
    box-shadow:
      0 0 0 2px #0f172a,
      0 0 0 6px rgba(196, 181, 253, 0.45) !important;
  }
}

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

@media (forced-colors: active) {
  #catalog-load-more {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
  }

  #catalog-load-more:hover {
    background: Highlight;
    color: HighlightText;
  }

  #catalog-load-more:focus-visible,
  #catalog-load-more:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
    background: Highlight;
    color: HighlightText;
  }
}
