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

:root {
  --bg:        #fafafa;
  --bg-card:   #ffffff;
  --bg-alt:    #f3f4f6;
  --bg-warm:   #fef7ed;
  --border:    #e5e7eb;
  --border-hover: #d1d5db;
  --text:      #1f2937;
  --text-dim:  #6b7280;
  --text-light:#9ca3af;
  --accent:    #2563eb;
  --accent-light: #dbeafe;
  --accent2:   #16a34a;
  --accent3:   #7c3aed;
  --accent4:   #ea580c;
  --tag-dev:   #2563eb;
  --tag-hack:  #dc2626;
  --tag-game:  #16a34a;
  --tag-desk:  #7c3aed;
  --tag-serv:  #ea580c;
  --tag-priv:  #db2777;
  --tag-begin: #0891b2;
  --tag-adv:   #ca8a04;
  --radius:    10px;
  --radius-lg: 16px;
  --max-w:     1100px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== Header / Nav ===== */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }

nav > ul {
  list-style: none;
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  align-items: center;
}

nav > ul > li {
  position: relative;
}

nav > ul > li > a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

nav > ul > li > a:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}

nav > ul > li > a.active {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

/* Dropdown caret */
nav > ul > li > a.has-dropdown::after {
  content: '';
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 2px;
  opacity: 0.5;
}

/* Dropdown menu */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 0.5rem 0;
  padding-top: calc(0.5rem + 6px);
  z-index: 200;
  list-style: none;
  /* Invisible bridge to cover the gap between trigger and menu */
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
}

nav > ul > li:hover > .nav-dropdown,
nav > ul > li:focus-within > .nav-dropdown {
  display: block;
}

.nav-dropdown .dropdown-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  padding: 0.5rem 1rem 0.25rem;
  display: block;
}

.nav-dropdown .dropdown-label:first-child {
  padding-top: 0.25rem;
}

.nav-dropdown .dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.nav-dropdown a {
  display: block;
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-weight: 400;
  transition: all 0.1s;
}

.nav-dropdown a:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}

/* Mobile nav */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-dim);
  line-height: 1;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.hero h1 span { color: var(--accent); }

.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* ===== Start Here Banner ===== */
.start-here {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  max-width: var(--max-w);
  margin: 0 auto 2.5rem;
}

.start-here h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.start-here p {
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.start-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.start-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.start-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

/* ===== Container / Section ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ===== Tag Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag-development  { background: #dbeafe; color: #1d4ed8; }
.tag-hacking      { background: #fee2e2; color: #b91c1c; }
.tag-gaming       { background: #dcfce7; color: #15803d; }
.tag-desktop      { background: #ede9fe; color: #6d28d9; }
.tag-server       { background: #ffedd5; color: #c2410c; }
.tag-privacy      { background: #fce7f3; color: #be185d; }
.tag-beginner     { background: #cffafe; color: #0e7490; }
.tag-advanced     { background: #fef9c3; color: #a16207; }

/* ===== Cards Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

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

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

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

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.6;
  flex: 1;
}

.card .meta {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  gap: 1rem;
}

/* ===== Guide Links Grid ===== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.link-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.link-card h4 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
  color: var(--text);
}

.link-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ===== Article / Page Content ===== */
.page-content-wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 2.5rem;
  padding: 0 1.5rem;
  align-items: start;
}

.page-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-content-wrap > .page-content {
  max-width: none;
  padding: 2rem 0 4rem;
}

/* ===== Table of Contents Sidebar ===== */
.toc-sidebar {
  position: sticky;
  top: 80px;
  padding: 1rem 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.toc-sidebar .toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 0.6rem;
  padding-left: 0.75rem;
}

.toc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border);
}

.toc-sidebar li {
  margin: 0;
}

.toc-sidebar a {
  display: block;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all 0.15s;
  text-decoration: none;
}

.toc-sidebar a:hover {
  color: var(--text);
  text-decoration: none;
}

.toc-sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.toc-sidebar a.toc-h3 {
  padding-left: 1.5rem;
  font-size: 0.75rem;
}

/* Mobile TOC */
.toc-mobile {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.toc-mobile summary {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dim);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

.toc-mobile summary::before {
  content: '\25B6';
  font-size: 0.55rem;
  color: var(--text-light);
  transition: transform 0.2s;
}

.toc-mobile[open] summary::before {
  transform: rotate(90deg);
}

.toc-mobile ul {
  list-style: none;
  padding: 0 1rem 0.75rem;
  margin: 0;
}

.toc-mobile li { margin: 0; }

.toc-mobile a {
  display: block;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  border-radius: 4px;
}

.toc-mobile a:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

.toc-mobile a.toc-h3 {
  padding-left: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

.page-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.3px;
}

.page-content .subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.page-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.page-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--accent);
}

.page-content p, .page-content ul, .page-content ol {
  margin-bottom: 1rem;
}

.page-content ul, .page-content ol {
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.35rem;
}

.page-content code {
  background: var(--bg-alt);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', monospace;
  color: #c7254e;
}

.page-content pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  line-height: 1.6;
}

.page-content pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.85rem;
}

/* ===== Table ===== */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.page-content th, .page-content td {
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.page-content th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}

.page-content tr:nth-child(even) { background: var(--bg-alt); }
.page-content tr:hover { background: #f0f4ff; }

/* ===== Collapsible / Details ===== */
details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

details[open] {
  border-color: var(--accent);
}

details summary {
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  transition: color 0.15s;
  user-select: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: '\25B6';
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  color: var(--accent);
}

details .details-content {
  padding: 0 1.25rem 1rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.7;
}

details .details-content p:last-child,
details .details-content ul:last-child,
details .details-content pre:last-child {
  margin-bottom: 0;
}

/* Group of collapsibles */
.collapse-group {
  margin-bottom: 1.5rem;
}

.collapse-group details {
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.collapse-group details:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.collapse-group details:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
  border-bottom: 1px solid var(--border);
}

.collapse-group details:only-child {
  border-radius: var(--radius);
  border-bottom: 1px solid var(--border);
}

/* ===== Info Box ===== */
.info-box {
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

.info-box.warn {
  background: #fff7ed;
  border-left-color: var(--accent4);
}

.info-box.tip {
  background: #f0fdf4;
  border-left-color: var(--accent2);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.82rem;
  color: var(--text-light);
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.3rem; }

/* ===== Read More Links ===== */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.read-more::after {
  content: '\2192';
  transition: transform 0.15s;
}

.read-more:hover::after {
  transform: translateX(3px);
}

/* ===== Related / See Also ===== */
.related-box {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.related-box h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.related-box ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-box li a {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.related-box li a:hover {
  border-color: var(--accent);
  text-decoration: none;
  background: var(--accent-light);
}

/* ===== Footer ===== */
footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .page-content-wrap {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc-sidebar {
    display: none;
  }
  .toc-mobile {
    display: block;
  }
}

@media (max-width: 768px) {
  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 0.5rem;
    min-width: 0;
    display: none;
    background: none;
  }
  nav > ul > li:hover > .nav-dropdown {
    display: none;
  }
  nav > ul > li.open > .nav-dropdown {
    display: block;
  }
  nav > ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
    display: none;
  }
  nav > ul.open {
    display: flex;
  }
  .nav-mobile-toggle {
    display: block;
  }
}

@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .start-here { padding: 1.5rem; }
  .page-content { padding: 1.5rem 1rem 3rem; }
  .page-content-wrap > .page-content { padding: 1.5rem 0 3rem; }
}

/* ===== Directory Tree ===== */
.dir-tree {
  font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.dir-tree .dir { color: #60a5fa; font-weight: 600; }
.dir-tree .desc { color: #94a3b8; }

/* ===== Browse Page ===== */
.browse-search-wrap {
  margin-bottom: 1.25rem;
}
.browse-search {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.15s;
}
.browse-search:focus {
  border-color: var(--accent);
}
.results-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  min-height: 1.3em;
}
.browse-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* Article list rows */
.article-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.article-group-header {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.article-group-header:not(:first-child) {
  border-top: 1px solid var(--border);
}
.article-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.article-row:last-child {
  border-bottom: none;
}
.article-row:hover {
  background: var(--bg-alt);
}
.article-cat-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 5.5rem;
  text-align: center;
}
.article-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.article-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.article-row:hover .article-title {
  color: var(--accent);
}
.article-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-difficulty {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.article-difficulty--intermediate {
  background: #fef3c7;
  color: #92400e;
}
.article-difficulty--advanced {
  background: #fee2e2;
  color: #991b1b;
}

/* Category links on homepage */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}
.category-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.category-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}
.category-card .cat-count {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

@media (max-width: 600px) {
  .article-cat-badge {
    display: none;
  }
  .article-desc {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
}
