/* ── Blog styles — extends styles.css ── */
@import url('prism.css');
@import url('ide.css');

/* Page Background & Global Typography (VS Code Light Theme Web Page) */
body {
  background-color: #ffffff; /* Pure white background */
  background-image: none;
  color: #242424; /* Soft dark charcoal text */
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Blog index page */
.blog-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid #e5e5e5;
}

.blog-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0066b8; /* VS Code light theme link blue */
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 24px;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.blog-hero__back:hover {
  opacity: 1;
  text-decoration: underline;
}

.blog-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #242424;
  margin: 0 0 12px;
}

.blog-hero__sub {
  font-size: 16px;
  color: #555555;
  margin: 0;
  max-width: 480px;
}

.blog-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 40px 0 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 48px 0 80px;
}

/* VS Code styled cards */
.blog-card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: #242424;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border-color: #0066b8;
}

.blog-card__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
  width: fit-content;
}
.blog-card__tag--sc {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}
.blog-card__tag--io {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.blog-card__tag--qr {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
}
.blog-card__tag--cq {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.12);
}
.blog-card__tag--rmbg {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
}
.blog-card__tag--c {
  color: #0066b8;
  background: rgba(0, 102, 184, 0.08);
}
.blog-card__tag--cpp {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.blog-card__tag--js {
  color: #ca8a04;
  background: rgba(202, 138, 4, 0.08);
}
.blog-card__tag--bash {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}
.blog-card__tag--canvas {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
}
.blog-card__tag--webgl {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}
.blog-card__tag--wasm {
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}
.blog-card__tag--webgpu {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}
.blog-card__tag--algo {
  color: #d946ef;
  background: rgba(217, 70, 239, 0.08);
}
.blog-card__tag--rtc {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}
.blog-card__tag--toyjs {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
.blog-card__tag--css {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.08);
}
.blog-card__tag--sql {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.blog-card__tag--audio {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}
.blog-card__tag--git {
  color: #64748b;
  background: rgba(100, 116, 139, 0.08);
}
.blog-card__tag--electronics {
  color: #d8a657;
  background: rgba(216, 166, 87, 0.08);
}

.blog-card__tag--vlsi {
  color: #84cc16;
  background: rgba(132, 204, 22, 0.08);
}

.blog-card__tag--ai {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.blog-card__tag--embedded {
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.08);
}

.blog-card__tag--dsp {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
}

.blog-card__tag--cpu {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}

.blog-card__tag--aie {
  color: #eab308;
  background: rgba(234, 179, 8, 0.08);
}

.blog-card__tag--repair {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
}

.blog-card__tag--aisys {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.blog-card__tag--vdb {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
}

.blog-card__title {
  font-size: 17px;
  font-weight: 600;
  color: #242424;
  line-height: 1.4;
  margin: 0;
}

.blog-card__excerpt {
  font-size: 14px;
  color: #555555;
  line-height: 1.65;
  flex: 1;
  margin: 0;
}

.blog-card__meta {
  font-size: 12px;
  color: #777777;
  display: flex;
  gap: 12px;
}

.blog-card__read-more {
  font-size: 13px;
  color: #0066b8;
  font-weight: 600;
}

/* ── Article page ── */
.article-hero {
  padding: 56px 0 0;
  background: linear-gradient(180deg, rgba(0, 102, 184, 0.03) 0%, transparent 100%);
}
.article-hero--cpp {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, transparent 100%);
}

.article-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0066b8;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 28px;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.article-hero__back:hover {
  opacity: 1;
  text-decoration: underline;
}

.article-hero__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
  width: fit-content;
  margin-bottom: 16px;
}
.article-hero__tag--sc {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}
.article-hero__tag--io {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.article-hero__tag--qr {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
}
.article-hero__tag--cq {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.12);
}
.article-hero__tag--rmbg {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
}
.article-hero__tag--c {
  color: #0066b8;
  background: rgba(0, 102, 184, 0.08);
}
.article-hero__tag--cpp {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.article-hero__tag--js {
  color: #ca8a04;
  background: rgba(202, 138, 4, 0.08);
}
.article-hero__tag--bash {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}
.article-hero--bash {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.04) 0%, transparent 100%);
}
.article-hero__tag--canvas {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
}
.article-hero--canvas {
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.04) 0%, transparent 100%);
}
.article-hero__tag--webgl {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}
.article-hero--webgl {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.04) 0%, transparent 100%);
}
.article-hero__tag--css {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.08);
}
.article-hero--css {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.04) 0%, transparent 100%);
}
.article-hero__tag--webgpu {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}
.article-hero--webgpu {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
}
.article-hero__tag--algo {
  color: #d946ef;
  background: rgba(217, 70, 239, 0.08);
}
.article-hero--algo {
  background: linear-gradient(180deg, rgba(217, 70, 239, 0.04) 0%, transparent 100%);
}
.article-hero__tag--git {
  color: #64748b;
  background: rgba(100, 116, 139, 0.08);
}
.article-hero--git {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.04) 0%, transparent 100%);
}
.article-hero__tag--audio {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}
.article-hero--audio {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.04) 0%, transparent 100%);
}
.article-hero__tag--sql {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.article-hero--sql {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, transparent 100%);
}
.article-hero__tag--electronics {
  color: #d8a657;
  background: rgba(216, 166, 87, 0.08);
}
.article-hero--electronics {
  background: linear-gradient(180deg, rgba(216, 166, 87, 0.04) 0%, transparent 100%);
}

.article-hero__tag--vlsi {
  color: #65a30d;
  background: rgba(132, 204, 22, 0.08);
}
.article-hero--vlsi {
  background: linear-gradient(180deg, rgba(132, 204, 22, 0.04) 0%, transparent 100%);
}

.article-hero__tag--ai {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.article-hero--ai {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, transparent 100%);
}

.article-hero__tag--embedded {
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.08);
}
.article-hero--embedded {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.04) 0%, transparent 100%);
}
.article-hero__tag--dsp {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
}
.article-hero--dsp {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.04) 0%, transparent 100%);
}

.article-hero__tag--cpu {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}
.article-hero--cpu {
  background: linear-gradient(180deg, rgba(234, 88, 12, 0.04) 0%, transparent 100%);
}

.article-hero__tag--aisys {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}
.article-hero--aisys {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
}

.article-hero__tag--vectordb {
  color: #818cf8;
  background: rgba(79, 70, 229, 0.08);
}
.article-hero--vectordb {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04) 0%, transparent 100%);
}

.article-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #242424;
  line-height: 1.2;
  margin: 0 0 20px;
  max-width: 720px;
}

.article-hero__meta {
  font-size: 13px;
  color: #555555;
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 40px;
  border-bottom: 1px solid #e5e5e5;
}

/* Article body and readability styling */
.article-wrap {
  margin: 0 auto;
  padding: 48px 0 96px;
}

.article-body {
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: #242424;
}

.article-body h2 {
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: #000000;
  margin: 48px 0 18px;
  padding-top: 4px;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 8px;
}

.article-body h3 {
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.22rem;
  font-weight: 600;
  color: #242424;
  margin: 32px 0 12px;
}

.article-body p {
  margin: 0 0 20px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body strong {
  color: #000000;
  font-weight: 600;
}

.article-body a {
  color: #0066b8; /* VS Code link blue */
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover {
  color: #004b87;
}

/* Premium styling for inline code snippets to stand out comfortably in prose */
.article-body code:not(pre code) {
  background: #f3f3f3; /* VS Code Light inline block */
  border: 1px solid #e5e5e5;
  color: #a31515; /* VS Code Light Theme string color */
  padding: 3px 6px;
  border-radius: 4px;
  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 0.9em;
  word-break: break-word;
}

/* Force developer fonts inside code frames */
pre[class*='language-'],
code[class*='language-'],
.code-filename {
  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
}

.lesson-number {
  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  color: var(--hub-accent, #0066b8);
  font-size: 24px;
  font-weight: 800;
  min-width: 50px;
  text-align: center;
  line-height: 1.2;
}
.lesson-arrow {
  align-self: center;
  font-size: 20px;
  color: var(--hub-accent, #0066b8);
  transition: transform 0.2s;
}
.lesson-item:hover .lesson-arrow {
  transform: translateX(4px);
}

.article-hero__tag,
.blog-card__tag {
  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* VS Code styled cards and lists */
.lesson-item {
  background: #ffffff !important;
  border: 1px solid #e5e5e5 !important;
  color: #242424 !important;
}
.lesson-item:hover {
  background: #f8f9fa !important;
  border-color: #0066b8 !important;
}
.lesson-title {
  color: #242424 !important;
}
.lesson-desc {
  color: #555555 !important;
}
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 36px 0 64px;
}
/* Optional grouping label above a stage's lessons on hub pages with staged
   syllabi (e.g. "Chặng 1 — Nền tảng học máy"). Override --stage-accent
   inline per series instead of redeclaring this whole rule. */
.lessons-stage {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--stage-accent, #ef4444);
  margin: 20px 0 0;
  text-transform: uppercase;
}
.lessons-stage:first-child {
  margin-top: 0;
}

/* ---------------------------------------------------------------------
   Series-accented hub components (lesson list, "welcome" intro widget,
   glossary table), reused across many *-programming-series.html hub pages
   instead of redeclaring per-file. Set --hub-accent / --hub-accent-dark /
   --hub-accent-rgb inline on <body> to recolor per series; --badge-accent /
   --badge-accent-rgb only needed when a series' "Mới" badge should differ
   from its main accent (e.g. SQL uses sky-blue badge on an emerald hub).
   --------------------------------------------------------------------- */
.lesson-item {
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 20px;
  text-decoration: none;
  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.lesson-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.lesson-content {
  flex: 1;
}
.lesson-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  transition: color 0.2s;
}
.lesson-desc {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}
.lesson-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--badge-accent, var(--hub-accent, #ef4444));
  background: rgba(var(--badge-accent-rgb, var(--hub-accent-rgb, 239, 68, 68)), 0.12);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.lesson-item.is-locked {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
.lesson-item.is-locked:hover {
  transform: none;
  box-shadow: none;
}
.lesson-item.is-locked .lesson-number,
.lesson-item.is-locked .lesson-arrow {
  color: var(--text-muted);
}
@media (max-width: 600px) {
  .lesson-item {
    flex-direction: column;
    gap: 12px;
  }
  .lesson-number {
    min-width: auto;
    text-align: left;
  }
}

/* Dark "welcome illustration" widget on hub pages */
.intro-interactive {
  background: #181825;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0 36px;
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 24px;
  align-items: center;
}
.intro-graphic {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--hub-accent, #ef4444) 0%, var(--hub-accent-dark, #dc2626) 100%);
  box-shadow: 0 8px 24px rgba(var(--hub-accent-rgb, 239, 68, 68), 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: floating 4s ease-in-out infinite;
  flex-shrink: 0;
}
.intro-graphic::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: rotation 12s linear infinite;
}
.intro-info {
  flex: 1;
}
.intro-info h3 {
  margin: 0 0 8px 0;
  color: var(--intro-title, #fff);
  font-size: 18px;
}
.intro-info p {
  margin: 0;
  font-size: 14px;
  color: var(--intro-text, var(--text-muted));
  line-height: 1.6;
}
/* Modifier for lessons that place this widget on a light inline-styled
   background (e.g. background:#fafafa) instead of the dark default above -
   overrides just the two text-color variables, inherited down to children. */
.intro-interactive--light {
  --intro-title: #242424;
  --intro-text: #555555;
}
@keyframes floating {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes rotation {
  to {
    transform: rotate(360deg);
  }
}

/* Glossary table on hub pages */
.glossary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 40px;
  font-size: 14px;
}
.glossary-table th,
.glossary-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.glossary-table th {
  background: #11111b;
  color: #fff;
  font-weight: 700;
}
.glossary-table td strong {
  color: var(--hub-accent, #ef4444);
}

/* CTA box matching VS Code editor container look (Light version) */
.article-cta {
  background: #f8f9fa !important;
  border: 1px solid #e5e5e5 !important;
  color: #242424 !important;
  padding: 16px;
}
.article-cta h3 {
  color: #000000 !important;
  margin: 0 0 8px !important;
}

/* Discussion / Facebook CTA */
.article-discuss {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(24, 119, 242, 0.04);
  border: 1px solid rgba(24, 119, 242, 0.18);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0 40px;
}

.article-discuss__icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.article-discuss__body {
  flex: 1;
}

.article-discuss__body p {
  margin: 0 0 12px;
  color: #555555;
  font-size: 0.95rem;
}

.article-discuss__body .btn-facebook {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1877f2;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s;
}

.article-discuss__body .btn-facebook:hover {
  background: #166fe5;
  transform: translateY(-1px);
}

/* Related articles */
.article-related {
  border-top: 1px solid #e5e5e5;
  padding-top: 36px;
  margin-top: 48px;
}

.article-related h2 {
  font-size: 1.1rem !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
  color: #242424 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.article-related__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-related__link {
  color: #0066b8;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.article-related__link::before {
  content: '→';
  flex-shrink: 0;
}
.article-related__link--prev::before {
  content: '←';
}
.article-related__link--next::before {
  content: none;
}
.article-related__link--next::after {
  content: '→';
  margin-left: 8px;
  flex-shrink: 0;
}
.article-related__link:hover {
  text-decoration: underline;
}
.article-related__link--locked {
  color: #999999;
  cursor: not-allowed;
  pointer-events: none;
}
.article-related__link--locked::before,
.article-related__link--locked::after {
  color: #999999;
}

/* Lang content toggle */
[data-lang-content] {
  display: none;
}
[data-lang-content].active {
  display: block;
}

/* Light Theme Quiz Overrides */
.quiz-container {
  background: #f8f9fa !important;
  border: 1px solid #e5e5e5 !important;
}

.quiz-title {
  color: #242424 !important;
}

.quiz-question {
  color: #333333 !important;
}

.quiz-option {
  background: #ffffff !important;
  border: 1px solid #e5e5e5 !important;
  color: #242424 !important;
}

.quiz-option:hover {
  background: #f3f4f6 !important;
  border-color: #0066b8 !important;
  color: #0066b8 !important;
}

.quiz-option.correct {
  background: #e6f4ea !important;
  border-color: #1e7e34 !important;
  color: #1e7e34 !important;
}

.quiz-option.incorrect {
  background: #fce8e6 !important;
  border-color: #d93025 !important;
  color: #c5221f !important;
}

.quiz-feedback.success {
  background: #e6f4ea !important;
  border: 1px solid #1e7e34 !important;
  color: #1e7e34 !important;
}

.quiz-feedback.error {
  background: #fce8e6 !important;
  border: 1px solid #d93025 !important;
  color: #c5221f !important;
}

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

  .article-hero {
    padding: 40px 0 0;
  }

  .article-wrap {
    padding: 32px 0 64px;
  }

  .article-cta {
    padding: 20px;
  }
}

/* Keep site footer dark themed, matching the landing page colors */
.site-footer {
  background-color: #070a13 !important; /* Original landing page footer color */
  border-top: 1px solid rgba(79, 142, 247, 0.18) !important;
  color: #c4c9db !important;
  padding: 48px 0 100px !important;
}

.site-footer .footer-desc {
  color: #c4c9db !important;
}

.site-footer nav a {
  color: rgba(255, 255, 255, 0.7) !important;
}

.site-footer nav a:hover {
  color: #ffffff !important;
}

/* ── Blog search styles ── */
.blog-search-wrap {
  margin-top: 24px;
  display: flex;
  justify-content: flex-start;
}

.blog-search-box {
  width: 100%;
  max-width: 480px;
  height: 44px;
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.blog-search-box:focus-within {
  border-color: #0066b8;
  box-shadow: 0 0 0 3px rgba(0, 102, 184, 0.15);
}

.blog-search-box .search-icon {
  color: #888888;
  margin-right: 10px;
  flex-shrink: 0;
}

.blog-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #242424;
  background: transparent;
  width: 100%;
}

.blog-search-box input::placeholder {
  color: #a0a0a0;
}

.blog-search-box .clear-search-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #888888;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s;
}

.blog-search-box .clear-search-btn:hover {
  color: #c5221f;
}

.blog-card.hidden {
  display: none !important;
}

.blog-section__title.hidden {
  display: none !important;
}

#noSearchResults {
  padding: 80px 0;
  text-align: center;
}

.no-results-content {
  max-width: 320px;
  margin: 0 auto;
  color: #666666;
}

.no-results-content svg {
  color: #a0a0a0;
  margin-bottom: 16px;
}

.no-results-content p {
  font-size: 16px;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.no-results-content span {
  font-size: 14px;
  color: #888888;
}

/* ─────────────────────────────────────────────
   Interactive Canvas Demo Component
   Live, runnable canvas demos embedded in lessons.
   Styled for the VS Code Light theme these pages render in.
   ───────────────────────────────────────────── */
.canvas-demo {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  margin: 28px 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.canvas-demo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e5e5;
}

.canvas-demo__title {
  font-size: 13px;
  font-weight: 700;
  color: #242424;
  letter-spacing: 0.01em;
}

.canvas-demo__reset {
  font-size: 12px;
  font-weight: 600;
  color: #e11d48;
  background: #fff;
  border: 1px solid #f1c0cb;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.canvas-demo__reset:hover {
  background: #fff1f4;
  border-color: #e11d48;
}

.canvas-demo__stage {
  display: block;
  width: 100%;
  /* Subtle checkerboard so transparent regions are visible */
  background-color: #fafafa;
  background-image:
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%), linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%), linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}

.canvas-demo__canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.canvas-demo__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding: 14px 16px;
  border-top: 1px solid #e5e5e5;
  background: #fbfbfb;
}

.canvas-demo__control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #555555;
  min-width: 130px;
}

.canvas-demo__control span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.canvas-demo__control span b {
  color: #e11d48;
  font-variant-numeric: tabular-nums;
}

.canvas-demo__control input[type='range'] {
  width: 100%;
  accent-color: #e11d48;
  cursor: pointer;
}

.canvas-demo__control select {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #242424;
  cursor: pointer;
}

.canvas-demo__btn {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #e11d48;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-end;
}

.canvas-demo__btn:hover {
  background: #be123c;
}

.canvas-demo__btn--ghost {
  color: #e11d48;
  background: #fff;
  border: 1px solid #f1c0cb;
}

.canvas-demo__btn--ghost:hover {
  background: #fff1f4;
}

.canvas-demo__hint {
  width: 100%;
  font-size: 12px;
  font-weight: 500;
  color: #777;
  margin: 0;
}

/* ─────────────────────────────────────────────
   Live JS Code Playground
   Editable code → Run → captured console output.
   Styled for the VS Code Light theme these pages render in.
   ───────────────────────────────────────────── */
.js-playground {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  margin: 28px 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  background: #fff;
}

.js-playground__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: #fef9e7;
  border-bottom: 1px solid #f3e8b8;
}

.js-playground__title {
  font-size: 13px;
  font-weight: 700;
  color: #854d0e;
}

.js-playground__actions {
  display: flex;
  gap: 8px;
}

.js-playground__btn {
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  padding: 5px 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.js-playground__run {
  color: #fff;
  background: #ca8a04;
}
.js-playground__run:hover {
  background: #a16207;
}

.js-playground__reset {
  color: #854d0e;
  background: #fff;
  border-color: #f3e8b8;
}
.js-playground__reset:hover {
  background: #fefce8;
}

.js-playground__code {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  resize: vertical;
  padding: 14px 16px;
  font-family: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #1f2933;
  background: #fbfbfa;
  tab-size: 2;
  outline: none;
  min-height: 90px;
}
.js-playground__code:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px #fde68a;
}

.js-playground__console {
  font-family: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px 16px;
  background: #1e1e1e;
  color: #d4d4d4;
  min-height: 28px;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.js-playground__console:empty::before {
  content: '// Nhấn ▶ Run để xem kết quả';
  color: #6a6a6a;
}

.js-playground__line {
  padding: 1px 0;
}
.js-playground__line--err {
  color: #f48771;
}
.js-playground__line--muted {
  color: #808080;
}

/* Article Body Table Custom Styles */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.95em;
  line-height: 1.5;
}

.article-body th {
  background-color: #f1f5f9; /* Slate 100 */
  color: #0f172a; /* Slate 900 */
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid #e2e8f0; /* Slate 200 */
}

.article-body td {
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  color: #334155; /* Slate 700 */
}

.article-body tr:nth-child(even) {
  background-color: #f8fafc; /* Slate 50 */
}

/* Bảng chứa nội dung không wrap được (công thức KaTeX, code dài) sẽ rộng
   hơn màn hình hẹp — cho bảng tự cuộn ngang trên mobile thay vì kéo tràn
   cả trang. Chỉ áp dụng dưới 640px, desktop giữ nguyên table layout cũ. */
@media (max-width: 640px) {
  .article-body table {
    display: block;
    overflow-x: auto;
  }
}

/* ─────────────────────────────────────────────
   Callout boxes (note / tip / warning / pitfall / deep)
   Used across lesson articles for annotations.
   ───────────────────────────────────────────── */
.callout {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  background: #f8fafc;
}
.callout__title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  font-size: 0.98rem;
}
.callout__content {
  color: #334155;
  line-height: 1.7;
  font-size: 0.96rem;
}
.callout__content code {
  background: rgba(15, 23, 42, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.callout--note {
  border-left-color: #3b82f6;
  background: #eff6ff;
}
.callout--tip {
  border-left-color: #22c55e;
  background: #f0fdf4;
}
.callout--warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.callout--pitfall {
  border-left-color: #ef4444;
  background: #fef2f2;
}
.callout--deep {
  border-left-color: #a855f7;
  background: #faf5ff;
}

/* ---------------------------------------------------------------------
   Shared interactive-demo components (dark box + select + terminal output),
   reused across many lesson pages instead of redeclaring per-file. Override
   --panel-accent / --term-accent inline (style="--panel-accent:#f43f5e") to
   recolor per series — do not fork a new copy of these rules per lesson.
   NOTE: named --panel-accent (not --demo-accent) to avoid colliding with the
   pre-existing global --demo-accent variable (#65a30d, used site-wide for
   the "Download code" CTA button in hundreds of lesson files).
   --------------------------------------------------------------------- */
.demo-panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  color: #fff;
}
.demo-panel__select {
  background: #0f172a;
  color: #fff;
  border: 1px solid #475569;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  width: 100%;
  margin-bottom: 16px;
  outline: none;
}
.demo-panel__row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.demo-panel__row > div {
  flex: 1;
  min-width: 200px;
}
.demo-panel__btn {
  background: var(--panel-accent, #f43f5e);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}
.demo-panel__btn:hover {
  filter: brightness(0.9);
}
.demo-panel__cost {
  margin-top: 12px;
  font-size: 13px;
  color: #fbbf24;
}
.demo-panel__output {
  background: #090d16;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 16px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}
.demo-panel__output strong {
  color: inherit;
}

/* Dark terminal-style readout embedded in an otherwise light demo container
   (CPU/VLSI-style lessons). --term-accent recolors the highlighted values;
   the strong{color:inherit} rule permanently fixes the site-wide bug where
   .article-body strong{color:#000} forces bold text to black on dark boxes. */
.term-output {
  background: #1e293b;
  color: var(--term-accent, #38bdf8);
  border-radius: 6px;
  padding: 14px;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
}
.term-output strong {
  color: inherit;
}

/* ─────────────────────────────────────────────
   Worked-example boxes ("Ví dụ N: ...")
   Used across electronics series lessons.
   ───────────────────────────────────────────── */
.example-box {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #d8a657;
  background: #fffaf0;
}
.example-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  font-size: 0.98rem;
}
.example-content p {
  margin: 0 0 10px;
}
.example-content p:last-child {
  margin-bottom: 0;
}

/* Download / call-to-action button inside articles */
.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(130deg, #4f7fff 0%, #8b6bff 100%);
  transition: opacity 0.2s ease;
}
.about-cta:hover {
  opacity: 0.9;
}

/* External references block at the end of a lesson */
.article-refs {
  margin: 36px 0 8px;
  padding: 20px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.article-refs h2,
.article-refs h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #1e293b;
}
.article-refs ul {
  margin: 0;
  padding-left: 20px;
}
.article-refs li {
  margin-bottom: 8px;
  color: #334155;
}
.article-refs a {
  color: #2563eb;
  text-decoration: none;
}
.article-refs a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────
   Tabbed code viewer: Preview | HTML | CSS
   Reusable demo component for lesson articles.
   ───────────────────────────────────────────── */
.code-tabs {
  margin: 28px 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.code-tabs__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.code-tabs__title {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.95rem;
}
.code-tabs__btns {
  display: inline-flex;
  gap: 4px;
}
.code-tabs__tab {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.code-tabs__tab:hover {
  background: #e2e8f0;
}
.code-tabs__tab.is-active {
  background: #fff;
  color: #2563eb;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.code-tabs__panel {
  display: none;
}
.code-tabs__panel.is-active {
  display: block;
}
/* Code windows fill the panel edge-to-edge */
.code-tabs__panel .code-window {
  margin: 0;
  border-radius: 0;
}

/* ── Mux 2-1 interactive demo (Series 11 VLSI, RTL Playground tour) ── */
/* Bảng màu widget demo tương tác — dùng chung cho MỌI series (không riêng
   VLSI). --demo-accent = trạng thái đang bật/tốt hơn/nhanh hơn trong mọi
   demo (nút active, thanh so sánh "sau"); --demo-warn = thanh so sánh
   "trước/chậm hơn". Đổi giá trị ở đây sẽ đổi đồng bộ mọi nơi đang dùng. */
:root {
  --demo-accent: #65a30d;
  --demo-accent-light: #a3e635;
  --demo-accent-soft: rgba(101, 163, 13, 0.12);
  --demo-accent-text: #3f6212;
  --demo-warn: #ca8a04;
  --demo-panel-bg: #1e293b;
  --demo-panel-text: #e2e8f0;
}
.mux-demo {
  padding: 20px;
  background: #fff;
}
.mux-demo__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.mux-demo__style-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #475569;
}
.mux-style-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
}
.mux-style-btn:hover {
  border-color: var(--demo-accent);
  color: var(--demo-accent);
}
.mux-style-btn.is-active {
  background: var(--demo-accent);
  border-color: var(--demo-accent);
  color: #fff;
}
.mux-demo__inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mux-input-btn {
  min-width: 56px;
  padding: 6px 10px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
}
.mux-input-btn:hover {
  border-color: var(--demo-accent);
}
.mux-input-btn.is-on {
  background: var(--demo-accent-soft);
  border-color: var(--demo-accent);
  color: var(--demo-accent-text);
}
.mux-demo__output {
  padding: 6px 14px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  font-weight: 700;
  background: var(--demo-panel-bg);
  color: var(--demo-panel-text);
  border-radius: 6px;
}
.mux-demo__output strong {
  color: var(--demo-accent-light);
}
/* Thanh so sánh 2 giá trị (dùng chung cho mọi demo dạng "A vs B" — vd
   TLM vs RTL, RCA vs CLA): --a = phương án chậm/cũ hơn, --b = phương án
   nhanh/tối ưu hơn, đồng bộ với accent xanh lime của các nút demo khác. */
.compare-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-bar-row + .compare-bar-row {
  margin-top: 8px;
}
.compare-bar-row__label {
  width: 110px;
  font-size: 13px;
  flex-shrink: 0;
}
.compare-bar-row__value {
  font-size: 13px;
  font-weight: 600;
}
.compare-bar {
  height: 22px;
  min-width: 2px;
  border-radius: 3px;
}
.compare-bar--a {
  background: var(--demo-warn);
}
.compare-bar--b {
  background: var(--demo-accent);
}
.mux-demo__netlist {
  width: 100%;
  overflow-x: auto;
}
.mux-demo__hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}
