/* Bundled CSS for Static Site Generator */

/* base/variables.css */
:root {
  /* Typography Scale */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;
  
  /* Spacing Scale (8px grid) */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius-base: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-base: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  
  /* Breakpoints */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* Content Width */
  --content-width: 65ch;
  --content-width-wide: 80ch;
  --container-width: 1200px;
}

/* themes/light.css */
:root {
  /* Light Theme Colors */
  --color-background: #ffffff;
  --color-background-secondary: #f8fafc;
  --color-background-tertiary: #f1f5f9;
  
  /* Text Colors */
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --color-text-inverse: #ffffff;
  
  /* Border Colors */
  --color-border-primary: #e2e8f0;
  --color-border-secondary: #cbd5e1;
  --color-border-focus: #3b82f6;
  
  /* Brand Colors */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-light: #dbeafe;
  
  /* Semantic Colors */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #06b6d4;
  --color-info-light: #cffafe;
  
  /* Code Colors */
  --color-code-background: #f8fafc;
  --color-code-border: #e2e8f0;
  --color-code-text: #1e293b;
  --color-code-keyword: #7c3aed;
  --color-code-string: #059669;
  --color-code-comment: #64748b;
  --color-code-number: #dc2626;
  --color-code-function: #2563eb;
  
  /* Interactive States */
  --color-hover: #f1f5f9;
  --color-active: #e2e8f0;
  --color-focus: #3b82f6;
  --color-focus-ring: rgb(59 130 246 / 0.5);
  
  /* Navigation */
  --color-nav-background: rgba(255, 255, 255, 0.8);
  --color-nav-border: rgba(226, 232, 240, 0.8);
  
  /* Content Type Colors */
  --color-tutorial: #8b5cf6;
  --color-tutorial-light: #f3e8ff;
  --color-howto: #06b6d4;
  --color-howto-light: #cffafe;
  --color-explanation: #f59e0b;
  --color-explanation-light: #fef3c7;
}

/* themes/dark.css */
[data-theme="dark"] {
  /* Dark Theme Colors */
  --color-background: #0f172a;
  --color-background-secondary: #1e293b;
  --color-background-tertiary: #334155;
  
  /* Text Colors */
  --color-text-primary: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #0f172a;
  
  /* Border Colors */
  --color-border-primary: #334155;
  --color-border-secondary: #475569;
  --color-border-focus: #60a5fa;
  
  /* Brand Colors */
  --color-primary: #60a5fa;
  --color-primary-hover: #3b82f6;
  --color-primary-light: #1e3a8a;
  
  /* Semantic Colors */
  --color-success: #34d399;
  --color-success-light: #064e3b;
  --color-warning: #fbbf24;
  --color-warning-light: #78350f;
  --color-error: #f87171;
  --color-error-light: #7f1d1d;
  --color-info: #22d3ee;
  --color-info-light: #164e63;
  
  /* Code Colors */
  --color-code-background: #1e293b;
  --color-code-border: #334155;
  --color-code-text: #e2e8f0;
  --color-code-keyword: #a78bfa;
  --color-code-string: #34d399;
  --color-code-comment: #64748b;
  --color-code-number: #fca5a5;
  --color-code-function: #60a5fa;
  
  /* Interactive States */
  --color-hover: #334155;
  --color-active: #475569;
  --color-focus: #60a5fa;
  --color-focus-ring: rgb(96 165 250 / 0.5);
  
  /* Navigation */
  --color-nav-background: rgba(15, 23, 42, 0.8);
  --color-nav-border: rgba(51, 65, 85, 0.8);
  
  /* Content Type Colors */
  --color-tutorial: #a78bfa;
  --color-tutorial-light: #3730a3;
  --color-howto: #22d3ee;
  --color-howto-light: #164e63;
  --color-explanation: #fbbf24;
  --color-explanation-light: #78350f;
}

/* base/reset.css */
/* Modern CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: var(--line-height-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
  padding: 0;
}

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* base/typography.css */
/* Typography System */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h5 {
  font-size: var(--font-size-lg);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

h6 {
  font-size: var(--font-size-base);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  font-weight: var(--font-weight-semibold);
}

/* Paragraphs */
p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
  max-width: var(--content-width);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration-color: currentColor;
}

/* Lists */
ul,
ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
  max-width: var(--content-width);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

li::marker {
  color: var(--color-text-tertiary);
}

/* Nested lists */
li ul,
li ol {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Blockquotes */
blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--color-border-secondary);
  background-color: var(--color-background-secondary);
  border-radius: var(--radius-md);
  max-width: var(--content-width);
}

blockquote p {
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: 0;
}

/* Inline code */
code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875em;
  background-color: var(--color-code-background);
  color: var(--color-code-text);
  padding: 0.125em 0.25em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-code-border);
}

/* Emphasis */
strong,
b {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

em,
i {
  font-style: italic;
}

/* Small text */
small {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* Mark/highlight */
mark {
  background-color: var(--color-warning-light);
  color: var(--color-text-primary);
  padding: 0.125em 0.25em;
  border-radius: var(--radius-sm);
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background-color: var(--color-border-primary);
  margin: var(--space-8) 0;
  max-width: var(--content-width);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--font-size-sm);
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border-primary);
}

th {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  background-color: var(--color-background-secondary);
}

td {
  color: var(--color-text-secondary);
}

/* Responsive typography */
@media (max-width: 768px) {
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
  
  h3 {
    font-size: var(--font-size-xl);
  }
}

/* layouts/page.css */
/* Page Layout */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background);
}

/* Navigation */
.main-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--color-nav-background);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-nav-border);
  padding: var(--space-4) 0;
}

.nav-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-logo:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-base);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--color-text-primary);
  background-color: var(--color-hover);
  text-decoration: none;
}

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

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background-color: var(--color-background);
  border: 1px solid var(--color-border-secondary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border-focus);
  color: var(--color-text-primary);
}

/* Search Button */
.search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background-color: var(--color-background);
  border: 1px solid var(--color-border-secondary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: var(--space-2);
}

.search-button:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border-focus);
  color: var(--color-text-primary);
}

/* Search Modal */
.search-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 600px);
  max-height: 80vh;
  background-color: var(--color-background);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.search-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-primary);
  gap: var(--space-3);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--font-size-lg);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

.search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-base);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-2);
}

.search-result {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius-base);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--color-border-primary);
}

.search-result:hover {
  background-color: var(--color-hover);
  text-decoration: none;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
}

.search-result-excerpt {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-1);
}

.search-result-type {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-transform: capitalize;
}

.search-empty,
.search-loading,
.search-error {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.search-error {
  color: var(--color-error);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
  width: 100%;
}

/* Article Layout */
.article {
  max-width: var(--content-width-wide);
  margin: 0 auto;
}

.article-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-primary);
}

.article-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.article-description {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-6);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.article-date {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.article-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.article-tag {
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.article-tag:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border-focus);
  color: var(--color-text-primary);
  text-decoration: none;
}

.article-content {
  line-height: var(--line-height-loose);
}

/* Table of Contents */
.table-of-contents {
  position: sticky;
  top: calc(var(--space-20) + var(--space-4));
  float: right;
  width: 250px;
  margin-left: var(--space-8);
  margin-bottom: var(--space-8);
  padding: var(--space-4);
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
}

.table-of-contents h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  margin-top: 0;
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents li {
  margin-bottom: var(--space-2);
}

.table-of-contents a {
  color: var(--color-text-secondary);
  text-decoration: none;
  display: block;
  padding: var(--space-1) 0;
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
  transition: all 0.2s ease;
}

.table-of-contents a:hover {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  text-decoration: none;
}

.table-of-contents a.active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

/* Footer */
.main-footer {
  margin-top: auto;
  padding: var(--space-8) var(--space-4);
  border-top: 1px solid var(--color-border-primary);
  background-color: var(--color-background-secondary);
}

.footer-container {
  max-width: var(--container-width);
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .table-of-contents {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 var(--space-3);
  }
  
  .nav-links {
    gap: var(--space-3);
  }
  
  .nav-link {
    padding: var(--space-2);
    font-size: var(--font-size-xs);
  }
  
  /* Mobile Search Button */
  .search-button {
    margin-left: var(--space-1);
    width: 2.25rem;
    height: 2.25rem;
  }
  
  /* Mobile Search Modal */
  .search-modal {
    width: 95vw;
    max-height: 85vh;
  }
  
  .search-modal-header {
    padding: var(--space-3);
  }
  
  .search-input {
    font-size: var(--font-size-base);
  }
  
  .main-content {
    padding: var(--space-6) var(--space-3);
  }
  
  .article-title {
    font-size: var(--font-size-3xl);
  }
  
  .article-description {
    font-size: var(--font-size-lg);
  }
  
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
  }
  
  /* Very small screens - full width modal */
  .search-modal {
    width: 98vw;
    max-height: 90vh;
    top: 5%;
    transform: translateX(-50%);
  }
  
  .search-modal-header {
    padding: var(--space-2);
    gap: var(--space-2);
  }
  
  .search-input {
    font-size: var(--font-size-sm);
  }
  
  .search-results {
    padding: var(--space-1);
  }
  
  .search-result {
    padding: var(--space-2);
  }
  
  .main-content {
    padding: var(--space-4) var(--space-2);
  }
  
  .article-title {
    font-size: var(--font-size-2xl);
  }
}

/* components/code-blocks.css */
/* Code Block Styles */
.code-block {
  margin: var(--space-6) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-primary);
  background-color: var(--color-code-background);
  box-shadow: var(--shadow-sm);
  position: relative;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-background-secondary);
  border-bottom: 1px solid var(--color-border-primary);
  font-size: var(--font-size-sm);
}

.code-language {
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
}

.code-copy-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-background);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-base);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.code-block:hover .code-copy-button {
  opacity: 1;
}

.code-copy-button:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border-focus);
  color: var(--color-text-primary);
}

.code-copy-button:active {
  background-color: var(--color-active);
}

.code-copy-button.copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

.code-content {
  position: relative;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  padding: var(--space-4);
  background: transparent;
  color: var(--color-code-text);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  overflow-x: auto;
  white-space: pre;
}

.code-block code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Line numbers */
.code-block.with-line-numbers {
  display: grid;
  grid-template-columns: auto 1fr;
}

.code-line-numbers {
  padding: var(--space-4) var(--space-3) var(--space-4) var(--space-4);
  background-color: var(--color-background-tertiary);
  border-right: 1px solid var(--color-border-primary);
  color: var(--color-text-tertiary);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  text-align: right;
  user-select: none;
  white-space: pre;
}

/* Syntax highlighting tokens */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--color-code-comment);
  font-style: italic;
}

.token.punctuation {
  color: var(--color-text-secondary);
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--color-code-number);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--color-code-string);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--color-text-primary);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: var(--color-code-keyword);
}

.token.function,
.token.class-name {
  color: var(--color-code-function);
}

.token.regex,
.token.important,
.token.variable {
  color: var(--color-primary);
}

/* Shiki Transformer Styles */

/* Highlighted lines */
.code-line.highlighted,
.line.highlighted {
  background-color: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--color-primary);
  padding-left: calc(var(--space-4) - 3px);
}

/* Diff highlighting */
.code-line.added,
.line.diff.add {
  background-color: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--color-success);
  padding-left: calc(var(--space-4) - 3px);
}

.code-line.removed,
.line.diff.remove {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--color-error);
  padding-left: calc(var(--space-4) - 3px);
}

/* Focus mode */
.has-focused .line:not(.focused) {
  filter: blur(0.095rem);
  opacity: 0.4;
  transition: filter 0.35s, opacity 0.35s;
}

.has-focused:hover .line:not(.focused) {
  filter: blur(0);
  opacity: 1;
}

.line.focused {
  opacity: 1;
  filter: blur(0);
}

/* Word highlighting */
.highlighted-word {
  background-color: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
}

/* Error and warning annotations */
.line.error {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--color-error);
  padding-left: calc(var(--space-4) - 3px);
}

.line.warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--color-warning);
  padding-left: calc(var(--space-4) - 3px);
}

/* Diff symbols */
.line.diff.add::before {
  content: '+';
  color: var(--color-success);
  margin-right: var(--space-2);
  font-weight: bold;
}

.line.diff.remove::before {
  content: '-';
  color: var(--color-error);
  margin-right: var(--space-2);
  font-weight: bold;
}

/* Responsive code blocks */
@media (max-width: 768px) {
  .code-block {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .code-block pre {
    padding: var(--space-3);
    font-size: var(--font-size-xs);
  }
  
  .code-header {
    padding: var(--space-2) var(--space-3);
  }
  
  .code-copy-button {
    opacity: 1;
  }
}

/* Collapsible code blocks */
.code-block.collapsible {
  max-height: 400px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.code-block.collapsible.expanded {
  max-height: none;
}

.code-expand-button {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3);
  background: linear-gradient(transparent, var(--color-code-background));
  border: none;
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  text-align: center;
}

.code-expand-button:hover {
  color: var(--color-primary-hover);
}

/* Multi-Code Block Styles */
.multi-code-block {
  margin: var(--space-6) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-primary);
  background-color: var(--color-code-background);
  box-shadow: var(--shadow-sm);
  position: relative;
  max-width: 100%;
}

.multi-code-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-background-secondary);
  border-bottom: 1px solid var(--color-border-primary);
}

.multi-code-tab-container {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.multi-code-tab-container::-webkit-scrollbar {
  display: none;
}

.multi-code-tab {
  flex: 0 0 auto;
  padding: var(--space-3) var(--space-4);
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.multi-code-tab:hover {
  color: var(--color-text-secondary);
  background-color: var(--color-hover);
}

.multi-code-tab.active {
  color: var(--color-text-primary);
  background-color: var(--color-code-background);
  border-bottom-color: var(--color-primary);
}

.multi-code-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--color-code-background);
}

.multi-code-content {
  position: relative;
}

.multi-code-content .code-block {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background-color: transparent;
}

.multi-code-content .code-header {
  display: none;
}

.multi-code-copy-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  margin-left: auto;
  margin-right: var(--space-4);
  background-color: var(--color-background);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-base);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.multi-code-copy-button:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border-focus);
  color: var(--color-text-primary);
}

.multi-code-copy-button:active {
  background-color: var(--color-active);
}

.multi-code-copy-button.copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

/* Responsive multi-code blocks */
@media (max-width: 768px) {
  .multi-code-block {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .multi-code-tab {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
}

/* components/callouts.css */
/* Callout Styles */
.callout {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  background-color: var(--color-background-secondary);
  max-width: var(--content-width);
  position: relative;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.callout-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.callout-title {
  color: var(--color-text-primary);
  margin: 0;
}

.callout-content {
  color: var(--color-text-secondary);
}

.callout-content p:last-child {
  margin-bottom: 0;
}

.callout-content ul,
.callout-content ol {
  margin-bottom: var(--space-3);
}

.callout-content li:last-child {
  margin-bottom: 0;
}

/* Callout Types */
.callout.note {
  border-left-color: var(--color-info);
  background-color: var(--color-info-light);
}

.callout.note .callout-header {
  color: var(--color-info);
}

.callout.warning {
  border-left-color: var(--color-warning);
  background-color: var(--color-warning-light);
}

.callout.warning .callout-header {
  color: var(--color-warning);
}

.callout.error {
  border-left-color: var(--color-error);
  background-color: var(--color-error-light);
}

.callout.error .callout-header {
  color: var(--color-error);
}

.callout.success {
  border-left-color: var(--color-success);
  background-color: var(--color-success-light);
}

.callout.success .callout-header {
  color: var(--color-success);
}

.callout.info {
  border-left-color: var(--color-info);
  background-color: var(--color-info-light);
}

.callout.info .callout-header {
  color: var(--color-info);
}

/* Responsive callouts */
@media (max-width: 768px) {
  .callout {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
    border-left-width: 4px;
    border-right: none;
  }
}

/* components/content-types.css */
/* Content Type Styles */

/* Tutorial Styles */
.tutorial {
  position: relative;
}

.tutorial-header {
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--color-tutorial-light), transparent);
  border: 1px solid var(--color-tutorial);
  border-radius: var(--radius-lg);
  position: relative;
}

.tutorial-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-tutorial);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
}

.tutorial-title {
  font-size: var(--font-size-3xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  margin-top: 0;
}

.tutorial-description {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
}

.tutorial-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.difficulty-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.difficulty-badge.beginner {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.difficulty-badge.intermediate {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
}

.difficulty-badge.advanced {
  background-color: var(--color-error-light);
  color: var(--color-error);
}

/* How-to Styles */
.howto {
  position: relative;
}

.howto-header {
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--color-howto-light), transparent);
  border: 1px solid var(--color-howto);
  border-radius: var(--radius-lg);
}

.howto-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-howto);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
}

.howto-title {
  font-size: var(--font-size-3xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  margin-top: 0;
}

.howto-task {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-4);
}

/* Explanation Styles */
.explanation {
  position: relative;
}

.explanation-header {
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--color-explanation-light), transparent);
  border: 1px solid var(--color-explanation);
  border-radius: var(--radius-lg);
}

.explanation-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-explanation);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-4);
}

.explanation-title {
  font-size: var(--font-size-3xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  margin-top: 0;
}

.explanation-concept {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-4);
}

/* Progress Indicator for Tutorials */
.tutorial-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-background-tertiary);
  z-index: var(--z-fixed);
}

.tutorial-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-tutorial), var(--color-primary));
  width: 0%;
  transition: width 0.3s ease;
}

/* Step Counter for Tutorials */
.tutorial-step {
  position: relative;
  margin: var(--space-8) 0;
  padding-left: var(--space-8);
}

.tutorial-step::before {
  content: counter(tutorial-step);
  counter-increment: tutorial-step;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--space-6);
  height: var(--space-6);
  background-color: var(--color-tutorial);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.tutorial-content {
  counter-reset: tutorial-step;
}

/* Quick Reference Cards for How-tos */
.quick-reference {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background-color: var(--color-background-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-howto);
}

.quick-reference-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  margin-top: 0;
}

.quick-reference-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quick-reference-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-base);
  transition: background-color 0.2s ease;
}

.quick-reference-item:hover {
  background-color: var(--color-hover);
}

.quick-reference-number {
  flex-shrink: 0;
  width: var(--space-5);
  height: var(--space-5);
  background-color: var(--color-howto);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}

/* Concept Diagrams for Explanations */
.concept-diagram {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background-color: var(--color-background-secondary);
  border: 2px dashed var(--color-border-secondary);
  border-radius: var(--radius-lg);
  text-align: center;
}

.concept-diagram-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.concept-diagram-content {
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Responsive Content Types */
@media (max-width: 768px) {
  .tutorial-header,
  .howto-header,
  .explanation-header {
    padding: var(--space-4);
    margin-left: calc(-1 * var(--space-3));
    margin-right: calc(-1 * var(--space-3));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .tutorial-title,
  .howto-title,
  .explanation-title {
    font-size: var(--font-size-2xl);
  }
  
  .tutorial-description,
  .howto-task,
  .explanation-concept {
    font-size: var(--font-size-base);
  }
  
  .tutorial-step {
    padding-left: var(--space-6);
  }
  
  .tutorial-step::before {
    width: var(--space-5);
    height: var(--space-5);
    font-size: var(--font-size-xs);
  }
  
  .quick-reference {
    margin-left: calc(-1 * var(--space-3));
    margin-right: calc(-1 * var(--space-3));
    border-radius: 0;
    border-left-width: 4px;
    border-right: none;
  }
}

/* components/mathjax.css */
/* MathJax component styles */
div.mathjax-container.display {
	margin: 1.5rem 0;
	text-align: center;
}

span.mathjax-container.inline {
	display: inline;
}

/* MathJax rendered content */
.mathjax-container mjx-container {
	display: inline-block;
	font-size: inherit;
	line-height: 1;
}

div.mathjax-container.display mjx-container {
	display: block;
	text-align: center;
	margin: 1rem auto;
	max-width: 100%;
	overflow-x: auto;
}

span.mathjax-container.inline mjx-container {
	display: inline;
	vertical-align: baseline;
}

/* Ensure MathJax math elements are properly styled */
.mathjax-container mjx-math {
	display: inline-block;
	font-size: inherit;
}

div.mathjax-container.display mjx-math {
	display: block;
	margin: 0 auto;
}

span.mathjax-container.inline mjx-math {
	display: inline;
	vertical-align: baseline;
}

/* Handle MathJax assistive elements */
.mathjax-container mjx-assistive-mml {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	padding: 1px 0 0 0 !important;
	border: 0 !important;
	height: 1px !important;
	width: 1px !important;
	overflow: hidden !important;
}

/* Fallback styles when MathJax fails to load */
.math-fallback {
	font-family: 'Computer Modern', 'Times New Roman', serif;
	background: var(--color-surface-secondary);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 1rem;
	overflow-x: auto;
	white-space: pre-wrap;
	line-height: 1.6;
}

.math-fallback pre {
	margin: 0;
	font-family: inherit;
	background: none;
	border: none;
	padding: 0;
}

.math-fallback code {
	font-family: inherit;
	background: none;
	border: none;
	padding: 0;
	font-size: inherit;
}

/* Inline fallback styling */
span.mathjax-container.inline .math-fallback {
	display: inline;
	background: var(--color-surface-tertiary);
	border-radius: 4px;
	padding: 0.2rem 0.4rem;
	margin: 0;
	font-size: 0.9em;
}

/* Display fallback styling */
div.mathjax-container.display .math-fallback {
	display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.mathjax-container.display {
		margin: 1rem 0;
	}
	
	.math-fallback {
		font-size: 0.9em;
		padding: 0.75rem;
	}
}

/* main.css */
/* Main CSS Entry Point */

/* Base Styles */
@import './base/variables.css';
@import './themes/light.css';
@import './themes/dark.css';
@import './base/reset.css';
@import './base/typography.css';

/* Layout Styles */
@import './layouts/page.css';

/* Component Styles */
@import './components/code-blocks.css';
@import './components/callouts.css';
@import './components/content-types.css';
@import './components/mathjax.css';

/* Utility Classes */
.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;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-mono {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

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

.text-secondary {
  color: var(--color-text-secondary);
}

.text-tertiary {
  color: var(--color-text-tertiary);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-background-secondary);
}

.border-primary {
  border-color: var(--color-border-primary);
}

.rounded {
  border-radius: var(--radius-base);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow {
  box-shadow: var(--shadow-base);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Animation Utilities */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Homepage Styles */
.app {
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text-primary);
}

.header {
  text-align: center;
  padding: var(--space-8) var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border-primary);
  margin-bottom: var(--space-6);
}

.header h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-3) 0;
}

.header p {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-8);
}

.search-controls {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  align-items: center;
}

.search-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-base);
  background-color: var(--color-background);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

.type-filter,
.sort-filter {
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--color-border-primary);
	border-radius: var(--radius-base);
	background-color: var(--color-background);
	color: var(--color-text-primary);
	font-size: var(--font-size-base);
	min-width: 150px;
}

.type-filter:focus,
.sort-filter:focus {
	outline: none;
	border-color: var(--color-border-focus);
	box-shadow: 0 0 0 3px var(--color-primary-light);
}
.posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.post {
  padding: var(--space-5);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  background-color: var(--color-background);
  transition: all 0.2s ease;
}

.post:hover {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-base);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
  gap: var(--space-4);
}

.post-header h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.post-header h2 a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-header h2 a:hover {
  color: var(--color-primary);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.type-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: capitalize;
}

.type-badge.tutorial {
  background-color: var(--color-tutorial-light);
  color: var(--color-tutorial);
  border: 1px solid var(--color-tutorial);
}

.type-badge.howto {
  background-color: var(--color-howto-light);
  color: var(--color-howto);
  border: 1px solid var(--color-howto);
}

.type-badge.explanation {
  background-color: var(--color-explanation-light);
  color: var(--color-explanation);
  border: 1px solid var(--color-explanation);
}

.post-meta time {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

.post-description {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: var(--space-4);
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--color-border-primary);
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.no-results {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-secondary);
}

.no-results p {
  margin-bottom: var(--space-2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: var(--space-6) var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
  }
  
  .header h1 {
    font-size: var(--font-size-3xl);
  }
  
  .header p {
    font-size: var(--font-size-base);
  }
  
  .main {
    padding: 0 var(--space-3) var(--space-6);
  }
  
  .search-controls {
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
  }
  
	.type-filter,
	.sort-filter {
		min-width: auto;
		width: 100%;
	}  
  .posts {
    gap: var(--space-3);
  }
  
  .post {
    padding: var(--space-4);
  }
  
  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
  }
  
  .post-meta {
    align-self: stretch;
    justify-content: space-between;
  }
  
  .no-results {
    padding: var(--space-6);
  }
}

@media (max-width: 480px) {
  .header {
    padding: var(--space-4) var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
  }
  
  .header h1 {
    font-size: var(--font-size-2xl);
  }
  
  .header p {
    font-size: var(--font-size-sm);
  }
  
  .main {
    padding: 0 var(--space-2) var(--space-4);
  }
  
  .search-controls {
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }
  
	.search-input,
	.type-filter,
	.sort-filter {
		padding: var(--space-2) var(--space-3);
		font-size: var(--font-size-sm);
	}  
  .posts {
    gap: var(--space-2);
  }
  
  .post {
    padding: var(--space-3);
  }
  
  .post-header h2 {
    font-size: var(--font-size-lg);
  }
  
  .no-results {
    padding: var(--space-4);
  }
}

/* Print Styles */
@media print {
  .main-nav,
  .theme-toggle,
  .table-of-contents,
  .code-copy-button {
    display: none !important;
  }
  
  .main-content {
    max-width: none;
    padding: 0;
  }
  
  .article {
    max-width: none;
  }
  
  .code-block {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
  
  .callout {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
  
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* public/homepage.css */
/* Homepage Styles */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #059669;
  --warning-color: #d97706;
  --error-color: #dc2626;
  --background: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
  margin: 0;
  padding: 0;
}

.app {
  min-height: 100vh;
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin: 0 0 1rem 0;
  opacity: 0.9;
}

.hero-description {
  font-size: 1rem;
  margin: 0 0 2rem 0;
  opacity: 0.8;
}

.hero-description a {
  color: #bfdbfe;
  text-decoration: underline;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Sections */
section {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

section h2 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 2rem 0;
  text-align: center;
  color: var(--text-primary);
}

/* Content Type Cards */
.content-types {
  background-color: var(--surface);
}

.content-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.content-type-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.content-type-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.content-type-card p {
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
}

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

/* Featured Content */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.featured-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.featured-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.featured-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

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

.featured-card h3 a:hover {
  color: var(--primary-color);
}

.featured-card p {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.card-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Badges */
.content-type-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.difficulty-badge {
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

/* Search Section */
.search-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-input-wrapper {
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--background);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.type-filter {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--background);
  color: var(--text-primary);
  min-width: 150px;
}

/* Content List */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.content-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}

.content-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.content-item h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.content-item h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.content-item h3 a:hover {
  color: var(--primary-color);
}

.content-item-meta {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.content-description {
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.content-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

/* Getting Started */
.getting-started {
  background-color: var(--surface);
}

.getting-started-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.quick-start {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.quick-start h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.quick-start p {
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
}

.cta-button {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.cta-button:hover {
  background: var(--primary-hover);
}

/* Development Info */
.dev-info {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.dev-info details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.dev-info summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}

.dev-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.dev-content code {
  background: var(--surface);
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.routes-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.routes-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.routes-list li:last-child {
  border-bottom: none;
}

.routes-list a {
  color: var(--primary-color);
  text-decoration: none;
}

.routes-list a:hover {
  text-decoration: underline;
}

.route-type {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
  }
  
  section {
    padding: 2rem 1rem;
  }
  
  .search-controls {
    flex-direction: column;
  }
  
  .content-item-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .content-item-meta {
    margin-top: 0.5rem;
  }
  
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .content-type-grid,
  .featured-grid,
  .getting-started-content {
    grid-template-columns: 1fr;
  }
  
  .stats {
    grid-template-columns: 1fr;
  }
}

/* Draft Styles */
.draft-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-base);
  margin-bottom: var(--space-6);
  padding: var(--space-4);
}

.draft-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #92400e;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.draft-banner svg {
  flex-shrink: 0;
  color: #f59e0b;
}

.draft-content .article-title::before {
  content: "DRAFT: ";
  color: #f59e0b;
  font-weight: var(--font-weight-bold);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .draft-banner {
  background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
  border-color: #f59e0b;
}

[data-theme="dark"] .draft-banner-content {
  color: #fbbf24;
}

/* Utility Classes */
.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;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-mono {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

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

.text-secondary {
  color: var(--color-text-secondary);
}

.text-tertiary {
  color: var(--color-text-tertiary);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-background-secondary);
}

.border-primary {
  border-color: var(--color-border-primary);
}

.rounded {
  border-radius: var(--radius-base);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow {
  box-shadow: var(--shadow-base);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Animation Utilities */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Print Styles */
@media print {
  .main-nav,
  .theme-toggle,
  .table-of-contents,
  .code-copy-button {
    display: none !important;
  }

  .main-content {
    max-width: none;
    padding: 0;
  }

  .article {
    max-width: none;
  }

  .code-block {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  .callout {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}