/* ============================================================
   The AI Press — styles.css
   Typography variables, smooth transitions, ticker, scrollbars,
   and fine-grained dark-mode / motion polish layered on Tailwind.
   ============================================================ */

:root {
  /* Editorial type scale (rem) */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.35vw, 1.4rem);
  --step-2:  clamp(1.44rem, 1.32rem + 0.6vw, 1.75rem);
  --step-3:  clamp(1.73rem, 1.54rem + 0.95vw, 2.19rem);
  --step-4:  clamp(2.07rem, 1.8rem + 1.35vw, 2.74rem);

  /* Spacing rhythm */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;

  /* Motion tokens */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
}

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

/* ---------- Typography helpers (use alongside Tailwind) ---------- */
.font-display { letter-spacing: -0.02em; }
.prose-serif { font-family: var(--font-serif, 'Source Serif 4', Georgia, serif); }

/* Headline line-height tuned for Fraunces */
h1, h2, .headline { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- Card entrance (JS adds .is-visible) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-med) var(--ease-out-expo), transform var(--dur-med) var(--ease-out-expo);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Card hover lift + image zoom */
.card-hover { transition: transform var(--dur-fast) var(--ease-out-expo), box-shadow var(--dur-med) ease, border-color var(--dur-fast) ease; }
.card-hover:hover { transform: translateY(-3px); }
.card-hover .card-img { transition: transform 600ms var(--ease-out-expo); }
.card-hover:hover .card-img { transform: scale(1.045); }

/* Nav active state (set by JS) */
.nav-link.active, .mnav-link.active { color: #e8452c; font-weight: 700; position: relative; }
.nav-link.active::after { content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px; background:#e8452c; border-radius:2px; }

/* ---------- Breaking-news ticker (seamless marquee) ---------- */
.ticker-mask { mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { width: max-content; animation: ticker-scroll 42s linear infinite; will-change: transform; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Ticker item separator */
.ticker-item { display:inline-flex; align-items:center; gap:.5rem; }
.ticker-item::before { content:""; width:4px; height:4px; border-radius:9999px; background:#e8452c; flex:none; }

/* ---------- Custom scrollbars (subtle) ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(120,120,130,.4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(120,120,130,.35); border-radius: 9999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(120,120,130,.6); background-clip: content-box; }

/* ---------- Focus visibility (a11y) ---------- */
:focus-visible { outline: 2px solid #e8452c; outline-offset: 2px; border-radius: 4px; }

/* ---------- Selection ---------- */
::selection { background: rgba(232,69,44,.22); }

/* ---------- Dark mode: deepen shadows / borders for contrast ---------- */
.dark .card-hover:hover { box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
.card-hover:hover { box-shadow: 0 16px 36px -20px rgba(12,13,16,.35); }

/* Readability: comfortable measure for long-form */
.measure { max-width: 68ch; }

/* ---------- Reduced-contrast-safe badge chips ---------- */
.badge { display:inline-flex; align-items:center; gap:.3rem; font-size:.68rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:.2rem .55rem; border-radius:9999px; line-height:1; }
