/* ==========================================================================
   SEOBlog Premium Design System & Typography Tokens
   Shared across Homepage, Blog, Article, Admin, and Settings
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap');

:root {
  /* Color Palette - Light Theme */
  --bg-base: #fcfcfd;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f4f4f6;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-hover: #cbd5e1;
  
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-glow: rgba(37, 99, 235, 0.12);
  --accent-text: #1e40af;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;

  --nav-bg: rgba(252, 252, 253, 0.85);
  --nav-border: rgba(226, 232, 240, 0.8);
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px -1px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 20px 30px -10px rgba(15, 23, 42, 0.1), 0 8px 10px -4px rgba(15, 23, 42, 0.04);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Color Palette - Dark Theme */
  --bg-base: #09090b;
  --bg-surface: #111114;
  --bg-surface-elevated: #18181b;
  --bg-subtle: #222226;
  --bg-card: #121216;
  --bg-card-hover: #17171c;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --border-color: #27272a;
  --border-subtle: #1c1c20;
  --border-hover: #3f3f46;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.12);
  --accent-glow: rgba(59, 130, 246, 0.25);
  --accent-text: #93c5fd;

  --success: #34d399;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.15);

  --nav-bg: rgba(9, 9, 11, 0.85);
  --nav-border: rgba(39, 39, 42, 0.8);
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --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-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 20px 30px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(59, 130, 246, 0.25);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

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

/* ==========================================================================
   Typography Hierarchy
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.font-editorial {
  font-family: 'Newsreader', Georgia, serif;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.nav-links-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link-item {
  padding: 0.45rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link-item:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-link-item.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: scale(1.04);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
}

/* ==========================================================================
   Buttons & Pills
   ========================================================================== */
.btn-prime {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #ffffff !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px var(--accent-glow);
}

.btn-prime:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-sm-custom {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   Editorial Cards
   ========================================================================== */
.editorial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  box-shadow: var(--shadow-card);
}

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

.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.editorial-card:hover .card-img {
  transform: scale(1.04);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.6rem 0 0.5rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.editorial-card:hover .card-title {
  color: var(--accent);
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Featured Hero Card
   ========================================================================== */
.featured-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.featured-hero-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 420px;
}

.featured-media {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 320px;
}

.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.featured-hero-card:hover .featured-media img {
  transform: scale(1.03);
}

.featured-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-heading {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.featured-hero-card:hover .featured-heading {
  color: var(--accent);
}

.featured-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Loading Skeleton Animation
   ========================================================================== */
.skeleton-pulse {
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 0%,
    var(--border-subtle) 50%,
    var(--bg-subtle) 100%
  );
  background-size: 200% 100%;
  animation: skeletonLoad 1.8s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

@keyframes skeletonLoad {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Editorial Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2.5rem;
  margin-top: 5rem;
  color: var(--text-secondary);
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-bottom-bar {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 991px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .featured-media {
    height: 280px;
  }
  .featured-info {
    padding: 1.75rem;
  }
  .featured-heading {
    font-size: 1.65rem;
  }
}

@media (max-width: 767px) {
  .nav-links-group {
    display: none;
  }
  .nav-links-group.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu-btn {
    display: flex;
  }
  .footer-bottom-bar {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
