/* =========================================================================
   MagnusIBA Blog System - Premium Styles
   SEO-optimized, AIO-friendly, Social Media Sharing Ready
   World-class responsive design with accessibility support
   Modern Yellow + Black Brand Theme
   ========================================================================= */

/* ============================================
   DESIGN TOKENS - Yellow & Black Brand
   ============================================ */
:root {
  /* Base Palette */
  --white: #ffffff;
  --snow: #fafafa;
  --pearl: #f5f5f5;
  --silver: #e5e5e5;
  --mist: #d4d4d4;
  --slate: #737373;
  --storm: #525252;
  --charcoal: #404040;
  --graphite: #262626;
  --obsidian: #171717;
  --void: #0a0a0a;

  /* Focus ring for accessibility */
  --focus-ring: rgba(251, 191, 36, 0.5);
  --focus-ring-offset: 2px;

  /* Primary Brand - Golden Yellow */
  --primary-50: #FFFBEB;
  --primary-100: #FEF3C7;
  --primary-200: #FDE68A;
  --primary-300: #FCD34D;
  --primary-400: #FBBF24;
  --primary-500: #F59E0B;
  --primary-600: #D97706;
  --primary-700: #B45309;

  /* Accent - Rich Gold */
  --accent-400: #FCD34D;
  --accent-500: #FBBF24;
  --accent-600: #F59E0B;

  /* Success - Emerald */
  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success-500: #10b981;
  --success-600: #059669;

  /* Warning - Orange */
  --warning-50: #fff7ed;
  --warning-100: #ffedd5;
  --warning-500: #f97316;
  --warning-600: #ea580c;

  /* Error - Rose */
  --error-50: #fff1f2;
  --error-100: #ffe4e6;
  --error-500: #f43f5e;
  --error-600: #e11d48;

  /* Semantic Colors */
  --bg-primary: var(--snow);
  --bg-secondary: var(--white);
  --text-primary: var(--void);
  --text-secondary: var(--graphite);
  --text-tertiary: var(--storm);
  --text-muted: var(--slate);
  --border-subtle: var(--silver);
  --border-default: var(--mist);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows - Yellow tinted for brand */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 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-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 8px 30px rgba(251, 191, 36, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.3);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-enter: 400ms;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-dark: rgba(10, 10, 10, 0.9);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: 16px;

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
  --gradient-dark: linear-gradient(135deg, var(--void) 0%, var(--graphite) 100%);
  --gradient-mesh-1: radial-gradient(at 40% 20%, rgba(251, 191, 36, 0.08) 0px, transparent 50%);
  --gradient-mesh-2: radial-gradient(at 80% 80%, rgba(245, 158, 11, 0.06) 0px, transparent 50%);

  /* Animation */
  --reveal-distance: 30px;
  --stagger-delay: 80ms;

  /* Safe Areas */
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--primary-100);
  color: var(--primary-700);
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--snow) 0%, var(--pearl) 50%, var(--snow) 100%);
}

.fx-layer::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
  animation: floatOrb 30s ease-in-out infinite;
}

.fx-layer::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.03) 0%, transparent 55%);
  animation: floatOrb 25s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, 2%) scale(1.02); }
  66% { transform: translate(-2%, -1%) scale(0.98); }
}

.grain {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
}

/* ============================================
   MODERN STICKY HEADER
   ============================================ */
.header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all var(--duration-slow) var(--ease-out);
}

.header-wrapper.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--space-4) + var(--safe-top)) var(--space-6) var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--duration-base) var(--ease-out);
}

.brand:hover {
  transform: scale(1.02);
}

.brand .logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--void);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--primary-400);
}

.brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand .logo-fallback {
  width: 44px;
  height: 44px;
  background: var(--void);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  color: var(--primary-400);
  font-weight: 900;
  font-size: 18px;
  border: 2px solid var(--primary-400);
}

.brand .name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  transition: color var(--duration-base) var(--ease-out);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-gold);
  transition: width var(--duration-base) var(--ease-out);
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav a:not(.btn):not(.nav-link) {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  transition: color var(--duration-base) var(--ease-out);
}

.nav a:not(.btn):not(.nav-link)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-gold);
  transition: width var(--duration-base) var(--ease-out);
}

.nav a:not(.btn):not(.nav-link):hover::after {
  width: 100%;
}

.nav a:not(.btn):not(.nav-link):hover {
  color: var(--text-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn.primary {
  background: var(--gradient-gold);
  color: var(--void);
  font-weight: 700;
  box-shadow: var(--shadow-sm), 0 2px 8px rgba(251, 191, 36, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 4px 16px rgba(251, 191, 36, 0.4);
}

.btn.ghost {
  background: var(--white);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.btn.ghost:hover {
  border-color: var(--primary-300);
  color: var(--void);
  background: var(--primary-50);
}

.btn.dark {
  background: var(--gradient-dark);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn.dark:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.success {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: var(--white);
  box-shadow: var(--shadow-sm), 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn.success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn.full-width {
  width: 100%;
}

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-auth {
  margin-left: var(--space-2);
}

/* User Avatar & Menu */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary, #6366f1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.user-menu-container {
  position: relative;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 180px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu a,
.user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu a:hover,
.user-menu button:hover {
  background: #f1f5f9;
}

.user-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

.user-menu svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-lg);
  transition: background var(--duration-base) var(--ease-out);
}

.mobile-menu-btn:hover {
  background: var(--pearl);
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-out);
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-slow) var(--ease-out);
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-container {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--white);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-nav-overlay.active .mobile-nav-container {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  transition: all var(--duration-base) var(--ease-out);
}

.mobile-close-btn:hover {
  background: var(--pearl);
  color: var(--text-primary);
}

.mobile-user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--primary-50);
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary-400);
}

.mobile-user-info {
  display: flex;
  flex-direction: column;
}

.mobile-user-name {
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-user-status {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.mobile-nav-links {
  flex: 1;
  padding: var(--space-4) 0;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all var(--duration-base) var(--ease-out);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--primary-50);
  color: var(--primary-600);
}

.mobile-nav-link svg {
  color: var(--slate);
}

.mobile-nav-link:hover svg,
.mobile-nav-link.active svg {
  color: var(--primary-500);
}

.mobile-nav-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* Mobile Dashboard Link - Shown when signed in */
.mobile-dashboard-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin: 0 16px 8px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: var(--void);
  font-weight: 600;
  font-size: 15px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.mobile-dashboard-link svg {
  width: 22px;
  height: 22px;
}
.mobile-dashboard-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

/* ============================================
   ANIMATED HERO SECTION
   ============================================ */
.hero-section {
  position: relative;
  margin-bottom: var(--space-8);
  padding: var(--space-10) var(--space-6);
  border-radius: var(--radius-3xl);
  background: linear-gradient(135deg, var(--void) 0%, var(--graphite) 50%, var(--void) 100%);
  overflow: hidden;
}

.animated-hero {
  isolation: isolate;
}

.hero-frame {
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--radius-3xl) - 3px);
  pointer-events: none;
  z-index: 0;
}

.hero-frame::before,
.hero-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.hero-frame::before {
  background: linear-gradient(
    var(--frame-angle, 0deg),
    var(--primary-400) 0%,
    var(--primary-500) 25%,
    var(--void) 50%,
    var(--primary-500) 75%,
    var(--primary-400) 100%
  );
  animation: frameRotate 4s linear infinite;
}

.hero-frame::after {
  inset: 3px;
  background: linear-gradient(
    var(--frame-angle, 0deg),
    #10b981 0%,
    #059669 25%,
    #f43f5e 50%,
    #e11d48 75%,
    #10b981 100%
  );
  animation: frameRotate 4s linear infinite reverse;
}

.hero-frame-inner {
  position: absolute;
  inset: 6px;
  background: linear-gradient(135deg, var(--void) 0%, var(--graphite) 50%, var(--void) 100%);
  border-radius: calc(var(--radius-3xl) - 9px);
  z-index: 1;
}

@property --frame-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes frameRotate {
  from { --frame-angle: 0deg; }
  to { --frame-angle: 360deg; }
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
  animation: heroGlow 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes heroGlow {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.hero-breadcrumbs {
  position: relative;
  z-index: 2;
  margin-bottom: var(--space-4);
  padding: 0;
}

.hero-breadcrumbs ol {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  flex-wrap: wrap;
}

.hero-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--slate);
  font-size: var(--text-sm);
}

.hero-breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--storm);
}

.hero-breadcrumbs a {
  color: var(--mist);
  transition: color var(--duration-base) var(--ease-out);
}

.hero-breadcrumbs a:hover {
  color: var(--primary-400);
}

.hero-breadcrumbs li[aria-current="page"] {
  color: var(--primary-400);
}

.hero-section .blog-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 6vw, var(--text-4xl));
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: var(--space-4);
}

.hero-title .greeting {
  color: var(--primary-400);
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

.hero-title .title-main {
  color: var(--white);
}

.hero-subtitle {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--graphite);
  text-align: center;
  max-width: 650px;
  margin: var(--space-6) auto 0;
  padding: var(--space-4) var(--space-8);
  line-height: var(--leading-relaxed);
  background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
  border: 2px solid var(--primary-400);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 8px 32px rgba(251, 191, 36, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .hero-section {
    padding: var(--space-6) var(--space-4);
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
  }

  .hero-frame {
    inset: 2px;
  }

  .hero-frame-inner {
    inset: 4px;
  }
}

/* ============================================
   PREMIUM FOOTER
   ============================================ */
.premium-footer {
  background: var(--void);
  color: var(--mist);
  margin-top: var(--space-16);
}

.premium-footer .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

.premium-footer .footer-main {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: var(--space-12);
  margin-bottom: var(--space-10);
}

.premium-footer .footer-brand-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.premium-footer .footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.premium-footer .footer-brand .logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--primary-400);
}

.premium-footer .footer-brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.premium-footer .footer-brand .name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--white);
}

.premium-footer .footer-tagline {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--slate);
  max-width: 280px;
}

.premium-footer .footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.premium-footer .social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--graphite);
  color: var(--mist);
  transition: all var(--duration-base) var(--ease-out);
}

.premium-footer .social-link:hover {
  background: var(--primary-500);
  color: var(--void);
  transform: translateY(-2px);
}

.premium-footer .footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.premium-footer .footer-col h4 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.premium-footer .footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--slate);
  padding: var(--space-2) 0;
  transition: color var(--duration-base) var(--ease-out);
}

.premium-footer .footer-col a:hover {
  color: var(--primary-400);
}

.premium-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-8);
  border-top: 1px solid var(--graphite);
  font-size: var(--text-sm);
  color: var(--storm);
}

.premium-footer .footer-credit {
  color: var(--slate);
}

@media (max-width: 768px) {
  .premium-footer .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .premium-footer .footer-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .premium-footer .footer-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .premium-footer .footer-links-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-6) var(--space-12);
  padding-top: 100px; /* Offset for fixed header */
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   BLOG POST ARTICLE
   ============================================ */
.blog-post {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.post-header {
  padding: var(--space-10) var(--space-10) var(--space-6);
  text-align: center;
}

.post-meta-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: color-mix(in srgb, var(--cat-color, var(--primary-500)) 10%, transparent);
  color: var(--cat-color, var(--primary-600));
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--duration-base) var(--ease-out);
}

.category-badge:hover {
  background: color-mix(in srgb, var(--cat-color, var(--primary-500)) 20%, transparent);
}

.reading-time {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.author .avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 700;
}

.author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.post-meta time {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* Featured Image */
.featured-image {
  margin: 0;
  padding: 0 var(--space-6);
}

.featured-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-2xl);
}

/* ============================================
   POST CONTENT (Article Typography)
   ============================================ */
.post-content {
  padding: var(--space-10);
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--text-secondary);
  text-align: justify;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  letter-spacing: -0.025em;
}

.post-content h1 { font-size: var(--text-3xl); }
.post-content h2 { font-size: var(--text-2xl); }
.post-content h3 { font-size: var(--text-xl); }
.post-content h4 { font-size: var(--text-lg); }

.post-content p {
  margin-bottom: var(--space-6);
}

.post-content a {
  color: var(--primary-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast);
}

.post-content a:hover {
  color: var(--primary-700);
}

.post-content strong {
  font-weight: 700;
  color: var(--text-primary);
}

.post-content em {
  font-style: italic;
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.post-content li {
  margin-bottom: var(--space-2);
}

.post-content li::marker {
  color: var(--primary-500);
}

.post-content blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid var(--primary-500);
  background: var(--primary-50);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-style: italic;
  color: var(--text-primary);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: var(--space-1) var(--space-2);
  background: var(--pearl);
  border-radius: var(--radius-sm);
  color: var(--error-600);
}

.post-content pre {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background: var(--void);
  border-radius: var(--radius-xl);
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--silver);
  font-size: var(--text-sm);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  margin: var(--space-8) 0;
}

.post-content hr {
  margin: var(--space-10) 0;
  border: none;
  height: 1px;
  background: var(--border-subtle);
}

.post-content table {
  width: 100%;
  margin: var(--space-8) 0;
  border-collapse: collapse;
}

.post-content th,
.post-content td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.post-content th {
  background: var(--pearl);
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   POST FOOTER (Tags)
   ============================================ */
.post-footer {
  padding: var(--space-6) var(--space-10) var(--space-10);
  border-top: 1px solid var(--border-subtle);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-flex;
  padding: var(--space-2) var(--space-3);
  background: var(--pearl);
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--duration-base) var(--ease-out);
}

.tag:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

/* ============================================
   CTA SECTION
   ============================================ */
.post-cta {
  margin-top: var(--space-10);
}

.cta-card {
  padding: var(--space-10);
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-3xl);
  text-align: center;
  color: var(--white);
}

.cta-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.cta-card p {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-6);
}

.cta-card .btn {
  background: var(--white);
  color: var(--primary-600);
  font-weight: 700;
}

.cta-card .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   FOOTER
   ============================================ */
/* ============================================
   MODERN DARK FOOTER
   ============================================ */
.footer {
  padding: var(--space-16) var(--space-6) calc(var(--space-8) + var(--safe-bottom));
  background: var(--void);
  color: var(--pearl);
  margin-top: var(--space-16);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-12);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-brand .brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-brand .brand .name {
  color: var(--white);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--slate);
  line-height: var(--leading-relaxed);
  max-width: 280px;
}

@media (max-width: 768px) {
  .footer-tagline {
    max-width: none;
  }
}

.footer-nav-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-nav-column h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  margin-bottom: var(--space-2);
}

.footer-nav-column a {
  font-size: var(--text-sm);
  color: var(--pearl);
  transition: color var(--duration-fast);
  padding: var(--space-1) 0;
}

.footer-nav-column a:hover {
  color: var(--primary-400);
}

.footer-bottom {
  max-width: 1200px;
  margin: var(--space-12) auto 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--graphite);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

.footer-bottom p {
  font-size: var(--text-sm);
  color: var(--storm);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--storm);
  transition: color var(--duration-fast);
}

.footer-links a:hover {
  color: var(--primary-400);
}

/* Legacy footer support */
.footer p {
  font-size: var(--text-sm);
  color: var(--storm);
}

.footer-nav {
  display: flex;
  gap: var(--space-6);
}

.footer-nav a {
  font-size: var(--text-sm);
  color: var(--pearl);
  transition: color var(--duration-fast);
}

.footer-nav a:hover {
  color: var(--primary-400);
}

/* ============================================
   BLOG LISTING PAGE
   ============================================ */
.blog-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.blog-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-3);
}

.blog-header p {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.filter-bar .search-input {
  flex: 1;
  min-width: 200px;
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  transition: all var(--duration-base) var(--ease-out);
}

.filter-bar .search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-bar select {
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  cursor: pointer;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

/* Blog Card */
/* Card Animation */
@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Premium Blog Card - High Contrast Design */
.blog-card {
  position: relative;
  background: linear-gradient(145deg, var(--white) 0%, var(--snow) 100%);
  border-radius: var(--radius-2xl);
  overflow: visible;
  border: 2px solid var(--graphite);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  animation: cardReveal 0.5s var(--ease-out) forwards;
  animation-delay: calc(var(--card-index, 0) * var(--stagger-delay));
}

/* Animated Border Container - Yellow/Black */
.blog-card::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-2xl) + 4px);
  background: conic-gradient(
    from var(--blog-card-angle, 0deg),
    var(--primary-400) 0deg,
    var(--void) 90deg,
    var(--primary-500) 180deg,
    var(--void) 270deg,
    var(--primary-400) 360deg
  );
  z-index: -2;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  animation: blogCardBorderSpin 4s linear infinite;
}

/* Inner Animated Frame - Green/Red */
.blog-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-2xl) + 2px);
  background: conic-gradient(
    from var(--blog-card-angle, 0deg),
    #10b981 0deg,
    #f43f5e 120deg,
    #10b981 240deg,
    #f43f5e 360deg
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  animation: blogCardBorderSpin 4s linear infinite reverse;
}

@property --blog-card-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes blogCardBorderSpin {
  from { --blog-card-angle: 0deg; }
  to { --blog-card-angle: 360deg; }
}

.blog-card:hover {
  border-color: transparent;
  transform: translateY(-12px) scale(1.02);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.2),
    0 15px 30px rgba(251, 191, 36, 0.15);
}

.blog-card:hover::before,
.blog-card:hover::after {
  opacity: 1;
}

.blog-card .card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--graphite) 0%, var(--void) 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  position: relative;
  display: block;
}

.blog-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.blog-card:hover .card-image img {
  transform: scale(1.08);
}

.blog-card .card-body {
  padding: var(--space-5);
  background: linear-gradient(180deg, var(--white) 0%, var(--snow) 100%);
}

.blog-card .card-category {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 10px;
  background: var(--void);
  color: var(--primary-400);
  border: 1px solid var(--primary-500);
  margin-bottom: var(--space-3);
  text-decoration: none;
}

.blog-card .card-category:hover {
  background: var(--primary-500);
  color: var(--void);
}

.blog-card .card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: var(--leading-snug);
  color: var(--void);
  margin-bottom: var(--space-2);
}

.blog-card .card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card .card-title a:hover {
  color: var(--primary-600);
}

.blog-card .card-excerpt {
  font-size: var(--text-sm);
  color: var(--storm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .card-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--silver);
}

.blog-card .card-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--graphite);
  font-weight: 500;
}

.blog-card .card-author .author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-card .card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--slate);
}

.blog-card .card-meta .dot {
  color: var(--silver);
}

.blog-card .featured-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: var(--void);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-10);
}

.pagination button,
.pagination a {
  padding: var(--space-2) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-base);
}

.pagination button:hover,
.pagination a:hover {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.pagination .active {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: var(--white);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   ERROR PAGES
   ============================================ */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: var(--bg-primary);
}

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

.error-content h1 {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 900;
  color: var(--primary-200);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-content p {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  margin-bottom: var(--space-8);
  max-width: 400px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--pearl) 25%, var(--silver) 50%, var(--pearl) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.admin-nav {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.admin-nav .nav-link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: all var(--duration-base) var(--ease-out);
}

.admin-nav .nav-link:hover {
  color: var(--text-primary);
  background: var(--pearl);
}

.admin-nav .nav-link.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.stat-card .label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

/* Data Table */
.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--pearl);
}

.data-table td {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: var(--snow);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  transition: all var(--duration-base) var(--ease-out);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.char-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  float: right;
}

/* Editor Layout */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.editor-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.title-input {
  width: 100%;
  padding: var(--space-4);
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.title-input::placeholder {
  color: var(--text-muted);
}

.title-input:focus {
  outline: none;
}

/* Quill Editor Overrides */
#editor {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  min-height: 500px;
}

.ql-toolbar {
  border: none !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
  background: var(--pearl);
}

.ql-container {
  border: none !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-lg) !important;
}

.ql-editor {
  padding: var(--space-6) !important;
  min-height: 400px;
}

.ql-editor.ql-blank::before {
  font-style: normal;
  color: var(--text-muted);
}

/* Editor Sidebar */
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.sidebar-card h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

/* SEO Preview */
.seo-preview {
  padding: var(--space-4);
  background: var(--snow);
  border-radius: var(--radius-lg);
}

.seo-title {
  font-size: var(--text-lg);
  color: #1a0dab;
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seo-url {
  font-size: var(--text-sm);
  color: #006621;
  margin-bottom: var(--space-1);
}

.seo-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-normal);
}

/* Image Upload */
.image-upload {
  position: relative;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-base);
}

.image-upload:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.image-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-placeholder {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.image-upload img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* Tags Input */
.tags-input input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.tags-list .tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.tags-list .tag button {
  padding: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  padding: var(--space-4) var(--space-5);
  background: var(--void);
  color: var(--white);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.3s var(--ease-out);
}

.toast.success {
  background: var(--success-600);
}

.toast.error {
  background: var(--error-600);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.show {
  display: flex;
}

.loader {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader .text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .header {
    padding: var(--space-4);
  }

  .main {
    padding: var(--space-4);
    padding-top: 80px; /* Offset for fixed header on mobile */
  }

  .post-header {
    padding: var(--space-6);
  }

  .post-content {
    padding: var(--space-6);
    font-size: var(--text-base);
  }

  .post-footer {
    padding: var(--space-6);
  }

  .featured-image {
    padding: 0 var(--space-4);
  }

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

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .cta-card {
    padding: var(--space-6);
  }
}

@media (max-width: 480px) {
  .post-meta {
    flex-direction: column;
    gap: var(--space-3);
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .search-input {
    width: 100%;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .header,
  .footer,
  .post-cta,
  .fx-layer {
    display: none;
  }

  .blog-post {
    box-shadow: none;
    border: none;
  }

  .post-content {
    font-size: 12pt;
  }

  .post-content a {
    text-decoration: none;
    color: inherit;
  }

  .post-content a::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   ENHANCED BLOG HOME PAGE
   ============================================ */
.blog-home .main {
  max-width: 1200px;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: var(--space-6);
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--text-sm);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--slate);
}

.breadcrumbs a {
  color: var(--text-tertiary);
  transition: color var(--duration-base);
}

.breadcrumbs a:hover {
  color: var(--primary-600);
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-wrapper .search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrapper .search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 28px);
}

.category-select {
  min-width: 180px;
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-base);
}

.category-select:focus {
  outline: none;
  border-color: var(--primary-500);
}

/* Categories Navigation Pills */
.categories-nav {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-8);
  padding: 0 var(--space-4);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.category-pill:hover {
  border-color: var(--cat-color, var(--primary-500));
  color: var(--cat-color, var(--primary-600));
  background: color-mix(in srgb, var(--cat-color, var(--primary-500)) 5%, var(--white));
}

.category-pill.active {
  background: var(--cat-color, var(--primary-500));
  border-color: var(--cat-color, var(--primary-500));
  color: var(--white);
}

.category-pill .pill-icon {
  font-size: var(--text-base);
}

.category-pill .pill-count {
  font-size: var(--text-xs);
  padding: 2px 6px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
}

.category-pill.active .pill-count {
  background: rgba(255,255,255,0.25);
}

/* Featured Section */
.featured-section {
  margin-bottom: var(--space-10);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.section-title svg {
  color: var(--warning-500);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.featured-card {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-slow) var(--ease-out);
}

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

.featured-card.hero {
  grid-column: span 2;
  grid-row: span 2;
}

.featured-card .card-link {
  display: block;
  height: 100%;
}

.featured-card .card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.featured-card.hero .card-image {
  aspect-ratio: 16 / 9;
}

.featured-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.featured-card:hover .card-image img {
  transform: scale(1.05);
}

.featured-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.featured-card .card-content {
  padding: var(--space-4);
}

.featured-card.hero .card-content {
  padding: var(--space-6);
}

.featured-card .card-category {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  background: color-mix(in srgb, var(--cat-color, var(--primary-500)) 10%, transparent);
  color: var(--cat-color, var(--primary-600));
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.featured-card .card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
}

.featured-card.hero .card-title {
  font-size: var(--text-2xl);
}

.featured-card .card-excerpt {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-card .card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.featured-card .card-meta .dot {
  opacity: 0.5;
}

/* Blog Layout (Main + Sidebar) */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-8);
}

.blog-main {
  min-width: 0;
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--pearl);
  border-radius: var(--radius-lg);
}

.toggle-btn {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--duration-base);
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--white);
  color: var(--primary-600);
  box-shadow: var(--shadow-xs);
}

/* Blog Grid List View */
.blog-grid.list-view {
  grid-template-columns: 1fr;
}

.blog-grid.list-view .blog-card {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.blog-grid.list-view .blog-card .card-image {
  aspect-ratio: 16 / 10;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.card-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.card-author .author-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.card-meta .dot {
  opacity: 0.5;
}

/* Sidebar */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.sidebar-section {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.sidebar-title svg {
  color: var(--primary-500);
}

/* Sidebar Cards (Most Read) */
.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  transition: background var(--duration-base);
}

.sidebar-card:hover {
  background: var(--pearl);
}

.sidebar-card .rank {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.sidebar-card .card-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-card .card-info {
  flex: 1;
  min-width: 0;
}

.sidebar-card .card-info h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-card .card-views {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Category Links (Sidebar) */
.category-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.category-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--duration-base);
}

.category-link:hover {
  background: color-mix(in srgb, var(--cat-color, var(--primary-500)) 10%, transparent);
}

.category-link .link-icon {
  font-size: var(--text-lg);
}

.category-link .link-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.category-link .link-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--pearl);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Newsletter CTA */
.newsletter-cta {
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border: none;
}

.newsletter-cta h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary-700);
  margin-bottom: var(--space-2);
}

.newsletter-cta p {
  font-size: var(--text-sm);
  color: var(--primary-600);
  margin-bottom: var(--space-4);
}

.full-width {
  width: 100%;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.skeleton-card,
.skeleton-item {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   CATEGORY PAGE STYLES
   ============================================ */
.category-page .main {
  max-width: 1200px;
}

.category-header {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--cat-color) 5%, var(--white)),
    color-mix(in srgb, var(--cat-color) 10%, var(--white))
  );
  border-radius: var(--radius-3xl);
  margin-bottom: var(--space-8);
  border: 1px solid color-mix(in srgb, var(--cat-color) 20%, transparent);
}

.category-header .category-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-4);
}

.category-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.category-header .category-name-bn {
  font-size: var(--text-xl);
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.category-header .category-desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-4);
}

.category-header .category-count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cat-color);
}

/* ============================================
   ARTICLE PAGE STYLES
   ============================================ */
.article-page .main {
  max-width: 900px;
}

.article-page .post-header {
  padding: var(--space-8) var(--space-8) var(--space-6);
}

.article-page .post-meta-top {
  gap: var(--space-4);
  flex-wrap: wrap;
}

.article-page .reading-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.article-page .view-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.article-page .post-excerpt {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.article-page .post-meta {
  justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.author-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.author-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: grid;
  place-items: center;
  color: var(--white);
  font-weight: 700;
}

.author-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.author-details .author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.post-dates {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.post-dates .dot {
  opacity: 0.5;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.share-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--pearl);
  color: var(--text-tertiary);
  transition: all var(--duration-base);
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-btn.twitter:hover {
  background: #1DA1F2;
  color: var(--white);
}

.share-btn.facebook:hover {
  background: #1877F2;
  color: var(--white);
}

.share-btn.linkedin:hover {
  background: #0A66C2;
  color: var(--white);
}

.share-btn.copy-link:hover {
  background: var(--primary-500);
  color: var(--white);
}

.share-btn.whatsapp:hover {
  background: #25D366;
  color: var(--white);
}

/* Table of Contents */
.table-of-contents {
  margin: var(--space-6) var(--space-8);
  padding: var(--space-5);
  background: var(--pearl);
  border-radius: var(--radius-xl);
  border-left: 4px solid var(--primary-500);
}

.table-of-contents h2 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.table-of-contents ol {
  list-style: decimal;
  padding-left: var(--space-5);
}

.table-of-contents li {
  margin-bottom: var(--space-2);
}

.table-of-contents a {
  color: var(--primary-600);
  font-size: var(--text-sm);
}

.table-of-contents a:hover {
  text-decoration: underline;
}

/* Post Tags */
.post-tags {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border-subtle);
}

.tags-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Author Bio */
.author-bio {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-6) var(--space-8);
  background: var(--pearl);
  border-radius: var(--radius-xl);
}

.author-bio .bio-avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.author-bio .bio-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.author-bio .bio-content p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.author-social {
  display: flex;
  gap: var(--space-3);
}

.author-social a {
  font-size: var(--text-sm);
  color: var(--primary-600);
}

.author-social a:hover {
  text-decoration: underline;
}

/* Related Posts */
.related-posts {
  margin-top: var(--space-10);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.related-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.related-card .card-link {
  display: block;
}

.related-card .card-image {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
}

.related-card .card-content {
  padding: var(--space-4);
}

.related-card .card-content h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card .card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Pagination Enhanced */
.pagination {
  margin-top: var(--space-10);
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.page-num {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-base);
}

.page-num:hover:not(.active) {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.page-num.active {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: var(--white);
}

.page-ellipsis {
  padding: 0 var(--space-2);
  color: var(--text-muted);
}

.page-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-base);
}

.page-btn:hover {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

/* ============================================
   ENHANCED RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
  }

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

  .featured-card.hero {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-card.hero {
    grid-column: span 1;
  }

  .blog-sidebar {
    grid-template-columns: 1fr;
  }

  .blog-grid.list-view {
    grid-template-columns: 1fr;
  }

  .blog-grid.list-view .blog-card {
    grid-template-columns: 1fr;
  }

  .article-page .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .share-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: var(--space-4);
    padding: var(--space-5);
  }

  .category-header {
    padding: var(--space-6);
  }

  .category-header h1 {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 480px) {
  .categories-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
  }

  .filter-bar {
    flex-direction: column;
  }

  .search-wrapper {
    width: 100%;
  }

  .category-select {
    width: 100%;
  }

  .view-toggle {
    display: none;
  }

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

  .table-of-contents {
    margin: var(--space-4);
  }
}

/* ============================================
   ADMIN EDITOR SEO ANALYSIS STYLES
   ============================================ */

/* SEO Card Header */
.seo-card .seo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.seo-card .seo-header h3 {
  margin: 0;
}

/* SEO Score Badge */
.score-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.score-badge.excellent {
  background: var(--success-100);
  color: var(--success-700);
}

.score-badge.good {
  background: #E8F5E9;
  color: #2E7D32;
}

.score-badge.fair {
  background: #FFF3E0;
  color: #EF6C00;
}

.score-badge.poor {
  background: var(--error-100);
  color: var(--error-700);
}

/* SEO Analysis Items */
.seo-analysis {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.analysis-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--pearl);
}

.analysis-item .status {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
}

.analysis-item.pass {
  background: #E8F5E9;
}

.analysis-item.pass .status {
  background: #2E7D32;
  color: white;
}

.analysis-item.pass .text {
  color: #2E7D32;
}

.analysis-item.fail {
  background: #FFEBEE;
}

.analysis-item.fail .status {
  background: var(--error-500);
  color: white;
}

.analysis-item.fail .text {
  color: var(--error-700);
}

.analysis-item.neutral {
  background: var(--pearl);
}

.analysis-item.neutral .status {
  background: var(--text-muted);
  color: white;
}

.analysis-item.neutral .text {
  color: var(--text-muted);
}

/* Checkbox Labels */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-500);
  cursor: pointer;
}

.checkbox-label .checkmark {
  display: none;
}

/* Hint Text */
.hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Character Count */
.char-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
}

/* ============================================
   WORLD-CLASS UI ENHANCEMENTS
   ============================================ */

/* Enhanced Blog Header */
.blog-header {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--pearl) 50%, white 100%);
  border-radius: var(--radius-3xl);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

.blog-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 50%);
  animation: pulse-slow 8s ease-in-out infinite;
}

@keyframes pulse-slow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.blog-header h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-3);
  position: relative;
}

.blog-header p {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Views Count Styling */
.views-count,
.views,
.card-views {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
}

.views-count::before,
.views::before {
  content: '👁';
  font-size: 0.85em;
}

/* Enhanced Featured Badge */
.featured-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  z-index: 2;
}

/* Blog card styles moved to main section above */

/* Featured Cards Enhanced */
.featured-card {
  position: relative;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl);
  padding: 2px;
  background: linear-gradient(135deg, var(--primary-400), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.featured-card:hover::before {
  opacity: 1;
}

.featured-card.hero .card-image {
  position: relative;
}

.featured-card.hero .card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

/* Sidebar Enhanced */
.sidebar-section {
  position: relative;
  overflow: hidden;
}

.sidebar-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.sidebar-card:hover .card-info h4 {
  color: var(--primary-600);
}

.sidebar-card .rank {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  font-weight: 800;
}

/* Newsletter CTA Enhanced */
.newsletter-cta {
  background: linear-gradient(135deg, var(--primary-50) 0%, white 100%) !important;
  border-color: var(--primary-200) !important;
}

.newsletter-cta h3 {
  color: var(--primary-700);
}

.newsletter-cta .btn.primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  box-shadow: 0 4px 16px rgba(99,102,241,0.25);
  transition: all 0.3s ease;
}

.newsletter-cta .btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}

/* Most Read Enhanced */
.most-read .sidebar-card {
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.most-read .sidebar-card:hover {
  background: linear-gradient(135deg, var(--pearl) 0%, white 100%);
  transform: translateX(4px);
}

.most-read .card-thumb {
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Category Pills Enhanced */
.category-pill {
  position: relative;
  overflow: hidden;
}

.category-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cat-color) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-pill:hover::before {
  opacity: 0.1;
}

.category-pill.active {
  background: linear-gradient(135deg, var(--cat-color) 0%, color-mix(in srgb, var(--cat-color) 80%, black) 100%);
}

/* Filter Bar Enhanced */
.filter-bar {
  background: white;
  padding: var(--space-4);
  border-radius: var(--radius-2xl);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  border: 1px solid var(--border-subtle);
}

.search-wrapper {
  position: relative;
}

.search-input {
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

/* Empty State Enhanced */
.empty-state {
  padding: var(--space-16);
  text-align: center;
  background: linear-gradient(135deg, var(--pearl) 0%, white 100%);
  border-radius: var(--radius-3xl);
}

.empty-state svg {
  color: var(--primary-300);
  margin-bottom: var(--space-4);
}

.empty-state h2 {
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}

/* Skeleton Loading Enhanced */
.skeleton {
  background: linear-gradient(90deg, var(--pearl) 25%, var(--border-subtle) 50%, var(--pearl) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite ease-in-out;
}

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

/* Post CTA Enhanced */
.post-cta {
  margin-top: var(--space-12);
}

.cta-card {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
  padding: var(--space-10);
  border-radius: var(--radius-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
  animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cta-card h3 {
  font-size: var(--text-2xl);
  color: white;
  margin-bottom: var(--space-2);
  position: relative;
}

.cta-card p {
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-6);
  position: relative;
}

.cta-card .btn {
  background: white;
  color: var(--primary-600);
  font-weight: 700;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  position: relative;
}

.cta-card .btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ============================================
   ACCESSIBILITY - FOCUS STATES
   ============================================ */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--primary-600);
  color: var(--white);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Button focus states */
.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Input focus states */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.search-input:focus-visible,
.category-select:focus-visible {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Card focus states */
.blog-card:focus-within,
.featured-card:focus-within,
.related-card:focus-within,
.sidebar-card:focus-within {
  box-shadow: var(--shadow-card-hover), 0 0 0 3px var(--focus-ring);
}

/* Link focus in content */
.post-content a:focus-visible {
  background: var(--primary-50);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Category pill focus */
.category-pill:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Toggle button focus */
.toggle-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Share button focus */
.share-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Pagination focus */
.page-num:focus-visible,
.page-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    /* Invert the color palette for dark mode */
    --white: #0f172a;
    --snow: #1e293b;
    --pearl: #1e293b;
    --silver: #334155;
    --mist: #475569;
    --slate: #94a3b8;
    --storm: #cbd5e1;
    --charcoal: #e2e8f0;
    --graphite: #f1f5f9;
    --obsidian: #f8fafc;
    --void: #ffffff;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-subtle: #334155;
    --border-default: #475569;

    /* Shadows for dark mode */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  /* Dark mode specific overrides */
  body {
    background: var(--bg-primary);
    color: var(--text-primary);
  }

  .fx-layer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  }

  .fx-layer::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  }

  .fx-layer::after {
    background: radial-gradient(circle, rgba(20, 184, 166, 0.06) 0%, transparent 55%);
  }

  .blog-post,
  .blog-card,
  .featured-card,
  .sidebar-section,
  .related-card {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
  }

  .blog-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
  }

  .blog-header h1 {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-400) 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }

  .post-content code {
    background: var(--bg-secondary);
    color: var(--error-400);
  }

  .post-content pre {
    background: #000000;
  }

  .post-content blockquote {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary-400);
  }

  .filter-bar {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
  }

  .category-header {
    background: linear-gradient(135deg,
      rgba(99, 102, 241, 0.1),
      rgba(99, 102, 241, 0.05)
    );
    border-color: var(--border-subtle);
  }

  .cta-card {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  }

  .newsletter-cta {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-secondary) 100%) !important;
    border-color: var(--primary-700) !important;
  }

  .newsletter-cta h3 {
    color: var(--primary-300);
  }

  .newsletter-cta p {
    color: var(--primary-400);
  }

  .seo-preview {
    background: var(--bg-primary);
  }

  .seo-title {
    color: #8ab4f8;
  }

  .seo-url {
    color: #34a853;
  }

  /* Selection in dark mode */
  ::selection {
    background: rgba(99, 102, 241, 0.4);
    color: var(--white);
  }

  /* Admin panel dark mode */
  .admin-nav {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
  }

  .stat-card {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
  }

  .data-table th {
    background: var(--bg-primary);
  }

  .data-table tr:hover td {
    background: rgba(99, 102, 241, 0.05);
  }

  /* Toast in dark mode */
  .toast {
    background: var(--graphite);
    color: var(--void);
  }

  /* Loading overlay dark mode */
  .loading-overlay {
    background: rgba(15, 23, 42, 0.95);
  }

  /* Empty state dark mode */
  .empty-state {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  }

  /* Image placeholder dark mode */
  .blog-card .card-image,
  .featured-card .card-image {
    background: var(--bg-primary);
  }
}

/* ============================================
   COLOR-MIX FALLBACKS FOR OLDER BROWSERS
   ============================================ */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .category-badge {
    background: rgba(99, 102, 241, 0.1);
  }

  .category-badge:hover {
    background: rgba(99, 102, 241, 0.2);
  }

  .category-pill:hover {
    background: rgba(99, 102, 241, 0.05);
  }

  .category-pill.active {
    background: var(--primary-500);
  }

  .category-link:hover {
    background: rgba(99, 102, 241, 0.1);
  }

  .featured-card .card-category {
    background: rgba(99, 102, 241, 0.1);
  }

  .category-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
  }
}

/* ============================================
   NOSCRIPT FALLBACK STYLES
   ============================================ */
noscript .noscript-message {
  display: block;
  padding: var(--space-8);
  margin: var(--space-6);
  background: var(--warning-50);
  border: 1px solid var(--warning-500);
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--warning-700);
}

noscript .noscript-message h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

noscript .noscript-message p {
  font-size: var(--text-sm);
}

/* Hide skeleton loaders when JS is disabled */
noscript ~ .skeleton,
noscript ~ * .skeleton-card,
noscript ~ * .skeleton-item {
  display: none !important;
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
  :root {
    --border-subtle: var(--charcoal);
    --border-default: var(--graphite);
  }

  .blog-card,
  .featured-card,
  .sidebar-section,
  .blog-post {
    border-width: 2px;
  }

  .btn {
    border: 2px solid currentColor;
  }

  a {
    text-decoration: underline;
  }

  .post-content a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }
}

/* ============================================
   DARK MODE SUPPORT
   Must be at END of file to override all styles
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    /* Semantic Colors - Dark Mode */
    --bg-primary: var(--void);
    --bg-secondary: var(--obsidian);
    --text-primary: var(--snow);
    --text-secondary: var(--pearl);
    --text-tertiary: var(--mist);
    --text-muted: var(--slate);
    --border-subtle: var(--graphite);
    --border-default: var(--charcoal);

    /* Glassmorphism - Dark Mode */
    --glass-bg: rgba(10, 10, 10, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Shadows - Dark Mode */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 8px 30px rgba(251, 191, 36, 0.2), 0 4px 12px rgba(0, 0, 0, 0.4);

    /* Gradients - Dark Mode */
    --gradient-mesh-1: radial-gradient(at 40% 20%, rgba(251, 191, 36, 0.05) 0px, transparent 50%);
    --gradient-mesh-2: radial-gradient(at 80% 80%, rgba(245, 158, 11, 0.04) 0px, transparent 50%);
  }

  /* Body Background */
  body {
    background: var(--void) !important;
  }

  /* FX Layer - Dark Mode */
  .fx-layer {
    background: linear-gradient(135deg, var(--void) 0%, var(--obsidian) 50%, var(--void) 100%) !important;
  }

  .fx-layer::before {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.03) 0%, transparent 60%) !important;
  }

  .fx-layer::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.02) 0%, transparent 55%) !important;
  }

  /* Header - Dark Mode */
  .header-wrapper.scrolled {
    background: var(--glass-bg) !important;
    border-bottom-color: var(--graphite) !important;
  }

  .brand .name {
    color: var(--snow) !important;
  }

  /* Selection - Dark Mode */
  ::selection {
    background: var(--primary-600) !important;
    color: var(--white) !important;
  }

  /* Buttons - Dark Mode */
  .btn.ghost {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
    color: var(--pearl) !important;
  }

  .btn.ghost:hover {
    background: var(--graphite) !important;
    border-color: var(--primary-500) !important;
    color: var(--white) !important;
  }

  /* Search & Filter - Dark Mode */
  .search-input {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
    color: var(--snow) !important;
  }

  .search-input::placeholder {
    color: var(--slate) !important;
  }

  .category-select,
  .sort-select {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
    color: var(--pearl) !important;
  }

  .filter-bar {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  /* Category Pills - Dark Mode */
  .category-pill {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
    color: var(--pearl) !important;
  }

  .category-pill:hover {
    background: var(--graphite) !important;
    border-color: var(--primary-500) !important;
    color: var(--primary-400) !important;
  }

  .category-pill.active {
    background: var(--primary-600) !important;
    border-color: var(--primary-600) !important;
    color: var(--void) !important;
  }

  /* Blog Cards - Dark Mode */
  .blog-card,
  .article-card,
  .featured-card {
    background: linear-gradient(145deg, var(--obsidian) 0%, var(--void) 100%) !important;
    border-color: var(--graphite) !important;
  }

  .blog-card .card-body,
  .article-card .card-body,
  .featured-card .card-body {
    background: linear-gradient(180deg, var(--obsidian) 0%, var(--void) 100%) !important;
  }

  .blog-card .card-title,
  .blog-card .card-title a,
  .article-card .card-title,
  .article-card .card-title a,
  .featured-card .card-title,
  .featured-card .card-title a {
    color: var(--snow) !important;
  }

  .blog-card .card-excerpt,
  .article-card .card-excerpt,
  .featured-card .card-excerpt {
    color: var(--mist) !important;
  }

  .blog-card .card-footer,
  .article-card .card-footer,
  .featured-card .card-footer {
    background: var(--graphite) !important;
    border-top-color: var(--charcoal) !important;
  }

  .blog-card .card-meta,
  .article-card .card-meta,
  .featured-card .card-meta {
    border-top-color: var(--graphite) !important;
    color: var(--slate) !important;
  }

  .card-category {
    background: var(--graphite) !important;
    color: var(--primary-400) !important;
  }

  .card-views {
    color: var(--slate) !important;
  }

  /* Sidebar - Dark Mode */
  .sidebar-section {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .sidebar-title {
    color: var(--snow) !important;
  }

  .sidebar-card {
    background: var(--graphite) !important;
  }

  .sidebar-card .card-info h4 {
    color: var(--snow) !important;
  }

  .popular-item:hover {
    background: var(--graphite) !important;
  }

  .popular-item .rank {
    background: var(--graphite) !important;
    color: var(--primary-400) !important;
  }

  .popular-item .title {
    color: var(--snow) !important;
  }

  .category-link {
    color: var(--pearl) !important;
  }

  .category-link:hover {
    background: var(--graphite) !important;
  }

  .category-link .count {
    background: var(--graphite) !important;
  }

  .tag-link {
    background: var(--graphite) !important;
    color: var(--pearl) !important;
  }

  .tag-link:hover {
    background: var(--charcoal) !important;
    color: var(--primary-400) !important;
  }

  /* Pagination - Dark Mode */
  .pagination button,
  .pagination a {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
    color: var(--pearl) !important;
  }

  .pagination button:hover,
  .pagination a:hover {
    border-color: var(--primary-500) !important;
    color: var(--primary-400) !important;
  }

  /* Single Blog Page - Dark Mode */
  .blog-article,
  .blog-post {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .post-header h1,
  .blog-article h1 {
    color: var(--snow) !important;
  }

  .post-excerpt {
    color: var(--mist) !important;
  }

  .post-content,
  .article-content {
    color: var(--pearl) !important;
  }

  .post-content p,
  .article-content p {
    color: var(--mist) !important;
  }

  .post-content h1,
  .post-content h2,
  .post-content h3,
  .post-content h4,
  .article-content h1,
  .article-content h2,
  .article-content h3,
  .article-content h4 {
    color: var(--snow) !important;
  }

  .post-content code,
  .article-content code {
    background: var(--graphite) !important;
    color: var(--primary-400) !important;
  }

  .post-content pre,
  .article-content pre {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .post-content blockquote,
  .article-content blockquote {
    background: var(--graphite) !important;
    border-left-color: var(--primary-500) !important;
    color: var(--mist) !important;
  }

  .post-content ul,
  .post-content ol,
  .article-content ul,
  .article-content ol {
    color: var(--mist) !important;
  }

  /* Article Tags - Dark Mode */
  .article-tags,
  .post-tags {
    border-top-color: var(--graphite) !important;
  }

  .post-tags .label {
    color: var(--slate) !important;
  }

  /* Share Section - Dark Mode */
  .share-section {
    border-top-color: var(--graphite) !important;
  }

  .share-section .label {
    color: var(--slate) !important;
  }

  /* Author Box - Dark Mode */
  .author-box {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .author-box .author-name {
    color: var(--snow) !important;
  }

  .author-box .author-bio {
    color: var(--mist) !important;
  }

  /* Related Posts - Dark Mode */
  .related-posts {
    background: var(--obsidian) !important;
  }

  .related-posts h2 {
    color: var(--snow) !important;
  }

  /* Blog Header - Dark Mode */
  .blog-header {
    background: linear-gradient(135deg, var(--graphite) 0%, var(--obsidian) 50%, var(--void) 100%) !important;
  }

  .blog-header h1 {
    background: linear-gradient(135deg, var(--snow) 0%, var(--primary-400) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }

  .blog-header p {
    color: var(--mist) !important;
  }

  /* Taxonomy Header - Dark Mode */
  .taxonomy-header {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .taxonomy-header h1 {
    color: var(--snow) !important;
  }

  .taxonomy-header .description {
    color: var(--mist) !important;
  }

  /* Empty State - Dark Mode */
  .empty-state {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .empty-state h2 {
    color: var(--snow) !important;
  }

  .empty-state p {
    color: var(--mist) !important;
  }

  /* Skeleton - Dark Mode */
  .skeleton {
    background: linear-gradient(90deg, var(--graphite) 0%, var(--charcoal) 50%, var(--graphite) 100%) !important;
  }

  /* Noscript - Dark Mode */
  .noscript-message {
    background: var(--obsidian) !important;
    color: var(--snow) !important;
  }

  /* View Toggle - Dark Mode */
  .view-toggle {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .toggle-btn {
    color: var(--slate) !important;
  }

  .toggle-btn.active {
    background: var(--graphite) !important;
    color: var(--primary-400) !important;
  }

  /* Mobile Nav - Dark Mode */
  .mobile-nav-container {
    background: var(--obsidian) !important;
  }

  .mobile-nav-header {
    border-bottom-color: var(--graphite) !important;
  }

  .mobile-nav-header .brand .name {
    color: var(--snow) !important;
  }

  .mobile-close-btn {
    background: var(--graphite) !important;
    color: var(--pearl) !important;
  }

  .mobile-user-profile {
    background: linear-gradient(135deg, var(--graphite) 0%, var(--obsidian) 100%) !important;
    border-bottom-color: var(--graphite) !important;
  }

  .mobile-user-name {
    color: var(--snow) !important;
  }

  .mobile-nav-link {
    color: var(--pearl) !important;
  }

  .mobile-nav-link:hover {
    background: var(--graphite) !important;
    color: var(--snow) !important;
  }

  .mobile-nav-link.active {
    background: var(--graphite) !important;
    color: var(--primary-400) !important;
  }

  .mobile-nav-footer {
    background: var(--graphite) !important;
    border-top-color: var(--charcoal) !important;
  }

  /* User Menu - Dark Mode */
  .user-menu {
    background: var(--obsidian) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  }

  .user-menu a,
  .user-menu button {
    color: var(--pearl) !important;
  }

  .user-menu a:hover,
  .user-menu button:hover {
    background: var(--graphite) !important;
  }

  .user-menu-divider {
    background: var(--graphite) !important;
  }

  /* Comments Section - Dark Mode */
  .comments-section {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .comments-section h2 {
    color: var(--snow) !important;
  }

  .comment {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .comment-author {
    color: var(--snow) !important;
  }

  .comment-content {
    color: var(--mist) !important;
  }

  .comment-form textarea {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
    color: var(--snow) !important;
  }

  .comment-form textarea::placeholder {
    color: var(--slate) !important;
  }

  /* Breadcrumbs - Dark Mode */
  .breadcrumbs li {
    color: var(--slate) !important;
  }

  .breadcrumbs a {
    color: var(--mist) !important;
  }

  .breadcrumbs a:hover {
    color: var(--primary-400) !important;
  }

  .breadcrumbs li[aria-current="page"] {
    color: var(--pearl) !important;
  }

  /* Hero Section */
  .hero-subtitle {
    background: linear-gradient(135deg, var(--graphite) 0%, var(--charcoal) 100%) !important;
    color: var(--primary-400) !important;
    border-color: var(--primary-500) !important;
  }

  /* Newsletter CTA - Dark Mode */
  .newsletter-cta {
    background: linear-gradient(135deg, var(--graphite) 0%, var(--obsidian) 100%) !important;
    border-color: var(--primary-600) !important;
  }

  .newsletter-cta h3 {
    color: var(--primary-400) !important;
  }

  .newsletter-cta p {
    color: var(--mist) !important;
  }

  /* Analysis Items - Dark Mode */
  .analysis-item {
    background: var(--graphite) !important;
  }

  .analysis-item .text {
    color: var(--pearl) !important;
  }

  /* SEO Card - Dark Mode */
  .seo-card {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  /* Header & Nav - Dark Mode */
  .header {
    background: transparent !important;
  }

  .header-wrapper.scrolled,
  .header.scrolled {
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
  }

  .nav-link {
    color: var(--mist) !important;
  }

  .nav-link:hover {
    color: var(--snow) !important;
  }

  .nav-link.active {
    color: var(--primary-400) !important;
  }

  /* Brand Name - Override inline colors for dark mode */
  .brand .name span {
    color: var(--snow) !important;
  }

  .brand .name span:nth-child(2),
  .brand .name span:nth-child(4) {
    color: #4ade80 !important; /* Brighter green for dark mode */
  }

  .brand .name span:nth-child(3) {
    color: #f87171 !important; /* Brighter red for dark mode */
  }

  /* Logo Fallback - Dark Mode */
  .logo-fallback {
    background: var(--graphite) !important;
    color: var(--primary-400) !important;
  }

  /* Hamburger Menu - Dark Mode */
  .mobile-menu-btn {
    background: var(--graphite) !important;
  }

  .hamburger-line {
    background: var(--pearl) !important;
  }

  /* Mobile Nav Overlay - Dark Mode */
  .mobile-nav-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
  }

  /* Footer - Dark Mode */
  .footer {
    background: var(--void) !important;
    border-top-color: var(--graphite) !important;
  }

  .footer p,
  .footer a,
  .footer span {
    color: var(--slate) !important;
  }

  .footer a:hover {
    color: var(--primary-400) !important;
  }

  /* Share Buttons - Dark Mode */
  .share-btn {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
    color: var(--pearl) !important;
  }

  .share-btn:hover {
    background: var(--charcoal) !important;
    border-color: var(--primary-500) !important;
  }

  .share-btn.facebook:hover {
    background: #1877f2 !important;
    color: white !important;
  }

  .share-btn.whatsapp:hover {
    background: #25D366 !important;
    color: white !important;
  }

  .share-btn.twitter:hover {
    background: #1da1f2 !important;
    color: white !important;
  }

  .share-btn.copy:hover,
  .share-btn.copy-link:hover {
    background: var(--primary-500) !important;
    color: var(--void) !important;
  }

  /* Share Section Container - Dark Mode */
  .share-section {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  /* Primary Button - Dark Mode */
  .btn.primary {
    background: var(--primary-500) !important;
    color: var(--void) !important;
  }

  .btn.primary:hover {
    background: var(--primary-400) !important;
  }

  /* Main Content - Dark Mode */
  .main {
    background: transparent !important;
  }

  /* Container - Dark Mode */
  .container {
    background: transparent !important;
  }

  /* Course Details Cards - Dark Mode */
  .course-details {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .course-details h2 {
    color: var(--snow) !important;
  }

  .course-details .description {
    color: var(--mist) !important;
  }

  /* Breakdown Items - Dark Mode */
  .breakdown-item {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .breakdown-item .subject {
    color: var(--snow) !important;
  }

  .breakdown-item .count {
    background: var(--charcoal) !important;
    color: var(--primary-400) !important;
  }

  /* Enroll Card - Dark Mode */
  .enroll-card {
    background: var(--obsidian) !important;
    border-color: var(--primary-500) !important;
  }

  .enroll-card .info-list li {
    border-bottom-color: var(--graphite) !important;
  }

  .enroll-card .info-list .label {
    color: var(--slate) !important;
  }

  .enroll-card .info-list .value {
    color: var(--snow) !important;
  }

  /* Course Stats - Dark Mode */
  .course-stats {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .stat-item .label {
    color: var(--slate) !important;
  }

  /* Badge Dark Mode */
  .badge {
    opacity: 0.9;
  }

  /* Exam/Practice Cards - Dark Mode */
  .exam-card,
  .exam-article,
  .practice-card {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .exam-details-card {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .exam-details-card h2,
  .exam-title {
    color: var(--snow) !important;
  }

  .detail-item .detail-label {
    color: var(--slate) !important;
  }

  .detail-item .detail-value {
    color: var(--snow) !important;
  }

  /* Resource Cards - Dark Mode */
  .resource-card,
  .resource-article {
    background: var(--obsidian) !important;
    border-color: var(--graphite) !important;
  }

  .resource-title {
    color: var(--snow) !important;
  }

  .resource-excerpt {
    color: var(--mist) !important;
  }

  /* Download Section - Dark Mode */
  .download-section {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .download-section h2 {
    color: var(--snow) !important;
  }

  .file-info {
    color: var(--slate) !important;
  }

  /* Preview Gallery - Dark Mode */
  .preview-gallery {
    background: var(--obsidian) !important;
  }

  .preview-gallery h2 {
    color: var(--snow) !important;
  }

  .preview-item {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  /* Instructions - Dark Mode */
  .exam-instructions {
    background: var(--graphite) !important;
    border-color: var(--charcoal) !important;
  }

  .exam-instructions h2 {
    color: var(--snow) !important;
  }

  .instructions-content {
    color: var(--mist) !important;
  }

  /* Start Exam Button - Dark Mode */
  .start-exam {
    background: var(--primary-500) !important;
    color: var(--void) !important;
  }

  .start-exam:hover {
    background: var(--primary-400) !important;
  }

  /* Exam Content/Resource Content - Dark Mode */
  .exam-content,
  .resource-content {
    color: var(--mist) !important;
  }

  .exam-content p,
  .resource-content p {
    color: var(--mist) !important;
  }

  /* Hero Section - Dark Mode */
  .hero-content h1,
  .course-hero h1 {
    color: var(--snow) !important;
  }

  .hero-content .brief {
    color: var(--mist) !important;
  }

  /* Price Section - Dark Mode */
  .price-section {
    border-bottom-color: var(--graphite) !important;
  }

  .original-price {
    color: var(--slate) !important;
  }

  /* FAQ - Dark Mode */
  .faq-item {
    background: var(--graphite) !important;
  }

  .faq-item summary {
    color: var(--snow) !important;
  }

  .faq-item > div {
    color: var(--mist) !important;
  }

  /* Reviews - Dark Mode */
  .review-card {
    background: var(--graphite) !important;
  }

  .review-card p {
    color: var(--mist) !important;
  }

  /* Curriculum - Dark Mode */
  .curriculum-module {
    background: var(--graphite) !important;
  }

  .curriculum-module ul {
    color: var(--mist) !important;
  }

  /* Demo Class Cards - Dark Mode */
  .demo-class-card {
    background: var(--graphite) !important;
  }

  .demo-class-card div {
    color: var(--snow) !important;
  }

  /* Instructor Cards - Dark Mode */
  .instructor-card {
    background: var(--graphite) !important;
  }

  .instructor-card div {
    color: var(--snow) !important;
  }

  /* Features List - Dark Mode */
  .features-list li span {
    color: var(--mist) !important;
  }

  /* Toast - Dark Mode */
  .toast-container .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  }

  /* Related Section Headers - Dark Mode */
  .related-exams h2,
  .related-resources h2,
  .related-posts h2 {
    color: var(--snow) !important;
  }
}
