/*
 * Independence Magazine - Core Stylesheet & Design System
 * Independent Journalism, News & Biographies
 * Inspired by SouthMag & Top Global Editorial Publications
 */

:root {
  /* Color Palette - Clean Editorial with Signature Crimson Red Accent */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f9fafb;
  --border-light: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-dark: #111111;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --text-inverse: #ffffff;

  /* Editorial Accents */
  --accent-crimson: #d90429;
  --accent-crimson-hover: #b8001f;
  --accent-crimson-soft: #fff1f2;
  --accent-crimson-border: #fecdd3;
  --accent-navy: #0f172a;
  --accent-navy-light: #1e293b;
  --accent-gold: #c59b27;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, Cambria, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.08);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --max-width: 1280px;
  --header-height: 72px;
  --topbar-height: 36px;
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Sepia / Warm Paper Theme */
[data-theme="sepia"] {
  --bg-primary: #fbf0d9;
  --bg-secondary: #f4e4c1;
  --bg-tertiary: #eedab2;
  --bg-card: #fdf6e7;
  --border-light: #e4ce9e;
  --text-primary: #2d261e;
  --text-secondary: #5c4e3e;
  --text-muted: #7d6b56;
}

/* Dark Contrast Theme */
[data-theme="dark"] {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: #131b2b;
  --bg-hover: #1e293b;
  --border-light: #273449;
  --border-subtle: #1e293b;
  --border-dark: #e2e8f0;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --text-inverse: #0a0e17;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.section-spacing {
  padding-top: 54px;
  padding-bottom: 54px;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 0;
  border-bottom: none;
  position: relative;
}

.section-header::after {
  display: none;
}

.section-header-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header-link {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-crimson);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform var(--transition-fast);
}

.section-header-link:hover {
  transform: translateX(3px);
  color: var(--accent-crimson-hover);
}

/* Signature Editorial Badges & Pills */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background-color: var(--accent-crimson);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(217, 4, 41, 0.25);
  white-space: nowrap;
}

.category-badge.dark {
  background-color: var(--accent-navy);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.category-badge.white {
  background-color: #ffffff;
  color: var(--accent-crimson);
  border: 1px solid var(--accent-crimson-border);
}

/* Reading Time & Meta */
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.article-meta-divider {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--text-faint);
}

/* Author Avatar Pill */
.author-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-pill img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.author-pill .author-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 18px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-crimson);
  color: #ffffff;
  border: 1px solid var(--accent-crimson);
}

.btn-primary:hover {
  background-color: var(--accent-crimson-hover);
  border-color: var(--accent-crimson-hover);
}

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

.btn-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--accent-crimson);
  border-color: var(--accent-crimson);
  background-color: var(--accent-crimson-soft);
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--accent-crimson);
  color: #ffffff;
  padding: 8px 16px;
  z-index: 9999;
  font-weight: 700;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}
