/* =====================================================
   Django Blog Plus Design Tokens
   Unified CSS Custom Properties for consistent styling
   ===================================================== */

:root {
  /* ===== PRIMARY COLOR PALETTE ===== */
  /* Main brand purple - used for primary actions, links, accents */
  --color-primary-50: #f5f3ff;
  --color-primary-100: #ede9fe;
  --color-primary-200: #ddd6fe;
  --color-primary-300: #c4b5fd;
  --color-primary-400: #a78bfa;
  --color-primary-500: #667eea;  /* Main brand color */
  --color-primary-600: #5a67d8;
  --color-primary-700: #4c51bf;
  --color-primary-800: #434190;
  --color-primary-900: #312e81;

  /* Secondary purple - for gradients and accents */
  --color-secondary-500: #764ba2;
  --color-secondary-600: #6b3fa0;
  --color-secondary-700: #5a2d91;

  /* Brand gradient */
  --gradient-primary: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-secondary-500) 100%);
  --gradient-primary-hover: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-secondary-600) 100%);

  /* ===== NEUTRAL COLORS (GRAY SCALE) ===== */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* ===== SEMANTIC COLORS ===== */
  /* Success - green */
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-500: #10b981;
  --color-success-600: #059669;
  --color-success-700: #047857;

  /* Warning - amber/yellow */
  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;

  /* Error/Danger - red */
  --color-error-50: #fef2f2;
  --color-error-100: #fee2e2;
  --color-error-500: #ef4444;
  --color-error-600: #dc2626;
  --color-error-700: #b91c1c;

  /* Info - blue */
  --color-info-50: #eff6ff;
  --color-info-100: #dbeafe;
  --color-info-500: #3b82f6;
  --color-info-600: #2563eb;
  --color-info-700: #1d4ed8;

  /* ===== BACKGROUND COLORS ===== */
  --bg-primary: #ffffff;
  --bg-secondary: var(--color-gray-50);
  --bg-tertiary: var(--color-gray-100);
  --bg-gradient-light: linear-gradient(135deg, var(--color-primary-50) 0%, #ffffff 100%);
  --bg-gradient-dark: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-gray-900) 100%);

  /* ===== TYPOGRAPHY ===== */
  /* Font Families */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Font Sizes - using clamp for responsive scaling */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  --font-size-6xl: 3.75rem;     /* 60px */

  /* Responsive heading sizes */
  --heading-1: clamp(2.5rem, 5vw, 4rem);
  --heading-2: clamp(2rem, 4vw, 3rem);
  --heading-3: clamp(1.5rem, 3vw, 2.25rem);
  --heading-4: clamp(1.25rem, 2.5vw, 1.5rem);

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Line Heights */
  --line-height-tight: 1.1;
  --line-height-snug: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;

  /* Letter Spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;

  /* ===== SPACING SCALE ===== */
  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* ===== BORDER RADIUS ===== */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ===== SHADOWS ===== */
  /* Neutral shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Colored shadows for premium feel */
  --shadow-primary-sm: 0 4px 14px rgba(102, 126, 234, 0.25);
  --shadow-primary-md: 0 8px 25px rgba(102, 126, 234, 0.3);
  --shadow-primary-lg: 0 15px 35px rgba(102, 126, 234, 0.35);
  --shadow-primary-xl: 0 20px 40px rgba(102, 126, 234, 0.4);

  /* Inner shadow for inputs */
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  /* Focus ring */
  --shadow-focus: 0 0 0 3px rgba(102, 126, 234, 0.2);
  --shadow-focus-error: 0 0 0 3px rgba(239, 68, 68, 0.2);
  --shadow-focus-success: 0 0 0 3px rgba(16, 185, 129, 0.2);

  /* ===== BORDERS ===== */
  --border-width-thin: 1px;
  --border-width-medium: 2px;
  --border-width-thick: 3px;

  --border-color-light: var(--color-gray-200);
  --border-color-default: var(--color-gray-300);
  --border-color-dark: var(--color-gray-400);

  /* ===== TRANSITIONS ===== */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 400ms ease;

  /* Specific transitions */
  --transition-colors: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
  --transition-transform: transform 200ms ease;
  --transition-shadow: box-shadow 200ms ease;
  --transition-all: all 200ms ease;

  /* ===== Z-INDEX SCALE ===== */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* ===== BREAKPOINTS (for reference in media queries) ===== */
  /*
   * --breakpoint-sm: 640px;
   * --breakpoint-md: 768px;
   * --breakpoint-lg: 1024px;
   * --breakpoint-xl: 1280px;
   * --breakpoint-2xl: 1536px;
   */

  /* ===== COMPONENT SIZES ===== */
  /* Button heights */
  --btn-height-sm: 36px;
  --btn-height-md: 44px;
  --btn-height-lg: 52px;
  --btn-height-xl: 60px;

  /* Input heights */
  --input-height-sm: 36px;
  --input-height-md: 44px;
  --input-height-lg: 52px;
  --input-height-xl: 60px;

  /* Container widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  /* Sidebar width */
  --sidebar-width: 250px;

  /* Navbar height */
  --navbar-height: 70px;

  /* ===== BACKWARD-COMPATIBLE ALIASES ===== */
  /* Unprefixed aliases (used by legacy hero/improvements CSS) */
  --primary-50: var(--color-primary-50);
  --primary-100: var(--color-primary-100);
  --primary-200: var(--color-primary-200);
  --primary-500: var(--color-primary-500);
  --primary-600: var(--color-primary-600);
  --primary-700: var(--color-primary-700);
  --primary-900: var(--color-gray-900);

  --gray-50: var(--color-gray-50);
  --gray-100: var(--color-gray-100);
  --gray-200: var(--color-gray-200);
  --gray-300: var(--color-gray-300);
  --gray-400: var(--color-gray-400);
  --gray-500: var(--color-gray-500);
  --gray-600: var(--color-gray-600);
  --gray-700: var(--color-gray-700);
  --gray-800: var(--color-gray-800);
  --gray-900: var(--color-gray-900);

  --success-500: var(--color-success-500);
  --warning-500: var(--color-warning-500);
  --error-500: var(--color-error-500);

  /* Blog/skeleton template aliases */
  --color-primary: var(--color-primary-500);
  --color-primary-light: #8194ed;
  --color-primary-dark: var(--color-primary-600);
  --color-secondary: var(--color-secondary-500);
  --color-accent: var(--color-gray-800);
  --color-text-primary: var(--color-gray-900);
  --color-text-secondary: var(--color-gray-600);
  --color-text-tertiary: var(--color-gray-400);
  --color-bg-primary: var(--bg-primary);
  --color-bg-secondary: var(--bg-secondary);
  --color-bg-tertiary: var(--bg-tertiary);
  --color-border: var(--border-color-light);
  --color-border-light: var(--color-gray-100);

  /* Hero/landing-page spacing aliases (map to --space-* scale) */
  --color-primary-tps: var(--color-primary-500);
  --color-secondary-tps: var(--color-secondary-500);
  --spacing-xs: var(--space-2);    /* 8px */
  --spacing-sm: var(--space-3);    /* 12px */
  --spacing-md: var(--space-4);    /* 16px */
  --spacing-lg: var(--space-6);    /* 24px */
  --spacing-xl: var(--space-8);    /* 32px */
  --spacing-2xl: var(--space-12);  /* 48px */
  --spacing-3xl: var(--space-16);  /* 64px */
}

/* ===== DARK MODE TOKENS (for future use) ===== */
@media (prefers-color-scheme: dark) {
  :root.auto-dark-mode {
    --bg-primary: var(--color-gray-900);
    --bg-secondary: var(--color-gray-800);
    --bg-tertiary: var(--color-gray-700);

    --border-color-light: var(--color-gray-700);
    --border-color-default: var(--color-gray-600);
    --border-color-dark: var(--color-gray-500);
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
    --transition-slower: 0ms;
  }
}

