/* =============================================
   BigNews - Design Tokens & Reset
   ============================================= */

:root {
  /* Backgrounds */
  --bg-base:      #0a0f1e;
  --bg-surface:   #0f172a;
  --bg-elevated:  #1e293b;
  --bg-header:    #070d1a;

  /* Brand */
  --primary:        #1d4ed8;
  --primary-hover:  #1e40af;
  --primary-light:  #dbeafe;
  --accent:         #3b82f6;
  --accent-bright:  #60a5fa;

  /* Text */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-on-primary: #ffffff;

  /* Borders */
  --border:         #1e293b;
  --border-focus:   #3b82f6;

  /* Typography */
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition: 200ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-bright); }

ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

h1, h2, h3, h4, h5, h6 { color: var(--text-primary); line-height: 1.3; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { color: var(--text-secondary); margin-bottom: var(--space-4); }

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

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--space-6); }
}

/* Category badge */
.category-badge {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--text-on-primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
}

.btn--primary { background: var(--primary); color: var(--text-on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--text-on-primary); transform: translateY(-1px); }

.btn--ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Home Hero */
.home-hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.home-hero__title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.home-hero__brand { color: var(--accent); }

.home-hero__sub {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  font-size: 1.0625rem;
}

.home-hero__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.home-section { margin-bottom: 2.5rem; }

/* Article summary */
.article-summary {
  font-size: 1.125rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* ---- Category Grid (home) ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.category-card:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
  transform: translateY(-2px);
}

.category-card__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.category-card__label {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---- Category Pills (news index) ---- */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.category-pill {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-elevated);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.category-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.category-pill--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
}

@media (max-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
