/* Global Styles */
:root {
  /* Dark theme (default) */
  --bg: #0b1020;
  --bg-elev: #111834;
  --card: #121a3a;
  --primary: #7c5cff;
  --primary-600: #6b46ff;
  --secondary: #00d4ff;
  --accent: #00d4ff;
  --text: #e6ecff;
  --muted: #a5b4fc;
  --border: #243268;
  --success: #10b981;
  --warning: #f59e0b;
  /* Added tokens for blog/light contexts and utilities */
  --text-dark: #0e1328;
  --text-light: #b6c2e8;
  --border-light: #2a365f;
  --background-light: #0f152b;
  --surface-2: #0f1521;
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f8fafc;
  --card: #ffffff;
  --primary: #7c5cff;
  --primary-600: #6b46ff;
  --secondary: #0ea5e9;
  --accent: #0ea5e9;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --text-dark: #0f172a;
  --text-light: #475569;
  --border-light: #cbd5e1;
  --background-light: #f1f5f9;
  --surface-2: #f8fafc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); transition: background-color 0.3s ease, color 0.3s ease; }

/* Dark theme background gradient */
body {
  background: linear-gradient(160deg, #0a0f1e 0%, #0b1126 100%);
}

/* Light theme background */
:root[data-theme="light"] body {
  background: linear-gradient(160deg, #f8fafc 0%, #ffffff 100%);
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px); background: rgba(10, 14, 34, 0.7); border-bottom: 1px solid var(--border); }
/* Match blog page navbar to site header */
.navbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px); background: rgba(10, 14, 34, 0.7); border-bottom: 1px solid var(--border); }
.nav-container { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.brand-link { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  text-decoration: none; 
  color: inherit; 
  transition: opacity 0.3s ease;
}
.brand-link:hover {
  opacity: 0.8;
}
.logo { width: 60px; height: 60px; object-fit: contain; border-radius: 6px; }

/* Utility: uniform square icon size */
.img-80 { width: 80px; height: 80px; object-fit: contain; }
.brand-text { font-weight: 700; letter-spacing: 0.3px; }

.nav-menu { display: flex; align-items: center; gap: 20px; }
.nav-list { list-style: none; display: flex; align-items: center; gap: 16px; margin: 0; padding: 0; }
.nav-link { 
  color: var(--text); 
  text-decoration: none; 
  padding: 10px 16px; 
  border-radius: 10px; 
  transition: all 0.3s ease; 
  font-weight: 600;
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-link:hover { 
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
  border-color: transparent;
}
.nav-link:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.2);
}
/* Light theme nav-link adjustments */
:root[data-theme="light"] .nav-link {
  background: var(--card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
:root[data-theme="light"] .nav-link:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.2);
}

/* Dropdown Styles */
.dropdown { position: relative; }
.dropdown-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dropdown-toggle::after {
  content: '▼';
  font-size: 10px;
  transition: transform 0.3s ease;
}
.dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

/* Modern dropdown menu styling */
.dropdown-menu { 
  display: none; 
  position: absolute; 
  top: 100%; 
  left: 0; 
  background: var(--bg-elev); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 8px; 
  min-width: 260px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  z-index: 1000;
  margin-top: 4px;
}
.dropdown:hover .dropdown-menu { 
  display: block;
}

/* Button-style dropdown items */
.dropdown-item { 
  color: var(--text); 
  text-decoration: none; 
  padding: 10px 14px; 
  border-radius: 8px; 
  display: block; 
  transition: all 0.3s ease;
  font-weight: 600;
  margin-bottom: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.dropdown-item:last-child {
  margin-bottom: 0;
}
.dropdown-item:hover { 
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
  border-color: transparent;
}
.dropdown-item:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.2);
}

/* Light theme dropdown adjustments */
:root[data-theme="light"] .dropdown-menu {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
:root[data-theme="light"] .dropdown-item {
  background: var(--card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
:root[data-theme="light"] .dropdown-item:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.2);
}

/* Legacy dropdown support */
.nav-dropdown { position: relative; }
.dropdown-content { 
  display: none; 
  position: absolute; 
  top: 40px; 
  left: 0; 
  background: var(--bg-elev); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 10px; 
  min-width: 260px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
}
.nav-dropdown:hover .dropdown-content { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 8px; 
}
.dropdown-content a { 
  color: var(--text); 
  text-decoration: none; 
  padding: 8px 10px; 
  border-radius: 8px; 
  display: block; 
  transition: all 0.3s ease;
  font-weight: 500;
}
.dropdown-content a:hover { 
  background: rgba(124,92,255,0.15); 
  color: var(--primary);
  transform: translateX(4px);
}
/* Light theme legacy dropdown adjustments */
:root[data-theme="light"] .dropdown-content {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
:root[data-theme="light"] .dropdown-content a:hover {
  background: rgba(124,92,255,0.08);
  color: var(--primary);
}

.nav-search { display: flex; align-items: center; gap: 8px; }
.search-input { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 10px; outline: none; min-width: 220px; min-height: 44px; }
.search-btn { 
  background: linear-gradient(135deg, var(--primary), var(--primary-600)); 
  color: white; 
  border: 0; 
  padding: 8px 12px; 
  border-radius: 10px; 
  cursor: pointer; 
  font-weight: 600; 
  transition: all 0.3s ease; 
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.2); 
}
.search-btn:hover { 
  background: linear-gradient(135deg, var(--primary-600), var(--primary)); 
  transform: translateY(-1px); 
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3); 
}
.search-btn:active { 
  transform: translateY(0); 
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.2); 
}

.nav-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; background: transparent; border: none; padding: 8px; }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); display: block; transition: transform 0.2s ease, opacity 0.2s ease; }

/* Theme Toggle Button */
.theme-toggle {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(124, 92, 255, 0.15);
  border-color: rgba(124, 92, 255, 0.35);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(180deg);
}

/* Hero */
.hero { padding: 60px 0 30px; border-bottom: 1px solid var(--border); }
.hero-container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; }
.hero-title { font-size: 42px; line-height: 1.1; margin: 0 0 12px; }
.hero-subtitle { color: var(--muted); margin: 0 0 24px; }
.gradient-text { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats { display: flex; gap: 22px; margin-top: 14px; }
.stat-item { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; text-align: center; }
.stat-number { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 12px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; }
.btn { 
  padding: 12px 20px; 
  border-radius: 12px; 
  text-decoration: none; 
  font-weight: 600; 
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  min-height: 44px;
}
.btn-primary { 
  background: linear-gradient(135deg, var(--primary), var(--primary-600)); 
  color: white;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
}
.btn-secondary { 
  border: 1px solid var(--border); 
  color: var(--text); 
  background: var(--bg-elev);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* Hover states */
.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
  background: linear-gradient(135deg, var(--primary-600), var(--accent));
}
.btn-secondary:hover { 
  background: rgba(124, 92, 255, 0.08); 
  border-color: rgba(124, 92, 255, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.btn:active {
  transform: translateY(0);
}
/* Light theme button adjustments */
:root[data-theme="light"] .btn {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
:root[data-theme="light"] .btn-primary {
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.2);
}
:root[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.25);
}
:root[data-theme="light"] .btn-secondary {
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
:root[data-theme="light"] .btn-secondary:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-banner { width: 250px; height: 250px; display: block; object-fit: contain; border-radius: 16px; background: radial-gradient(120px 120px at 80% 10%, rgba(124,92,255,0.2), transparent), radial-gradient(100px 100px at 10% 50%, rgba(0,212,255,0.18), transparent); padding: 10px; border: 1px solid var(--border); }

/* Featured Calculators */
.featured-calculators { padding: 40px 0; }
.section-title { font-size: 28px; margin: 0 0 8px; }
.section-subtitle { color: var(--muted); margin: 0 0 20px; }
.calculator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.calculator-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .3s ease; display: flex; flex-direction: column; gap: 10px; }
.calculator-card:hover { transform: translateY(-2px); border-color: rgba(124,92,255,0.45); }

/* Dark theme card hover */
:root:not([data-theme="light"]) .calculator-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* Light theme card hover */
:root[data-theme="light"] .calculator-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.card-icon img { width: 80px; height: 80px; object-fit: contain; border-radius: 10px; background: var(--bg-elev); padding: 8px; border: 1px solid var(--border); transition: background-color .3s ease; }
.card-title { margin: 6px 0 4px; font-size: 18px; }
.card-description { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.card-link { margin-top: auto; color: var(--accent); text-decoration: none; font-weight: 600; }

/* Features */
.features { padding: 20px 0 60px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-item { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.feature-icon { font-size: 22px; }
.feature-title { margin: 8px 0; font-size: 18px; }
.feature-description { color: var(--muted); margin: 0; }

/* Info Section */
.info-section { padding: 40px 0; background: var(--bg-elev); }
.info-box { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.info-title { margin: 0 0 20px; font-size: 28px; color: var(--text); text-align: center; }
.info-description { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0 0 24px; text-align: center; }
.info-highlights { display: grid; gap: 16px; }
.highlight-item { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; }
.highlight-icon { font-size: 20px; flex-shrink: 0; }
.highlight-text { color: var(--text); line-height: 1.5; }
.highlight-text strong { color: var(--accent); }

/* Footer */
.footer { background: #0a0f22; border-top: 1px solid var(--border); padding-top: 24px; }
.footer-content { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 18px; padding-bottom: 16px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-logo { width: 28px; height: 28px; border-radius: 6px; }
.footer-brand-text { font-weight: 700; }
.footer-description { color: var(--muted); }
.footer-title { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-links a { color: var(--text); text-decoration: none; opacity: 0.9; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 12px 0; color: var(--muted); }
.footer-social { display: flex; gap: 12px; }
.social-link { color: var(--muted); text-decoration: none; }

/* Responsive */
@media (max-width: 1024px) { .calculator-grid, .features-grid { grid-template-columns: repeat(2, 1fr); } .hero-container { grid-template-columns: 1fr; } }
@media (max-width: 640px) { 
  .nav-menu { 
    display: none; 
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(11, 16, 32, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  }
  
  .nav-menu.mobile-open {
    display: block !important;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .nav-list > li {
    width: 100%;
    border-bottom: 1px solid rgba(36, 50, 104, 0.3);
  }
  
  .nav-list > li:last-child {
    border-bottom: none;
  }
  
  .nav-link {
    display: block;
    width: 100%;
    padding: 16px 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-size: 16px;
    text-align: left;
  }
  
  /* Mobile dropdown handling */
  .nav-dropdown .dropdown-content {
    position: static;
    display: none;
    background: rgba(15, 21, 43, 0.8);
    margin: 10px 0 0 0;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
    min-width: auto;
  }
  
  .nav-dropdown.mobile-dropdown-open .dropdown-content {
    display: block;
  }
  
  .dropdown-content a {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 0;
  }
  
  .dropdown-content a:hover {
    transform: none;
    background: rgba(124,92,255,0.2);
  }
  
  .nav-toggle { 
    display: flex;
    z-index: 1001;
  } 
  
  .nav-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  
  .nav-search { display: none; } 
  .calculator-grid, .features-grid { grid-template-columns: 1fr !important; } 
  .hero-title { font-size: 32px; }
  
  /* Info section mobile styles */
  .info-section { padding: 30px 0; }
  .info-box { padding: 24px 16px; }
  .info-title { font-size: 24px; }
  .info-description { font-size: 15px; }
  .highlight-item { flex-direction: column; text-align: center; gap: 8px; padding: 12px; }
  .highlight-icon { align-self: center; }
  
  /* Mobile theme toggle */
  .theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 60px;
    padding: 12px;
    border-radius: 50px;
  }
  
  .theme-toggle span:not(.theme-icon) {
    display: none;
  }
  
  .theme-icon {
    font-size: 20px;
  }
  
  /* Light theme mobile adjustments */
  :root[data-theme="light"] .nav-menu {
    background: rgba(248, 250, 252, 0.98);
  }
  
  :root[data-theme="light"] .nav-dropdown .dropdown-content {
    background: rgba(241, 245, 249, 0.9);
  }
}

/* AdSense Ad Slots */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 90px;
  position: relative;
}

.ad-placeholder {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  opacity: 0.7;
}

.ad-banner {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
}

.ad-sidebar {
  width: 100%;
  max-width: 300px;
  min-height: 250px;
}

.ad-mobile {
  width: 100%;
  max-width: 320px;
  min-height: 50px;
}

.ad-square {
  width: 100%;
  max-width: 300px;
  min-height: 300px;
}

/* Blog Styles */
.blog-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.blog-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.blog-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.blog-content {
    padding: 4rem 0;
}

.blog-content .container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1200px;
}

.blog-grid {
    display: grid;
    gap: 2rem;
}

.blog-card {
    background: var(--bg-elev);
    color: var(--text);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color .2s ease;
    border: 1px solid var(--border);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(124,92,255,0.4);
}

.blog-card h2,
.blog-card h3 {
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-weight: 700;
}

.blog-card h2 { font-size: 1.4rem; }
.blog-card h3 { font-size: 1.2rem; }

.blog-card h2 a,
.blog-card h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h2 a:hover,
.blog-card h3 a:hover {
    color: var(--accent);
}

.blog-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* Active nav state */
.nav-link.active { 
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  border-radius: 10px; 
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.4);
}
/* Light theme active nav state */
:root[data-theme="light"] .nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
}

/* Footer blog CTA spacing */
.footer-actions { margin-top: 12px; }
.blog-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.blog-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #0e1430;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card.featured .blog-image img {
    height: 100%;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.blog-content-area {
    padding: 1.5rem;
}

.blog-card h2,
.blog-card h3 {
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-card h2 a,
.blog-card h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h2 a:hover,
.blog-card h3 a:hover {
    color: var(--accent);
}

.blog-excerpt {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: var(--bg-elev);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.sidebar-widget h3 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: var(--accent);
}

.category-list span {
    background: var(--bg-elev);
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.popular-articles {
    list-style: none;
}

.popular-articles li {
    margin-bottom: 0.75rem;
}

.popular-articles a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.popular-articles a:hover {
    color: var(--accent);
}

.blog-ad {
    grid-column: 1 / -1;
    margin: 2rem 0;
}

/* Hide ads on very small screens */
@media (max-width: 480px) {
  .ad-banner,
  .ad-sidebar {
    display: none;
  }
}

@media (min-width: 481px) {
  .ad-mobile {
    display: none;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ad-banner,
    .ad-sidebar {
        display: none;
    }
    
    .ad-mobile {
        display: block;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-content .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-card.featured {
        grid-template-columns: 1fr;
    }
    
    .blog-card.featured .blog-image img {
        height: 200px;
    }
}

/* Accessibility: Focus styles */
.nav-link:focus-visible,
.btn:focus-visible,
.card-link:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Ensure all form inputs have adequate tap targets for mobile */
input,
select {
  min-height: 44px;
}

/* Enhanced Results Section Styles */
.results-header {
  text-align: center;
  margin-bottom: 24px;
}

.results-level {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.results-card {
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.results-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric {
  text-align: center;
  padding: 16px 12px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: background 0.2s ease;
}

.metric:hover {
  background: var(--bg-elev);
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  display: block;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.metric-detail {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.3;
}

.level-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-elev);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.summary-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.share-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.share-actions .btn {
  flex: 1;
  max-width: 160px;
  font-size: 14px;
  padding: 10px 16px;
}

.phase-timeline {
  margin: 16px 0;
}

.phase-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--card);
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}

.phase-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-right: 12px;
  flex-shrink: 0;
}

.phase-content {
  flex: 1;
}

.phase-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.phase-detail {
  font-size: 12px;
  color: var(--muted);
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
  .results-level {
    font-size: 28px;
  }
  
  .results-card {
    padding: 20px 16px;
    margin-bottom: 16px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .metric {
    padding: 12px 8px;
  }
  
  .metric-value {
    font-size: 18px;
  }
  
  .share-actions {
    flex-direction: column;
  }
  
  .share-actions .btn {
    max-width: none;
  }
  
  /* Enhanced mobile form spacing */
  .container {
    padding: 0 16px;
  }
  
  input,
  select {
    margin-bottom: 12px;
  }
  
  /* Improve form row spacing on mobile */
  .search-input {
    margin-bottom: 16px;
  }
  
  /* Add breathing room around calculator sections */
  .calculator-section {
    margin-bottom: 24px;
    padding: 16px;
  }
  }
}

@media (max-width: 480px) {
  .results-header {
    margin-bottom: 16px;
  }
  
  .results-level {
    font-size: 24px;
  }
  
  .results-card {
    padding: 16px 12px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .metric {
    padding: 10px 6px;
  }
  
  .metric-value {
    font-size: 16px;
  }
  
  .metric-label {
    font-size: 10px;
  }
  
  .summary-stats {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 12px;
  }
}

/* Blog Search Bar */
.blog-search { padding: 1rem 0; }
.blog-search .blog-search-bar { display: flex; gap: .5rem; }
.blog-search .search-input { flex: 1; padding: .75rem 1rem; border-radius: 8px; border: 1px solid var(--border-color, #2a2f3a); background: var(--surface-2, #0f1521); color: var(--text, #e6e9ef); }
.blog-search .search-input::placeholder { color: #9aa3b2; }
.blog-search .search-btn { padding: .75rem 1rem; border-radius: 8px; background: var(--primary, #4f46e5); color: #fff; border: none; cursor: pointer; }
.blog-search .search-btn:hover { background: #4338ca; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: .5rem; margin: 2rem 0; flex-wrap: wrap; }
.pagination button, .pagination a { padding: .5rem .85rem; border-radius: 8px; background: var(--surface-2, #0f1521); color: var(--text, #e6e9ef); border: 1px solid var(--border-color, #2a2f3a); cursor: pointer; }
.pagination .active { background: var(--primary, #4f46e5); color: #fff; border-color: transparent; }
.pagination .disabled { opacity: .6; pointer-events: none; }

@media (max-width: 640px){
  .blog-search .blog-search-bar { flex-direction: column; }
  .pagination { gap: .4rem; }
}

/* Article Detail Page Styles */
.article { padding: 40px 0 72px; }
.article-header { max-width: 960px; margin: 0 auto 18px; }
.article-header h1 { font-size: 2.6rem; line-height: 1.2; margin: 0 0 8px; }
.article-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.95rem; }
.article-hero { width: 100%; aspect-ratio: 16/9; display: block; border-radius: 16px; margin-top: 16px; border: 1px solid var(--border); background: #0e1430; object-fit: cover; }

/* Article content width and rhythm */
.article-body, .article section, .article > p, .article-footer { max-width: 840px; margin: 0 auto; }
.article section { margin: 28px auto; }
.article h2 { font-size: 1.9rem; margin: 28px 0 12px; line-height: 1.2; }
.article h3 { font-size: 1.15rem; margin: 16px 0 8px; color: var(--muted); }
.article p, .article li { line-height: 1.8; }
.article ul { padding-left: 1.2rem; }

/* Author box */
.article-author { max-width: 840px; margin: 24px auto; display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; }
.author-avatar { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); background: #0e1430; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.author-avatar img { width: 40px; height: 40px; object-fit: contain; }
.author-name { font-weight: 700; }
.author-role { color: var(--muted); font-size: 0.9rem; }

/* Related articles */
.related-articles { max-width: 1040px; margin: 48px auto 0; }
.related-articles h2 { font-size: 1.6rem; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.related-card:hover { transform: translateY(-2px); border-color: rgba(124,92,255,0.45); box-shadow: 0 16px 30px rgba(0,0,0,0.25); }
.related-card-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #0e1430; }
.related-card-title { margin: 8px 0 4px; font-size: 1.05rem; }
.related-card-meta { color: var(--muted); font-size: 0.9rem; }
.related-card a { color: var(--text); text-decoration: none; }
.related-card a:hover { color: var(--accent); }

/* Inline ad spacing for article */
.article .ad-container { max-width: 840px; margin-left: auto; margin-right: auto; }

/* Responsive tweaks */
@media (max-width: 980px) {
  .article-header h1 { font-size: 2.2rem; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .article { padding: 28px 0 56px; }
  .article-header { padding: 0 16px; }
  .article-header h1 { font-size: 1.9rem; }
  .article h2 { font-size: 1.5rem; }
  .related-grid { grid-template-columns: 1fr; }
}
/* Brand/Logo tweaks for navbar across blog and articles */
.nav-logo img,
.nav-brand img {
  height: 60px; /* increased logo size for better visibility */
  width: auto;
  display: block;
}

.nav-logo span,
.nav-brand span {
  color: #ffffff; /* make brand text white */
}

.nav-logo h1,
.nav-brand h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.nav-logo p,
.nav-brand p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.nav-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  max-width: 1200px;
}

.nav-grid {
  display: grid;
  gap: 2rem;
}

.nav-card {
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color .2s ease;
  border: 1px solid var(--border);
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: rgba(124,92,255,0.4);
}

.nav-card h2,
.nav-card h3 {
  margin-bottom: 0.75rem;
  line-height: 1.3;
  font-weight: 700;
}

.nav-card h2 { font-size: 1.4rem; }
.nav-card h3 { font-size: 1.2rem; }

.nav-card h2 a,
.nav-card h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-card h2 a:hover,
.nav-card h3 a:hover {
  color: var(--accent);
}

.nav-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.nav-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Active nav state */
.nav-link.active { background: rgba(124, 92, 255, 0.15); border-radius: 8px; }

/* Footer blog CTA spacing */
.footer-actions { margin-top: 12px; }
.blog-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.blog-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0e1430;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card.featured .blog-image img {
  height: 100%;
}

.blog-card:hover .blog-image img {
  transform: scale(1.05);
}

.blog-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.blog-content-area {
  padding: 1.5rem;
}

.blog-card h2,
.blog-card h3 {
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-card h2 a,
.blog-card h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-card h2 a:hover,
.blog-card h3 a:hover {
  color: var(--accent);
}

.blog-excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.blog-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background: var(--bg-elev);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sidebar-widget h3 {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.1rem;
}

.category-list {
  list-style: none;
}

.category-list li {
  margin-bottom: 0.5rem;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s ease;
}

.category-list a:hover {
  color: var(--accent);
}

.category-list span {
  background: var(--bg-elev);
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.popular-articles {
  list-style: none;
}

.popular-articles li {
  margin-bottom: 0.75rem;
}

.popular-articles a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.popular-articles a:hover {
  color: var(--accent);
}

.blog-ad {
  grid-column: 1 / -1;
  margin: 2rem 0;
}

/* Hide ads on very small screens */
@media (max-width: 480px) {
  .ad-banner,
  .ad-sidebar {
    display: none;
  }
}

@media (min-width: 481px) {
  .ad-mobile {
    display: none;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ad-banner,
    .ad-sidebar {
        display: none;
    }
    
    .ad-mobile {
        display: block;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-content .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-card.featured {
        grid-template-columns: 1fr;
    }
    
    .blog-card.featured .blog-image img {
        height: 200px;
    }
}

/* Accessibility: Focus styles */
.nav-link:focus-visible,
.btn:focus-visible,
.card-link:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Enhanced Results Section Styles */
.results-header {
  text-align: center;
  margin-bottom: 24px;
}

.results-level {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.results-card {
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.results-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric {
  text-align: center;
  padding: 16px 12px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: background 0.2s ease;
}

.metric:hover {
  background: var(--bg-elev);
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  display: block;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.metric-detail {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.3;
}

.level-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-elev);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.summary-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.share-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.share-actions .btn {
  flex: 1;
  max-width: 160px;
  font-size: 14px;
  padding: 10px 16px;
}

.phase-timeline {
  margin: 16px 0;
}

.phase-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--card);
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}

.phase-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-right: 12px;
  flex-shrink: 0;
}

.phase-content {
  flex: 1;
}

.phase-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.phase-detail {
  font-size: 12px;
  color: var(--muted);
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
  .results-level {
    font-size: 28px;
  }
  
  .results-card {
    padding: 20px 16px;
    margin-bottom: 16px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .metric {
    padding: 12px 8px;
  }
  
  .metric-value {
    font-size: 18px;
  }
  
  .share-actions {
    flex-direction: column;
  }
  
  .share-actions .btn {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .results-header {
    margin-bottom: 16px;
  }
  
  .results-level {
    font-size: 24px;
  }
  
  .results-card {
    padding: 16px 12px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .metric {
    padding: 10px 6px;
  }
  
  .metric-value {
    font-size: 16px;
  }
  
  .metric-label {
    font-size: 10px;
  }
  
  .summary-stats {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 12px;
  }
}

/* Blog Search Bar */
.blog-search { padding: 1rem 0; }
.blog-search .blog-search-bar { display: flex; gap: .5rem; }
.blog-search .search-input { flex: 1; padding: .75rem 1rem; border-radius: 8px; border: 1px solid var(--border-color, #2a2f3a); background: var(--surface-2, #0f1521); color: var(--text, #e6e9ef); }
.blog-search .search-input::placeholder { color: #9aa3b2; }
.blog-search .search-btn { padding: .75rem 1rem; border-radius: 8px; background: var(--primary, #4f46e5); color: #fff; border: none; cursor: pointer; }
.blog-search .search-btn:hover { background: #4338ca; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: .5rem; margin: 2rem 0; flex-wrap: wrap; }
.pagination button, .pagination a { padding: .5rem .85rem; border-radius: 8px; background: var(--surface-2, #0f1521); color: var(--text, #e6e9ef); border: 1px solid var(--border-color, #2a2f3a); cursor: pointer; }
.pagination .active { background: var(--primary, #4f46e5); color: #fff; border-color: transparent; }
.pagination .disabled { opacity: .6; pointer-events: none; }

@media (max-width: 640px){
  .blog-search .blog-search-bar { flex-direction: column; }
  .pagination { gap: .4rem; }
}

/* Article Detail Page Styles */
.article { padding: 40px 0 72px; }
.article-header { max-width: 960px; margin: 0 auto 18px; }
.article-header h1 { font-size: 2.6rem; line-height: 1.2; margin: 0 0 8px; }
.article-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.95rem; }
.article-hero { width: 100%; aspect-ratio: 16/9; display: block; border-radius: 16px; margin-top: 16px; border: 1px solid var(--border); background: #0e1430; object-fit: cover; }

/* Article content width and rhythm */
.article-body, .article section, .article > p, .article-footer { max-width: 840px; margin: 0 auto; }
.article section { margin: 28px auto; }
.article h2 { font-size: 1.9rem; margin: 28px 0 12px; line-height: 1.2; }
.article h3 { font-size: 1.15rem; margin: 16px 0 8px; color: var(--muted); }
.article p, .article li { line-height: 1.8; }
.article ul { padding-left: 1.2rem; }

/* Author box */
.article-author { max-width: 840px; margin: 24px auto; display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; }
.author-avatar { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); background: #0e1430; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.author-avatar img { width: 40px; height: 40px; object-fit: contain; }
.author-name { font-weight: 700; }
.author-role { color: var(--muted); font-size: 0.9rem; }

/* Related articles */
.related-articles { max-width: 1040px; margin: 48px auto 0; }
.related-articles h2 { font-size: 1.6rem; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.related-card:hover { transform: translateY(-2px); border-color: rgba(124,92,255,0.45); box-shadow: 0 16px 30px rgba(0,0,0,0.25); }
.related-card-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #0e1430; }
.related-card-title { margin: 8px 0 4px; font-size: 1.05rem; }
.related-card-meta { color: var(--muted); font-size: 0.9rem; }
.related-card a { color: var(--text); text-decoration: none; }
.related-card a:hover { color: var(--accent); }

/* Inline ad spacing for article */
.article .ad-container { max-width: 840px; margin-left: auto; margin-right: auto; }

/* Responsive tweaks */
@media (max-width: 980px) {
  .article-header h1 { font-size: 2.2rem; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .article { padding: 28px 0 56px; }
  .article-header { padding: 0 16px; }
  .article-header h1 { font-size: 1.9rem; }
  .article h2 { font-size: 1.5rem; }
  .related-grid { grid-template-columns: 1fr; }
}