/* ==========================================================================
   Chargino Blog - Master Stylesheet
   Matches Chargino (chargino.io) Design System
   ========================================================================== */

:root {
  --font-sans: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* Light Theme Palette */
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  
  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  
  --primary-blue: #2563EB;
  --primary-indigo: #4F46E5;
  --primary-cyan: #06B6D4;
  --primary-emerald: #10B981;
  --primary-purple: #8B5CF6;
  --primary-amber: #F59E0B;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"], body.dark {
  --bg-page: #070525;
  --bg-surface: #0E0B38;
  --bg-subtle: #16124A;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-glass: rgba(7, 5, 37, 0.88);
  
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  
  --border-light: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 35px rgba(6, 182, 212, 0.2);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

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

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

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

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  user-select: none;
}

/* Announcement Top Bar */
.top-announcement {
  background-color: #070525;
  color: #CBD5E1;
  font-size: 12px;
  position: relative;
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-announcement-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 140% at 85% 0%, rgba(59, 130, 246, 0.3), transparent 60%),
              radial-gradient(50% 140% at 10% 100%, rgba(168, 85, 247, 0.25), transparent 60%);
}

.top-announcement .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.announcement-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-weight: 700;
  color: #FCD34D;
  font-size: 11px;
  flex-shrink: 0;
}

.announcement-marquee {
  flex: 1;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.announcement-marquee-content {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  animation: marquee-anim 35s linear infinite;
}

@keyframes marquee-anim {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

.marquee-item {
  color: #E2E8F0;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.marquee-item:hover {
  color: #60A5FA;
}

.marquee-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #38BDF8;
  display: inline-block;
}

.announcement-contact {
  display: none;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .announcement-contact { display: flex; }
}

.announcement-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #F8FAFC;
  font-weight: 700;
  font-size: 12px;
}

.announcement-contact a:hover {
  color: #38BDF8;
}

/* Main Nav Bar */
.main-navbar {
  background-color: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s ease;
  position: relative;
}

.main-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1rem;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.brand-logo-light {
  display: block;
}
.brand-logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-light, body.dark .brand-logo-light {
  display: none;
}
[data-theme="dark"] .brand-logo-dark, body.dark .brand-logo-dark {
  display: block;
}

/* Nav Links */
.header-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-right: 1.5rem;
  flex: 1;
}

@media (min-width: 1024px) {
  .header-nav { display: flex; }
}

.nav-link {
  position: relative;
  padding: 0.55rem 0.85rem;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

[data-theme="dark"] .nav-link:hover, body.dark .nav-link:hover {
  color: var(--primary-cyan);
  background-color: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--primary-blue);
}

[data-theme="dark"] .nav-link.active, body.dark .nav-link.active {
  color: var(--primary-cyan);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 12px;
  left: 12px;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(to left, var(--primary-blue), var(--primary-cyan));
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 18px;
}

.btn-icon:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .btn-icon, body.dark .btn-icon {
  background-color: rgba(255, 255, 255, 0.04);
}

.btn-auth-login {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .btn-auth-login { display: inline-flex; }
}

.btn-auth-login:hover {
  background-color: var(--bg-subtle);
}

.btn-auth-register {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #2563EB, #4F46E5, #7C3AED);
  box-shadow: 0 6px 20px -4px rgba(79, 70, 229, 0.5);
  transition: all 0.25s ease;
}

@media (min-width: 640px) {
  .btn-auth-register { display: inline-flex; }
}

.btn-auth-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -4px rgba(79, 70, 229, 0.7);
}

.mobile-menu-trigger {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: #0F172A;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .mobile-menu-trigger, body.dark .mobile-menu-trigger {
  background-color: #FFFFFF;
  color: #0F172A;
}

@media (min-width: 1024px) {
  .mobile-menu-trigger { display: none; }
}

/* Hairline gradient under header */
.header-hairline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3B82F6, #06B6D4, #8B5CF6, #3B82F6);
  background-size: 300% 100%;
  animation: hairline-anim 8s ease infinite;
}

@keyframes hairline-anim {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.blog-hero {
  position: relative;
  padding: 3.5rem 0 2.5rem;
  background: radial-gradient(70% 80% at 50% 0%, rgba(37, 99, 235, 0.12), transparent 70%);
  text-align: center;
  overflow: hidden;
}

[data-theme="dark"] .blog-hero, body.dark .blog-hero {
  background: radial-gradient(70% 80% at 50% 0%, rgba(56, 189, 248, 0.15), transparent 70%);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 1rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .hero-pill, body.dark .hero-pill {
  background: rgba(6, 182, 212, 0.12);
  color: var(--primary-cyan);
  border-color: rgba(6, 182, 212, 0.25);
}

.hero-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .hero-title { font-size: 2.75rem; }
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-indigo), var(--primary-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

@media (min-width: 640px) {
  .hero-subtitle { font-size: 1.125rem; }
}

/* Hero Search Bar */
.hero-search-wrapper {
  max-width: 580px;
  margin: 0 auto 2.25rem;
}

.hero-search-form {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.25s ease;
}

.hero-search-form:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), var(--shadow-xl);
}

[data-theme="dark"] .hero-search-form, body.dark .hero-search-form {
  background-color: rgba(255, 255, 255, 0.05);
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.hero-search-btn {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-indigo));
  color: #FFFFFF;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.2s ease;
}

.hero-search-btn:hover {
  transform: scale(1.02);
}

/* Category Filter Chips */
.category-filter-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

[data-theme="dark"] .filter-chip, body.dark .filter-chip {
  background-color: rgba(255, 255, 255, 0.04);
}

.filter-chip:hover, .filter-chip.active {
  background-color: var(--primary-blue);
  color: #FFFFFF;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   Blog Posts Grid & Cards
   ========================================================================== */
.posts-section {
  padding: 2.5rem 0 5rem;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--primary-blue), var(--primary-cyan));
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Post Card */
.post-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

[data-theme="dark"] .post-card, body.dark .post-card {
  background-color: rgba(255, 255, 255, 0.03);
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: rgba(37, 99, 235, 0.35);
}

.card-thumbnail-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .card-thumbnail {
  transform: scale(1.06);
}

.card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.card-meta-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.post-card:hover .card-title {
  color: var(--primary-blue);
}

[data-theme="dark"] .post-card:hover .card-title, body.dark .post-card:hover .card-title {
  color: var(--primary-cyan);
}

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

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

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

.author-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-blue);
  transition: gap 0.2s ease;
}

[data-theme="dark"] .card-read-more, body.dark .card-read-more {
  color: var(--primary-cyan);
}

.post-card:hover .card-read-more {
  gap: 0.5rem;
}

/* ==========================================================================
   Single Post Layout
   ========================================================================== */
.single-post-wrapper {
  padding: 2rem 0 6rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.breadcrumbs a {
  transition: color 0.2s ease;
}

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

.breadcrumbs .sep {
  opacity: 0.5;
}

.single-header {
  margin-bottom: 2rem;
}

.single-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 1rem 0;
  letter-spacing: -0.015em;
}

@media (min-width: 768px) {
  .single-title { font-size: 2.5rem; }
}

.single-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 13px;
}

.single-featured-image {
  margin: 2rem 0 2.5rem;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 21 / 10;
  background-color: var(--bg-subtle);
}

.single-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .single-layout {
    grid-template-columns: 8fr 4fr;
  }
}

/* Article Prose Typography */
.article-content {
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--text-secondary);
}

.article-content p {
  margin-bottom: 1.75rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  position: relative;
}

.article-content h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 60px;
  height: 2px;
  background: var(--primary-blue);
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 2.25rem 0 1rem;
}

.article-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
}

.article-content ul, .article-content ol {
  margin: 1.25rem 0 1.75rem;
  padding-right: 1.5rem;
}

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

.article-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.75rem;
  border-right: 4px solid var(--primary-blue);
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-style: italic;
  color: var(--text-primary);
}

.article-content img {
  border-radius: var(--radius-xl);
  margin: 2rem auto;
  box-shadow: var(--shadow-md);
}

.article-content code {
  background-color: var(--bg-subtle);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.9em;
  color: var(--primary-indigo);
}

.article-content pre {
  background-color: #0F172A;
  color: #F8FAFC;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 2rem 0;
  direction: ltr;
  text-align: left;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 14px;
}

.article-content th, .article-content td {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-light);
  text-align: right;
}

.article-content th {
  background-color: var(--bg-subtle);
  font-weight: 800;
  color: var(--text-primary);
}

/* Sidebar & Sticky Table of Contents */
.single-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-sticky-box {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .sidebar-card, body.dark .sidebar-card {
  background-color: rgba(255, 255, 255, 0.035);
}

.sidebar-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 13px;
  max-height: 380px;
  overflow-y: auto;
}

.toc-link {
  color: var(--text-muted);
  display: block;
  transition: all 0.2s ease;
  padding-right: 0.5rem;
  border-right: 2px solid transparent;
}

.toc-link:hover, .toc-link.active {
  color: var(--primary-blue);
  border-right-color: var(--primary-blue);
  font-weight: 700;
}

[data-theme="dark"] .toc-link:hover, body.dark .toc-link:hover {
  color: var(--primary-cyan);
  border-right-color: var(--primary-cyan);
}

/* Social Share Bar */
.social-share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 16px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.share-btn.tg { background-color: #229ED9; }
.share-btn.wa { background-color: #25D366; }
.share-btn.tw { background-color: #000000; }
.share-btn.copy { background-color: #475569; }

/* Promo Box in Sidebar */
.sidebar-promo-banner {
  background: linear-gradient(135deg, #070525, #1E1B4B);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.promo-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #FCD34D;
  font-size: 10.5px;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.promo-title {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.promo-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(to right, #06B6D4, #3B82F6);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
  transition: transform 0.2s ease;
}

.promo-btn:hover {
  transform: scale(1.02);
}

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

.comment-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.comment-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .comment-item, body.dark .comment-item {
  background-color: rgba(255, 255, 255, 0.03);
}

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

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

.comment-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* Comment Form */
.comment-respond {
  margin-top: 2.5rem;
}

.comment-form-group {
  margin-bottom: 1.25rem;
}

.comment-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.comment-form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.comment-form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .comment-form-control, body.dark .comment-form-control {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: #0F172A;
  color: #FFFFFF;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .site-footer, body.dark .site-footer {
  background-color: #05031E;
}

.footer-top-gradient {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #2563EB, #06B6D4, #4F46E5);
}

.footer-main {
  padding: 4rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.25fr; }
}

.footer-brand p {
  color: #94A3B8;
  font-size: 13px;
  line-height: 1.8;
  margin: 1rem 0 1.25rem;
  max-width: 360px;
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.footer-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-badge-pill.green { color: #34D399; }
.footer-badge-pill.cyan { color: #38BDF8; }

.footer-social-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.footer-social-btn:hover {
  background-color: var(--primary-blue);
  color: #FFFFFF;
}

.footer-col-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
}

.footer-menu {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 13px;
}

.footer-menu a {
  color: #94A3B8;
  transition: color 0.2s ease;
}

.footer-menu a:hover {
  color: #38BDF8;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 12px;
  color: #64748B;
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; }
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
}

.pagination-wrapper .page-numbers {
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pagination-wrapper .page-numbers.current {
  background-color: var(--primary-blue);
  color: #FFFFFF;
  border-color: var(--primary-blue);
}

.pagination-wrapper .page-numbers:hover:not(.current) {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* ==========================================================================
   Mobile Drawer & Search Modal
   ========================================================================== */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  background-color: var(--bg-surface);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
}

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

.search-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-modal-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 600px;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}

.search-modal.active .search-modal-box {
  transform: translateY(0);
}

/* Toast notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 300;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Spider-Web SEO & Contextual Cross-Linking Styles
   ========================================================================== */
.chargino-cross-link {
  color: var(--primary-blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.4);
  text-underline-offset: 4px;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 0 2px;
}

.chargino-cross-link:hover {
  color: #FFFFFF !important;
  background-color: var(--primary-blue);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] .chargino-cross-link {
  color: var(--primary-cyan);
  text-decoration-color: rgba(6, 182, 212, 0.4);
}

[data-theme="dark"] .chargino-cross-link:hover {
  color: #070525 !important;
  background-color: var(--primary-cyan);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

.spider-cross-box {
  margin: 3.5rem 0 2.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(79, 70, 229, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .spider-cross-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.08));
  border-color: rgba(6, 182, 212, 0.25);
}

.spider-cross-header {
  margin-bottom: 1.5rem;
}

.spider-cross-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary-blue);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  border-radius: 9999px;
  margin-bottom: 0.65rem;
}

[data-theme="dark"] .spider-cross-badge {
  background-color: var(--primary-cyan);
  color: #070525;
}

.spider-cross-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.spider-cross-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.spider-cross-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .spider-cross-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.spider-item-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
}

.spider-item-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-blue);
  box-shadow: 0 8px 24px -6px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .spider-item-card {
  background-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .spider-item-card:hover {
  border-color: var(--primary-cyan);
  box-shadow: 0 8px 24px -6px rgba(6, 182, 212, 0.3);
}

.spider-item-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .spider-item-icon {
  background: rgba(255, 255, 255, 0.08);
}

.spider-item-text {
  flex: 1;
  min-width: 0;
}

.spider-item-title {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  transition: color 0.2s ease;
}

.spider-item-card:hover .spider-item-title {
  color: var(--primary-blue);
}

[data-theme="dark"] .spider-item-card:hover .spider-item-title {
  color: var(--primary-cyan);
}

.spider-item-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spider-item-arrow {
  color: var(--text-muted);
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.spider-item-card:hover .spider-item-arrow {
  transform: translateX(-4px);
  color: var(--primary-blue);
}

