/* TextStyler - responsive.css: every breakpoint, theme fallback and motion
   rule in one place. Loaded last so it can override style.css and tools.css.

   Contents:
   1. Dark-scheme fallback when JavaScript is unavailable
   2. Style grid + copy button breakpoints (1 / 2 / 3 columns)
   3. Header and footer adjustments on small screens
   4. prefers-reduced-motion
   5. Print styles
*/

/* 1 ----------------------------------------------------- dark fallback
   theme.js normally sets data-theme before paint. Without JavaScript the
   system preference still applies. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1115;
    --surface: #181B22;
    --border: #2A2F3A;
    --text: #F2F4F8;
    --muted: #9AA3B2;
    --accent: #8B8BFF;
    --accent-contrast: #0F1115;
    --success: #4CD38A;
    --success-text: #4CD38A;
    --badge-wide-bg: #1C3327;
    --badge-wide-text: #4CD38A;
    --badge-limited-bg: #332A14;
    --badge-limited-text: #E8B34B;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; }
}

/* 2 -------------------------------------------------- grid breakpoints */
@media (min-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .copy-btn { align-self: flex-end; min-width: 130px; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* 3 --------------------------------------------- small-screen chrome */
@media (max-width: 480px) {
  .site-head nav a { padding: 8px 7px; font-size: 0.9rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 18px; }
  .page-head .lede { font-size: 1rem; }
}

/* 4 --------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* 5 -------------------------------------------------------------- print */
@media print {
  .site-head, .site-foot, .copy-btn, .chips, .filter-row, .ad-slot { display: none !important; }
  body { background: #fff; color: #000; }
}
