/* Spark News theme toggle — circle-blur-top-left effect
   Inspired by https://theme-toggle.rdsx.dev (View Transitions API) */
:root {
  --expo-out: linear(
    0 0%, 0.1684 2.66%, 0.3165 5.49%,
    0.446 8.52%, 0.5581 11.78%,
    0.6535 15.29%, 0.7341 19.11%,
    0.8011 23.3%, 0.8557 27.93%,
    0.8962 32.68%, 0.9283 38.01%,
    0.9529 44.08%, 0.9711 51.14%,
    0.9833 59.06%, 0.9915 68.74%, 1 100%
  );
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(root) {
    animation-timing-function: var(--expo-out);
  }

  ::view-transition-new(root) {
    mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><filter id="blur"><feGaussianBlur stdDeviation="2"/></filter></defs><circle cx="0" cy="0" r="18" fill="white" filter="url(%23blur)"/></svg>') top left / 0 no-repeat;
    -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><filter id="blur"><feGaussianBlur stdDeviation="2"/></filter></defs><circle cx="0" cy="0" r="18" fill="white" filter="url(%23blur)"/></svg>') top left / 0 no-repeat;
    mask-origin: content-box;
    -webkit-mask-origin: content-box;
    animation: spark-theme-scale 1s;
    animation-fill-mode: both;
    transform-origin: top left;
  }

  ::view-transition-old(root),
  html[data-theme="dark"]::view-transition-old(root) {
    animation: spark-theme-scale 1s;
    animation-fill-mode: both;
    transform-origin: top left;
    z-index: -1;
  }

  @keyframes spark-theme-scale {
    to {
      mask-size: 350vmax;
      -webkit-mask-size: 350vmax;
    }
  }
}

/* Home page dark theme support */
html[data-theme="dark"] body.spark-news-home {
  background: #0a0a0a;
  color: #fafafa;
}
html[data-theme="dark"] body.spark-news-home nav,
html[data-theme="dark"] body.spark-news-home .category-bar {
  background: rgba(10, 10, 10, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}
html[data-theme="dark"] body.spark-news-home .logo,
html[data-theme="dark"] body.spark-news-home .hero h1,
html[data-theme="dark"] body.spark-news-home .featured-content h2 a,
html[data-theme="dark"] body.spark-news-home .article-card h3 a,
html[data-theme="dark"] body.spark-news-home .section-label {
  color: #fafafa;
}
html[data-theme="dark"] body.spark-news-home .hero p,
html[data-theme="dark"] body.spark-news-home .article-excerpt,
html[data-theme="dark"] body.spark-news-home .article-meta {
  color: #cfcfcf;
}
html[data-theme="dark"] body.spark-news-home .featured,
html[data-theme="dark"] body.spark-news-home .article-card,
html[data-theme="dark"] body.spark-news-home .agent-banner-inner {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.10);
}
html[data-theme="dark"] body.spark-news-home .cat-pill {
  border-color: rgba(255,255,255,.16);
  color: #cfcfcf;
}
html[data-theme="dark"] body.spark-news-home .cat-pill:hover,
html[data-theme="dark"] body.spark-news-home .cat-pill.active {
  background: #fafafa;
  color: #0a0a0a;
  border-color: #fafafa;
}
html[data-theme="dark"] body.spark-news-home .btn-subscribe {
  background: #ff6b2b !important;
  color: #0a0a0a !important;
}
