/* ─────────────────────────────────────────────────────────────────────────────
   EduHT — Main Stylesheet
   Colour palette modelled on GeeksForGeeks + industry competitors:
     GFG green:   #2f8d46 (navbar, accents, links)
     Body bg:     #f9f9f9 (same as GFG off-white page background)
     Card white:  #ffffff
     Dark text:   #1f1f1f
     Subtle text: #5c5c5c
     Border:      #e2e8f0
     Code dark:   #1e2127 (Atom One Dark — same as GFG code blocks)
     Inline code: #fff3e0 / #e64a19
   Bootstrap 5 is loaded from CDN. These rules override and extend it.
───────────────────────────────────────────────────────────────────────────── */

/* ══════════════════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --clr-primary:        #2f8d46;
  --clr-primary-dark:   #236b34;
  --clr-primary-light:  #e8f5e9;
  --clr-primary-hover:  #247a3b;

  /* Background layers */
  --clr-bg-page:        #f9f9f9;   /* GFG body bg */
  --clr-bg-card:        #ffffff;
  --clr-bg-code:        #1e2127;   /* Atom One Dark */
  --clr-bg-inline-code: #fff8f0;

  /* Text */
  --clr-text-primary:   #1f1f1f;
  --clr-text-secondary: #5c5c5c;
  --clr-text-muted:     #9e9e9e;
  --clr-text-on-dark:   #abb2bf;   /* code block text */
  --clr-link:           #2f8d46;
  --clr-link-visited:   #1a6b32;

  /* Borders */
  --clr-border:         #e2e8f0;
  --clr-border-focus:   #2f8d46;

  /* Difficulty badges */
  --clr-badge-beginner:     #e8f5e9;
  --clr-badge-beginner-txt: #1b5e20;
  --clr-badge-mid:          #fff3e0;
  --clr-badge-mid-txt:      #e65100;
  --clr-badge-adv:          #fce4ec;
  --clr-badge-adv-txt:      #b71c1c;

  /* Syntax highlighting (Atom One Dark palette) */
  --syn-keyword:  #c678dd;
  --syn-string:   #98c379;
  --syn-comment:  #5c6370;
  --syn-number:   #d19a66;
  --syn-function: #61afef;
  --syn-class:    #e5c07b;
  --syn-operator: #56b6c2;
  --syn-variable: #e06c75;

  /* Spacing */
  --nav-height:   60px;
  --content-max:  860px;
  --sidebar-w:    260px;

  /* Typography */
  --font-sans:  'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-head:  'Nunito', var(--font-sans);
}

/* ══════════════════════════════════════════════════════════════════════════
   2. RESET + BASE
══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--clr-link);
  text-decoration: none;
}
a:hover { color: var(--clr-primary-hover); text-decoration: underline; }
a:visited { color: var(--clr-link-visited); }

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

/* ══════════════════════════════════════════════════════════════════════════
   3. NAVIGATION (matches GFG top-bar aesthetic)
══════════════════════════════════════════════════════════════════════════ */
body > header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--clr-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
}

body > header nav {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Logo */
body > header nav a[rel="home"] {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  margin-right: 2rem;
  text-decoration: none;
}
body > header nav a[rel="home"]:hover { color: #fff; text-decoration: none; opacity: 0.9; }

body > header nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.15rem;
  flex-wrap: wrap;
}

body > header nav ul li a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

body > header nav ul li a:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   4. PAGE LAYOUT — article + sidebar grid
══════════════════════════════════════════════════════════════════════════ */
main#main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 1.75rem;
  align-items: start;
}

/* For non-article pages (home, search, author) — full width */
main#main-content > section,
main#main-content > .page-home,
main#main-content > .page-author,
main#main-content > .page-search {
  grid-column: 1 / -1;
}

/* Article layout: article takes left col, TOC takes right col */
main#main-content > article {
  grid-column: 1;
  min-width: 0;
}

aside.article-sidebar {
  grid-column: 2;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}

@media (max-width: 900px) {
  main#main-content {
    grid-template-columns: 1fr;
  }
  aside.article-sidebar {
    display: none; /* TOC hidden on mobile — inline TOC shown in article */
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   5. BREADCRUMB
══════════════════════════════════════════════════════════════════════════ */
nav[aria-label="Breadcrumb"] {
  font-size: 0.85rem;
  color: var(--clr-text-secondary);
  margin-bottom: 1.25rem;
}

nav[aria-label="Breadcrumb"] ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
}

nav[aria-label="Breadcrumb"] li + li::before {
  content: '›';
  margin: 0 0.45rem;
  color: var(--clr-text-muted);
  font-size: 1rem;
}

nav[aria-label="Breadcrumb"] a {
  color: var(--clr-primary);
}

nav[aria-label="Breadcrumb"] [aria-current="page"] {
  color: var(--clr-text-secondary);
}

/* ══════════════════════════════════════════════════════════════════════════
   6. ARTICLE — HEADER + METADATA
══════════════════════════════════════════════════════════════════════════ */
article h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--clr-text-primary);
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Article metadata bar */
article header dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--clr-text-secondary);
  background: #f0f9f2;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
}

article header dl div { display: contents; }
article header dl dt {
  font-weight: 700;
  color: var(--clr-primary-dark);
}
article header dl dt::after { content: ':'; margin-right: 0.25rem; }
article header dl dd { margin: 0; }

/* Difficulty badge */
.badge-difficulty {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-difficulty.beginner {
  background: var(--clr-badge-beginner);
  color: var(--clr-badge-beginner-txt);
}
.badge-difficulty.intermediate {
  background: var(--clr-badge-mid);
  color: var(--clr-badge-mid-txt);
}
.badge-difficulty.advanced {
  background: var(--clr-badge-adv);
  color: var(--clr-badge-adv-txt);
}

/* Topics tags */
.article-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.topic-tag {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #a5d6a7;
}

/* ══════════════════════════════════════════════════════════════════════════
   7. TABLE OF CONTENTS (inline, inside article)
══════════════════════════════════════════════════════════════════════════ */
nav[aria-label="Table of contents"] {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-primary);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
}

nav[aria-label="Table of contents"] h2 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-text-secondary);
  margin: 0 0 0.65rem;
}

nav[aria-label="Table of contents"] ol {
  margin: 0;
  padding-left: 1.25rem;
}

nav[aria-label="Table of contents"] li {
  margin-bottom: 0.3rem;
}

nav[aria-label="Table of contents"] a {
  color: var(--clr-text-primary);
  font-size: 0.9rem;
}
nav[aria-label="Table of contents"] a:hover { color: var(--clr-primary); }

/* ══════════════════════════════════════════════════════════════════════════
   8. ARTICLE BODY — TYPOGRAPHY
══════════════════════════════════════════════════════════════════════════ */
section[itemprop="articleBody"] {
  font-size: 1.025rem;
  line-height: 1.8;
  color: var(--clr-text-primary);
}

section[itemprop="articleBody"] h2 {
  font-family: var(--font-head);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--clr-text-primary);
  border-bottom: 2px solid var(--clr-primary-light);
  padding-bottom: 0.4rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

section[itemprop="articleBody"] h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--clr-primary-dark);
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

section[itemprop="articleBody"] h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

section[itemprop="articleBody"] p {
  margin-bottom: 1.1rem;
}

section[itemprop="articleBody"] ul,
section[itemprop="articleBody"] ol {
  margin-bottom: 1.1rem;
  padding-left: 1.5rem;
}

section[itemprop="articleBody"] li {
  margin-bottom: 0.35rem;
}

section[itemprop="articleBody"] strong {
  font-weight: 700;
  color: var(--clr-text-primary);
}

section[itemprop="articleBody"] blockquote {
  border-left: 4px solid var(--clr-primary);
  background: var(--clr-primary-light);
  margin: 1.5rem 0;
  padding: 0.85rem 1.25rem;
  border-radius: 0 6px 6px 0;
  font-style: normal;
  color: var(--clr-primary-dark);
}

/* Note / Tip / Warning callout boxes — like GFG */
.note, .tip, .warning, .callout {
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid transparent;
}

.note {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0d47a1;
}

.tip {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #1b5e20;
}

.warning {
  background: #fff3e0;
  border-color: #ffcc80;
  color: #e65100;
}

.note::before    { content: 'Note'; flex-shrink: 0; font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.1em 0.5em; border-radius: 3px; background: #90caf9; color: #0d47a1; }
.tip::before     { content: 'Tip';  flex-shrink: 0; font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.1em 0.5em; border-radius: 3px; background: #a5d6a7; color: #1b5e20; }
.warning::before { content: 'Warning'; flex-shrink: 0; font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.1em 0.5em; border-radius: 3px; background: #ffcc80; color: #e65100; }

/* Comparison tables */
section[itemprop="articleBody"] table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  background: var(--clr-bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

section[itemprop="articleBody"] th {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 700;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.88rem;
}

section[itemprop="articleBody"] td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: top;
}

section[itemprop="articleBody"] tr:last-child td { border-bottom: none; }
section[itemprop="articleBody"] tr:hover td { background: #f5faf5; }

/* ══════════════════════════════════════════════════════════════════════════
   9. CODE BLOCKS — Atom One Dark (GFG / freeCodeCamp style)
══════════════════════════════════════════════════════════════════════════ */

/* Wrapper with copy button */
.code-block-wrap {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

/* Language badge bar */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #21252b;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #3a3f4b;
}

.code-lang-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #98c379;
}

/* Traffic-light dots (like Mac Terminal / VS Code) */
.code-dots {
  display: flex;
  gap: 5px;
}
.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}
.code-dots .dot-r { background: #ff5f56; }
.code-dots .dot-y { background: #ffbd2e; }
.code-dots .dot-g { background: #27c93f; }

/* Copy button */
.copy-btn {
  background: transparent;
  border: 1px solid #4b5263;
  color: #abb2bf;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover {
  background: #2f8d46;
  border-color: #2f8d46;
  color: #fff;
}
.copy-btn.copied {
  background: #98c379;
  border-color: #98c379;
  color: #21252b;
}

/* Code pre/code */
pre {
  margin: 0;
  padding: 1.25rem 1.25rem;
  background: var(--clr-bg-code);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  tab-size: 4;
  -moz-tab-size: 4;
}

pre code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  color: #abb2bf;
  border: none;
  white-space: pre;
}

/* Output/result block */
.code-output {
  background: #f8f9fa;
  border: 1px solid var(--clr-border);
  border-top: 3px solid var(--clr-primary);
  border-radius: 0 0 8px 8px;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #1f1f1f;
  white-space: pre;
  overflow-x: auto;
}

.output-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-primary);
  margin-bottom: 0.4rem;
  display: block;
}

/* ── Syntax token colouring (manual spans) ── */
.tok-kw  { color: var(--syn-keyword); }   /* keyword */
.tok-str { color: var(--syn-string); }    /* string */
.tok-cmt { color: var(--syn-comment); font-style: italic; } /* comment */
.tok-num { color: var(--syn-number); }    /* number */
.tok-fn  { color: var(--syn-function); }  /* function name */
.tok-cls { color: var(--syn-class); }     /* class / type */
.tok-op  { color: var(--syn-operator); }  /* operator */
.tok-var { color: var(--syn-variable); }  /* variable */
.tok-dec { color: #e5c07b; }              /* decorator */
.tok-blt { color: #56b6c2; }              /* builtin */
.tok-pct { color: #abb2bf; }              /* punctuation */

/* ── Inline code ── */
code:not(pre > code) {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--clr-bg-inline-code);
  color: #c0392b;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid #ffccbc;
  white-space: nowrap;
}

/* ── Line numbers ── */
.has-line-numbers pre {
  counter-reset: line;
  padding-left: 3.5rem;
}
.has-line-numbers pre code .line {
  display: block;
  position: relative;
}
.has-line-numbers pre code .line::before {
  content: counter(line);
  counter-increment: line;
  position: absolute;
  left: -3rem;
  width: 2.2rem;
  text-align: right;
  color: #495162;
  font-size: 0.82em;
  user-select: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   10. FAQ SECTION
══════════════════════════════════════════════════════════════════════════ */
section[aria-labelledby="faq-heading"] {
  margin-top: 3rem;
  border-top: 2px solid var(--clr-border);
  padding-top: 2rem;
}

section[aria-labelledby="faq-heading"] h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

section[aria-labelledby="faq-heading"] dl {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

section[aria-labelledby="faq-heading"] > dl > div {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-primary);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
}

section[aria-labelledby="faq-heading"] dt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--clr-text-primary);
  margin-bottom: 0.4rem;
}
section[aria-labelledby="faq-heading"] dt::before {
  content: 'Q: ';
  color: var(--clr-primary);
}

section[aria-labelledby="faq-heading"] dd {
  margin: 0;
  color: var(--clr-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
section[aria-labelledby="faq-heading"] dd::before {
  content: 'A: ';
  color: var(--clr-text-muted);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════════════════
   11. RELATED ARTICLES
══════════════════════════════════════════════════════════════════════════ */
aside[aria-labelledby="related-heading"] {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--clr-border);
}

aside[aria-labelledby="related-heading"] h2 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--clr-text-primary);
}

aside[aria-labelledby="related-heading"] ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

aside[aria-labelledby="related-heading"] li {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

aside[aria-labelledby="related-heading"] li:hover {
  border-color: var(--clr-primary);
  box-shadow: 0 2px 8px rgba(47,141,70,0.12);
}

aside[aria-labelledby="related-heading"] a {
  font-weight: 700;
  font-size: 0.95rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   12. HOME PAGE
══════════════════════════════════════════════════════════════════════════ */
.page-home {}

.hero-section {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-dark) 100%);
  color: #fff;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.hero-section h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.hero-section p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* Language card grid */
.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.language-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--clr-text-primary);
}

.language-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(47,141,70,0.15);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  text-decoration: none;
}

.language-card .lang-icon {
  font-size: 2rem;
  display: block;
  line-height: 1;
}

.language-card .lang-name {
  font-weight: 700;
  font-size: 1rem;
}

.language-card .lang-count {
  font-size: 0.78rem;
  color: var(--clr-text-muted);
}

/* Recent articles list */
.recent-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.article-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.article-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  border-color: var(--clr-primary);
}

.article-card .article-lang-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-primary);
}

.article-card h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.article-card h3 a {
  color: var(--clr-text-primary);
}
.article-card h3 a:hover { color: var(--clr-primary); text-decoration: none; }

.article-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--clr-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   13. LANGUAGE HUB PAGE
══════════════════════════════════════════════════════════════════════════ */
.lang-hero {
  background: var(--clr-primary-light);
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-hero-icon {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
}

.lang-hero-text h1 {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 0 0.35rem;
  color: var(--clr-primary-dark);
}

.lang-hero-text p {
  margin: 0;
  color: var(--clr-text-secondary);
  font-size: 0.98rem;
}

/* Article list on language hub */
.articles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.articles-list li a {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--clr-text-primary);
}

.articles-list li a:hover {
  border-color: var(--clr-primary);
  box-shadow: 0 2px 10px rgba(47,141,70,0.12);
  text-decoration: none;
  color: var(--clr-primary);
}

/* ══════════════════════════════════════════════════════════════════════════
   14. SIDEBAR TOC (desktop)
══════════════════════════════════════════════════════════════════════════ */
.sidebar-toc {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
}

.sidebar-toc h3 {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--clr-text-muted);
  margin: 0 0 0.65rem;
}

.sidebar-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-toc li {
  margin-bottom: 0;
}

.sidebar-toc a {
  display: block;
  padding: 0.3rem 0.5rem;
  color: var(--clr-text-secondary);
  border-radius: 4px;
  font-size: 0.84rem;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.sidebar-toc a:hover,
.sidebar-toc a.active {
  color: var(--clr-primary);
  border-left-color: var(--clr-primary);
  background: var(--clr-primary-light);
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   15. FOOTER
══════════════════════════════════════════════════════════════════════════ */
body > footer {
  background: #212121;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  padding: 2rem 0 1.5rem;
  margin-top: 4rem;
}

body > footer nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

body > footer nav ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

body > footer nav ul li a {
  color: rgba(255,255,255,0.7);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
body > footer nav ul li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

body > footer p {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   16. SEARCH PAGE
══════════════════════════════════════════════════════════════════════════ */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-form label {
  width: 100%;
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 0.6rem 1rem;
  border: 2px solid var(--clr-border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}
.search-form input[type="search"]:focus {
  border-color: var(--clr-primary);
}

.search-form button[type="submit"] {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.search-form button[type="submit"]:hover {
  background: var(--clr-primary-dark);
}

/* ══════════════════════════════════════════════════════════════════════════
   17. UTILITIES
══════════════════════════════════════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-muted    { color: var(--clr-text-muted) !important; }
.text-primary  { color: var(--clr-primary) !important; }
.text-sm       { font-size: 0.875rem !important; }
.fw-bold       { font-weight: 700 !important; }
.mt-0          { margin-top: 0 !important; }
.mb-0          { margin-bottom: 0 !important; }

/* ══════════════════════════════════════════════════════════════════════════
   18. SCROLLBAR (Webkit)
══════════════════════════════════════════════════════════════════════════ */
pre::-webkit-scrollbar { height: 6px; }
pre::-webkit-scrollbar-track { background: #21252b; }
pre::-webkit-scrollbar-thumb { background: #4b5263; border-radius: 3px; }
pre::-webkit-scrollbar-thumb:hover { background: #636d83; }

/* ══════════════════════════════════════════════════════════════════════════
   19. SKIP LINK (accessibility)
══════════════════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--clr-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 6px;
  font-weight: 700;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   20. PRINT
══════════════════════════════════════════════════════════════════════════ */
@media print {
  body > header, body > footer, aside.article-sidebar,
  nav[aria-label="Breadcrumb"], .copy-btn { display: none; }
  body { background: #fff; font-size: 12pt; }
  main#main-content { display: block; padding: 0; }
  pre { white-space: pre-wrap; }
}
