/*
 * Best Alternatives - Editorial Design System
 * bestalts.co
 *
 * Design: Editorial Authority - Magazine-inspired, curated feel
 * Typography: Serif headlines + clean sans body
 * Palette: Deep navy + warm amber accents
 */

/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
  /* Colors - Deep, trustworthy palette */
  --navy: #1e3a5f;
  --navy-light: #2d4a6f;
  --navy-dark: #152a47;
  --amber: #f59e0b;
  --amber-hover: #d97706;
  --emerald: #059669;
  --rose: #e11d48;

  /* Neutrals */
  --white: #ffffff;
  --cream: #faf9f7;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  /* Semantic */
  --primary: var(--navy);
  --accent: var(--amber);
  --success: var(--emerald);
  --danger: var(--rose);
  --text: var(--stone-800);
  --text-muted: var(--stone-500);
  --bg: var(--white);
  --bg-alt: var(--cream);
  --border: var(--stone-200);

  /* Typography */
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(30, 58, 95, 0.05);
  --shadow-md: 0 4px 12px rgba(30, 58, 95, 0.08);
  --shadow-lg: 0 8px 24px rgba(30, 58, 95, 0.12);
  --shadow-xl: 0 16px 48px rgba(30, 58, 95, 0.16);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ============================================
   Layout Container
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Narrow container for content pages */
.container--narrow {
  max-width: 800px;
}

/* ============================================
   Header - Editorial Navigation
   ============================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) var(--space-lg);
  backdrop-filter: blur(8px);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--navy-light);
}

/* Logo with tagline inline */
.logo-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
}

.logo-tagline {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 768px) {
  .logo-tagline {
    display: inline;
  }
}

/* Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--stone-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--navy);
}

/* ============================================
   Hero Section - Homepage
   ============================================ */
.hero {
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  background: var(--cream);
  position: relative;
  overflow: hidden;
}

/* Subtle dot pattern background */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--stone-300) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.6s ease forwards;
}

.hero .tagline {
  font-family: var(--font-sans);
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: var(--stone-600);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  animation: fadeInUp 0.6s ease 0.1s forwards;
  opacity: 0;
}

.hero .cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--amber);
  color: var(--stone-900);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  animation: fadeInUp 0.6s ease 0.2s forwards;
  opacity: 0;
  box-shadow: var(--shadow-md);
}

.hero .cta-button:hover {
  background: var(--amber-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero .cta-button::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.hero .cta-button:hover::after {
  transform: translateX(4px);
}

/* Trust badge */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  color: var(--stone-600);
  animation: fadeInUp 0.6s ease 0.3s forwards;
  opacity: 0;
}

.trust-badge::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--emerald);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ============================================
   Categories Grid - Homepage
   ============================================ */
.categories-section {
  padding: var(--space-3xl) var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.categories-section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: -0.02em;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition-base);
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.category-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-card h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.category-card p {
  font-size: 0.9375rem;
  color: var(--stone-500);
  line-height: 1.6;
  flex-grow: 1;
}

.article-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone-600);
}

.article-count::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
}

/* ============================================
   Popular Section - Homepage
   ============================================ */
.popular {
  padding: var(--space-3xl) var(--space-lg);
  background: var(--navy);
  color: var(--white);
}

.popular h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: -0.02em;
}

.popular-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  max-width: 1000px;
  margin: 0 auto;
}

.popular-links a {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.popular-links a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--stone-900);
  transform: translateY(-2px);
}

/* ============================================
   Footer
   ============================================ */
footer {
  padding: var(--space-2xl) var(--space-lg);
  background: var(--stone-50);
  border-top: 1px solid var(--border);
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

footer p {
  font-size: 0.875rem;
  color: var(--stone-500);
}

footer a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--amber-hover);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--stone-600);
}

/* ============================================
   Breadcrumb Navigation
   ============================================ */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--stone-500);
  margin: var(--space-md) 0;
}

.breadcrumb a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--amber-hover);
}

/* ============================================
   Content Pages (Alternatives)
   ============================================ */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* Page title */
main > h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.intro {
  font-size: 1.125rem;
  color: var(--stone-600);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

/* ============================================
   Table of Contents
   ============================================ */
.toc {
  background: var(--cream);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border);
}

.toc h2 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.toc ul {
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.toc li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toc li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  flex-shrink: 0;
}

.toc a {
  color: var(--stone-700);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.toc a:hover {
  color: var(--navy);
}

/* ============================================
   Alternative Cards
   ============================================ */
.alternative {
  position: relative;
  padding: var(--space-xl);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  transition: all var(--transition-base);
}

.alternative:hover {
  border-color: var(--stone-300);
  box-shadow: var(--shadow-md);
}

.alternative h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.alternative h2 a {
  color: inherit;
  text-decoration: none;
}

.alternative h2 a:hover {
  color: var(--navy-light);
}

.alternative > p {
  color: var(--stone-600);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

/* Pros & Cons Grid */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--stone-50);
  border-radius: var(--radius-md);
}

@media (max-width: 600px) {
  .pros-cons {
    grid-template-columns: 1fr;
  }
}

.pros h3, .cons h3 {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.pros h3 {
  color: var(--emerald);
}

.cons h3 {
  color: var(--rose);
}

.pros ul, .cons ul {
  list-style: none;
  font-size: 0.9375rem;
}

.pros li, .cons li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  color: var(--stone-700);
}

.pros li::before {
  content: '✓';
  color: var(--emerald);
  font-weight: 700;
  flex-shrink: 0;
}

.cons li::before {
  content: '✗';
  color: var(--rose);
  font-weight: 700;
  flex-shrink: 0;
}

/* Meta information */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--stone-500);
}

.meta strong {
  color: var(--stone-700);
  font-weight: 600;
}

/* Visit button */
.visit-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  background: var(--navy);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.visit-button:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
}

.visit-button::after {
  content: '→';
}

/* ============================================
   Conclusion Section
   ============================================ */
.conclusion {
  position: relative;
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-lg);
  margin: var(--space-2xl) 0;
  color: var(--white);
}

.conclusion h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.conclusion p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
}

.conclusion ul {
  list-style: none;
  margin-top: var(--space-md);
}

.conclusion li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  color: rgba(255, 255, 255, 0.9);
}

.conclusion li::before {
  content: '→';
  color: var(--amber);
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================
   FAQ Section
   ============================================ */
.faq {
  margin: var(--space-2xl) 0;
}

.faq h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-xl);
  letter-spacing: -0.01em;
}

.faq-item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:first-of-type {
  border-top: 1px solid var(--border);
}

.faq-item h3 {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--stone-800);
  margin-bottom: var(--space-sm);
}

.faq-item p {
  color: var(--stone-600);
  line-height: 1.7;
}

/* ============================================
   Related Links
   ============================================ */
.related {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--cream);
  border-radius: var(--radius-lg);
}

.related h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.related-links a {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--stone-700);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.related-links a:hover {
  border-color: var(--navy);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Staggered animation for category cards */
.category-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.15s; }
.category-card:nth-child(3) { animation-delay: 0.2s; }
.category-card:nth-child(4) { animation-delay: 0.25s; }
.category-card:nth-child(5) { animation-delay: 0.3s; }
.category-card:nth-child(6) { animation-delay: 0.35s; }
.category-card:nth-child(7) { animation-delay: 0.4s; }
.category-card:nth-child(8) { animation-delay: 0.45s; }
.category-card:nth-child(9) { animation-delay: 0.5s; }
.category-card:nth-child(10) { animation-delay: 0.55s; }
.category-card:nth-child(11) { animation-delay: 0.6s; }

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  :root {
    --space-lg: 1.25rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
  }

  .hero {
    padding: var(--space-2xl) var(--space-md);
  }

  .categories-section {
    padding: var(--space-2xl) var(--space-md);
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .popular {
    padding: var(--space-2xl) var(--space-md);
  }

  main {
    padding: var(--space-lg) var(--space-md);
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.25rem;
  }

  .nav-links {
    gap: var(--space-md);
  }

  .nav-links a {
    font-size: 0.875rem;
  }

  .meta {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
