/* ==========================================================================
   xube.me - Modern Tech & AI Blog Stylesheet
   Design System: Cyber-Clean Dark (Default) & Crisp Modern Light
   ========================================================================== */

:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0d14;
  --bg-secondary: #101522;
  --bg-card: rgba(19, 25, 39, 0.75);
  --bg-card-hover: rgba(27, 35, 54, 0.85);
  --bg-glass: rgba(16, 21, 34, 0.8);
  --bg-input: #151b2b;
  --bg-code: #0d111a;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  --border-glow: rgba(56, 189, 248, 0.25);
  
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #06b6d4 100%);
  --gradient-card-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15), transparent 70%);
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.05) 60%, transparent 100%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-input: #f1f5f9;
  --bg-code: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(99, 102, 241, 0.5);
  --border-glow: rgba(99, 102, 241, 0.2);
  
  --gradient-card-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08), transparent 70%);
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.04) 60%, transparent 100%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

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

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

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 860px;
}

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

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.logo-badge {
  width: 38px;
  height: 38px;
  background: var(--gradient-accent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  font-size: 1.1rem;
}

.logo-text {
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .logo-text {
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  padding: 0.4rem 0;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff !important;
  background: var(--gradient-accent);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-smooth);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

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

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

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 4.5rem 0 3rem;
  background-image: var(--gradient-hero);
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
}

.hero-pill-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* ==========================================================================
   Search & Filter Bar
   ========================================================================== */
.controls-wrapper {
  margin-bottom: 2.5rem;
}

.search-box {
  position: relative;
  max-width: 580px;
  margin: 0 auto 1.75rem;
}

.search-input {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.98rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-secondary);
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.15rem;
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  pointer-events: none;
}

.categories-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.category-pill {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.category-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.category-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Featured Article Card
   ========================================================================== */
.featured-wrapper {
  margin-bottom: 3.5rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-smooth);
  position: relative;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card-glow);
  pointer-events: none;
}

.featured-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

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

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.featured-badge-tag {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  padding: 0.35rem 0.85rem;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

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

.article-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}

.featured-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.author-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

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

.author-info-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.article-read-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Articles Grid
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  position: relative;
}

.article-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-4px);
}

.card-image-box {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

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

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.card-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  border-radius: 4px;
  font-weight: 600;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

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

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   Newsletter Section
   ========================================================================== */
.newsletter-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%), var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2.5rem;
  text-align: center;
  margin-bottom: 5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.newsletter-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.newsletter-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}

.newsletter-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.newsletter-input:focus {
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Article Detail Page
   ========================================================================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-accent);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

.article-header {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.article-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-detail-title {
  font-family: var(--font-heading);
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.article-detail-lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 750px;
  margin: 0 auto 2rem;
}

.article-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.article-cover-wrapper {
  margin: 2rem 0 3rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.article-cover-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* Article Body Content */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3.5rem;
  margin-bottom: 4rem;
  align-items: start;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.75rem;
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content strong {
  color: var(--text-primary);
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-input);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
}

.article-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.article-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  font-size: 0.98rem;
  border-left: 4px solid;
}

.callout-info {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-primary);
  color: var(--text-secondary);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--accent-amber);
  color: var(--text-secondary);
}

/* Sidebar & TOC */
.sidebar-sticky {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.toc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toc-link {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  transition: all var(--transition-fast);
  display: block;
}

.toc-link:hover, .toc-link.active {
  color: var(--accent-primary);
  transform: translateX(4px);
}

/* Floating / Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 3rem 0;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action:hover, .btn-action.active {
  color: var(--accent-rose);
  border-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
}

/* Comments Section */
.comments-section {
  padding-top: 3rem;
  border-top: 1px solid var(--border-color);
  margin-bottom: 4rem;
}

.comments-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.comment-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 1rem;
  outline: none;
}

.comment-textarea:focus {
  border-color: var(--accent-primary);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.comment-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   About Page Styles
   ========================================================================== */
.about-hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.about-card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 0.85rem;
  max-width: 320px;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-link:hover {
  color: var(--accent-primary);
}

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

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 0.85rem 1.35rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Social Media Connectors & Monetization Suite
   ========================================================================== */
.social-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.social-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-smooth);
}

.social-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.social-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
}

.social-info {
  flex-grow: 1;
}

.social-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.social-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.social-followers {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Monetization Cards */
.monetize-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-smooth);
}

.monetize-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-4px);
}

.monetize-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.monetize-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* Affiliate Deal Cards */
.affiliate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

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

.deal-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

/* In-Article Sponsor / Affiliate Callout */
.article-sponsor-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%), var(--bg-secondary);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Viral Social Share Ribbon on Article */
.social-share-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.share-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.share-pill-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-share-twitter { background: #000000; border: 1px solid rgba(255,255,255,0.2); }
.btn-share-linkedin { background: #0A66C2; }
.btn-share-facebook { background: #1877F2; }
.btn-share-whatsapp { background: #25D366; }
.btn-share-telegram { background: #229ED9; }
.btn-share-reddit { background: #FF4500; }

/* Modal & Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 2.25rem;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   1,000+ Topic Matrix Explorer Styling
   ========================================================================== */
.matrix-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 900px;
  margin: 2rem auto 0;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  text-align: left;
}

.matrix-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.matrix-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.matrix-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.matrix-select:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-content {
    padding: 0 1.5rem 1.5rem;
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-sticky {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.25rem;
  }
  .article-detail-title {
    font-size: 2.1rem;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-input {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .article-sponsor-box {
    flex-direction: column;
    text-align: center;
  }
}



/* ==========================================================================
   Modern Enhancements: Mobile Navigation, Command Palette, TOC & Code UX
   ========================================================================== */

/* Utility Visibility Classes */
.mobile-only {
  display: none !important;
}
.desktop-only {
  display: inline-flex !important;
}

/* Mobile Drawer Menu */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 4000;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer.active {
  transform: translateX(-320px);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-list {
  list-style: none;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 3900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Command Palette / Spotlight Search (Cmd+K / Ctrl+K / /) */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.cmd-palette-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-20px) scale(0.97);
  transition: all var(--transition-smooth);
  overflow: hidden;
}

.cmd-palette-backdrop.active .cmd-palette {
  transform: translateY(0) scale(1);
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-input);
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
}

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

.cmd-shortcut-hint {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
}

.cmd-results {
  overflow-y: auto;
  max-height: 55vh;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cmd-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.cmd-result-item:hover, .cmd-result-item.selected {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.cmd-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cmd-result-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-cyan);
  font-weight: 700;
}

.cmd-result-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Enhanced Code Blocks & Language Badges */
.code-container {
  position: relative;
  margin: 1.75rem 0;
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
}

.code-lang-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.article-content pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  background: transparent;
  border: none;
}

/* Syntax Highlighting Colors */
.syn-keyword { color: #f43f5e; font-weight: 600; }
.syn-string { color: #10b981; }
.syn-comment { color: #64748b; font-style: italic; }
.syn-number { color: #f59e0b; }
.syn-function { color: #38bdf8; }
.syn-variable { color: #a855f7; }
.syn-operator { color: #94a3b8; }
.syn-command { color: #6366f1; font-weight: 600; }

/* Sticky Table of Contents & Scrollspy */
.toc-card {
  position: sticky;
  top: 92px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: block;
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--accent-cyan);
  font-weight: 600;
  border-left-color: var(--accent-cyan);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.08), transparent);
}

/* Mobile Collapsible TOC Accordion */
.mobile-toc-accordion {
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mobile-toc-summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--accent-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.mobile-toc-summary::-webkit-details-marker {
  display: none;
}

.mobile-toc-content {
  padding: 0 1.25rem 1.25rem;
}

/* Previous / Next Article Navigation */
.article-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.pagination-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-smooth);
}

.pagination-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination-card.next {
  text-align: right;
  align-items: flex-end;
}

.pagination-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.pagination-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Floating Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-smooth);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

/* Responsive Table Wrapper */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.article-content th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.article-content td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.article-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

/* Image Aspect Ratio & Anti-CLS */
.card-image-box, .featured-image-box, .article-cover-wrapper {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-input);
}

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

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

/* Horizontal Swiping for Category Pills */
.categories-bar {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.categories-bar::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Fine-Tuned Mobile Breakpoints (<768px and <480px)
   ========================================================================== */
@media (max-width: 768px) {
  .nav-desktop {
    display: none !important;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: grid !important;
  }

  .nav-wrapper {
    height: 64px;
  }

  .container {
    padding: 0 1rem;
  }

  .hero-section {
    padding: 2.5rem 0 1.5rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 0.98rem;
  }

  .search-box {
    margin: 1.25rem 0 0;
  }

  .article-header {
    margin-bottom: 1.5rem;
  }

  .article-detail-title {
    font-size: clamp(1.6rem, 5.5vw, 2.2rem);
    line-height: 1.3;
  }

  .article-detail-lead {
    font-size: 1.05rem;
  }

  .article-header-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .article-pagination {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pagination-card.next {
    text-align: left;
    align-items: flex-start;
  }

  .social-share-row {
    justify-content: center;
  }

  #back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 1.25rem;
  }
  .logo-badge {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .card-content {
    padding: 1.15rem;
  }
  .card-title {
    font-size: 1.1rem;
  }
  .card-excerpt {
    font-size: 0.88rem;
  }
  .callout {
    padding: 1rem;
    font-size: 0.9rem;
  }
}


/* ==========================================================================
   BULLETPROOF MOBILE VIEW & ANTI-OVERFLOW FIXES
   ========================================================================== */

/* 1. Global Box Sizing & Min-Width Reset (Prevents CSS Grid/Flex Blowout) */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

/* 2. Containers and Layout Width Bounds */
.container,
.container-narrow,
main,
article,
section,
header,
footer,
.nav-wrapper,
.article-header,
.article-layout,
.article-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 880px;
  margin: 0 auto;
}

/* 3. Universal Text Wrap & Word Break Protection */
h1, h2, h3, h4, h5, h6,
p, li, a, span, label,
.hero-title,
.hero-subtitle,
.article-detail-title,
.article-detail-lead,
.card-title,
.card-excerpt,
.featured-title,
.featured-excerpt,
.pagination-title,
.toc-link,
.callout,
.author-info-name,
.author-info-role {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100%;
}

/* 4. Inline Code vs Block Code Handling */
.article-content code:not(pre code),
code:not(pre code) {
  display: inline;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  max-width: 100%;
  padding: 0.15em 0.35em;
  font-size: 0.88em;
  border-radius: 4px;
}

/* 5. Code Containers & Pre Blocks (Enforce Horizontal Scrolling) */
.code-container {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin: 1.5rem 0 !important;
  overflow: hidden !important;
}

.code-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.5rem 0.85rem !important;
}

.article-content pre,
pre {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 0 !important;
  padding: 1rem !important;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.article-content pre code,
pre code {
  display: inline-block !important;
  min-width: 100% !important;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* 6. Tables (Responsive Scroll Wrapper) */
.table-wrapper {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 1.5rem 0 !important;
  box-sizing: border-box !important;
}

table {
  max-width: 100%;
  border-collapse: collapse;
}

/* 7. Callouts, Lists & Blockquotes */
.callout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1.15rem 1.25rem;
  margin: 1.5rem 0;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0 1.5rem 1.25rem;
  padding-left: 0.5rem;
  max-width: 100%;
}

/* 8. Article Page Header & Breadcrumbs on Mobile */
.article-header {
  padding: 2.5rem 0 1.5rem;
  text-align: left;
}

.article-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.article-detail-title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.article-detail-lead {
  font-size: clamp(0.98rem, 3vw, 1.15rem);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.article-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.author-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

/* 9. Article Layout Grid Collapse on Screens < 992px */
@media (max-width: 992px) {
  .article-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .sidebar-sticky {
    display: none !important;
  }

  .featured-card {
    display: flex !important;
    flex-direction: column !important;
  }

  .featured-content {
    padding: 1.25rem !important;
  }
}

/* 10. Mobile Phone Fine Tuning (< 768px & < 480px) */
@media (max-width: 768px) {
  .container, .container-narrow {
    padding: 0 1rem !important;
    max-width: 100% !important;
  }

  .hero-section {
    padding: 2rem 0 1.25rem !important;
  }

  .hero-title {
    font-size: clamp(1.6rem, 6vw, 2.25rem) !important;
    line-height: 1.25 !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
  }

  .articles-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .article-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  .card-content {
    padding: 1.25rem !important;
  }

  .article-pagination {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .pagination-card {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .pagination-card.next {
    text-align: left !important;
    align-items: flex-start !important;
  }

  .social-share-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .share-pill-btn {
    justify-content: center !important;
    width: 100% !important;
    padding: 0.6rem 1rem !important;
  }
}

@media (max-width: 480px) {
  .container, .container-narrow {
    padding: 0 0.85rem !important;
  }

  .logo-text {
    font-size: 1.2rem !important;
  }

  .logo-badge {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
  }

  .card-content {
    padding: 1rem !important;
  }

  .card-title {
    font-size: 1.05rem !important;
  }

  .card-excerpt {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }

  .article-content {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  .article-content h2 {
    font-size: 1.35rem !important;
    margin: 1.75rem 0 0.75rem !important;
  }

  .article-content h3 {
    font-size: 1.15rem !important;
    margin: 1.5rem 0 0.5rem !important;
  }

  .callout {
    padding: 0.9rem !important;
    font-size: 0.88rem !important;
  }

  .article-content pre {
    padding: 0.85rem !important;
    font-size: 0.82rem !important;
  }
}
