@import 'tailwindcss';

@custom-variant dark (&:where(.dark, .dark *));

/* ---------------------------------------------------------------------------
   Design tokens — The Daily Tribune
--------------------------------------------------------------------------- */
@theme {
  --font-sans: var(--font-franklin), ui-sans-serif, system-ui, sans-serif;
  --font-serif: var(--font-caslon), Georgia, 'Times New Roman', serif;
  --font-reading: var(--font-ptserif), Georgia, 'Times New Roman', serif;

  /* Brand navy */
  --color-brand-50: #eef4ff;
  --color-brand-100: #d9e6ff;
  --color-brand-200: #b8d0ff;
  --color-brand-300: #8bb0ff;
  --color-brand-400: #5a86fb;
  --color-brand-500: #3660f0;
  --color-brand-600: #2544d6;
  --color-brand-700: #1f37ad;
  --color-brand-800: #1a2f7f;
  --color-brand-900: #0c2a5f;
  --color-brand-950: #081a3d;

  /* Editorial accent (breaking / live) */
  --color-accent-500: #e11d2a;
  --color-accent-600: #c81420;

  --radius-card: 0.75rem;
}

/* Surface variables so components read from one place in both themes */
:root {
  --surface: #ffffff;
  --surface-muted: #f6f8fc;
  --surface-sunken: #eef2f8;
  --border: #e3e8f0;
  --text: #101828;
  --text-muted: #667085;
  --header: #0c2a5f;
}

.dark {
  --surface: #0f1626;
  --surface-muted: #131c30;
  --surface-sunken: #0b1120;
  --border: #22304d;
  --text: #e6ecf5;
  --text-muted: #93a1b8;
  --header: #081a3d;
}

@layer base {
  * {
    border-color: var(--border);
  }
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    background: var(--surface-muted);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3, h4 {
    font-family: var(--font-serif);
    letter-spacing: -0.01em;
    font-weight: 700;
  }
  ::selection {
    background: var(--color-brand-900);
    color: #fff;
  }
}

/* Utility helpers mapped to theme surfaces */
@layer utilities {
  .bg-surface { background-color: var(--surface); }
  .bg-surface-muted { background-color: var(--surface-muted); }
  .bg-surface-sunken { background-color: var(--surface-sunken); }
  .border-surface { border-color: var(--border); }
  .text-body { color: var(--text); }
  .text-muted { color: var(--text-muted); }
  .container-page { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; }
  @media (min-width: 640px) { .container-page { padding-inline: 1.5rem; } }
  .no-scrollbar::-webkit-scrollbar { display: none; }
  .no-scrollbar { scrollbar-width: none; }
}

/* ---------------------------------------------------------------------------
   Article body typography (rendered HTML from the editor)
--------------------------------------------------------------------------- */
.prose-article {
  font-family: var(--font-reading);
  font-size: 1.2rem;
  line-height: 1.8;
  letter-spacing: 0.003em;
  color: var(--text);
}
.prose-article > * + * { margin-top: 1.35rem; }
.prose-article h2 { font-size: 1.7rem; font-weight: 700; margin-top: 2.5rem; }
.prose-article h3 { font-size: 1.35rem; font-weight: 700; margin-top: 2rem; }
.prose-article a { color: var(--color-brand-700); text-decoration: underline; text-underline-offset: 3px; }
.prose-article img { width: 100%; border-radius: 0.75rem; margin: 1.75rem 0; }
.prose-article blockquote {
  border-left: 4px solid var(--color-brand-900);
  padding: 0.25rem 0 0.25rem 1.25rem;
  font-style: italic;
  color: var(--text-muted);
}
.prose-article ul, .prose-article ol { padding-left: 1.5rem; }
.prose-article ul { list-style: disc; }
.prose-article ol { list-style: decimal; }
.prose-article code {
  font-family: ui-monospace, monospace;
  background: var(--surface-sunken);
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  font-size: 0.9em;
}

/* Marquee for the breaking-news ticker */
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-ticker {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}
.ticker-pause:hover .animate-ticker { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .animate-ticker { animation: none; transform: none; }
}

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
