/**
 * sabi-toolbox.css — NaijaSabi Toolbox Global Styles
 *
 * Loaded by WordPress via wp_enqueue_style.
 * Provides:
 *  1. CSS reset / normalization scoped to .sabi-module
 *  2. Google Fonts import (DM Sans)
 *  3. Loading skeleton for before React hydrates
 *  4. Print styles
 *  5. Dark/Light mode CSS custom properties
 *
 * NOTE: Component-specific styles are co-located in each JSX file
 * as <style> blocks for zero-FOUC rendering.
 */

/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;0,9..40,900;1,9..40,400&family=Fira+Code:wght@400;500&display=swap');

/* ─── Scoped Reset ─────────────────────────────────────────────────────────── */
.sabi-module,
.sabi-module * {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sabi-module {
  /* Override aggressive theme resets */
  line-height: 1.5;
  font-family: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Kill WordPress default list styles inside our modules */
.sabi-module ul,
.sabi-module ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Kill WP theme button resets */
.sabi-module button {
  font-family: inherit;
}

/* Kill WP theme input resets */
.sabi-module input,
.sabi-module textarea,
.sabi-module select {
  font-family: inherit;
}

/* ─── Loading Skeleton (pre-hydration) ─────────────────────────────────────── */
.sabi-module:empty::after {
  content: '';
  display: block;
  height: 560px;
  background: linear-gradient(90deg, #161616 25%, #1e1e1e 50%, #161616 75%);
  background-size: 200% 100%;
  animation: sabi-skeleton 1.4s infinite;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
}

@keyframes sabi-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Focus Visible Accessibility ─────────────────────────────────────────── */
.sabi-module *:focus-visible {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}

/* ─── Scrollbar Styling (Webkit) ───────────────────────────────────────────── */
.sabi-module ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.sabi-module ::-webkit-scrollbar-track {
  background: #161616;
  border-radius: 3px;
}

.sabi-module ::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

.sabi-module ::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

/* ─── Range Input Cross-browser ────────────────────────────────────────────── */
.sabi-module input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #2a2a2a;
  outline: none;
  cursor: pointer;
}

.sabi-module input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}

.sabi-module input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.sabi-module input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* ─── Utility: Screen reader only ──────────────────────────────────────────── */
.sabi-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Reduced Motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sabi-module *,
  .sabi-module *::before,
  .sabi-module *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Print ─────────────────────────────────────────────────────────────────── */
@media print {
  .sabi-module {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
  }

  /* Hide interactive elements that don't make sense on paper */
  .sabi-steps,
  .sabi-btn-whatsapp,
  .sabi-btn-primary,
  .sabi-slider-wrap {
    display: none !important;
  }
}

/* ─── High Contrast Mode (Windows) ────────────────────────────────────────── */
@media (forced-colors: active) {
  .sabi-module {
    border: 2px solid ButtonText;
  }
}
