/* ================================================
   MODERN BLOG DESIGN SYSTEM
   Premium aesthetics with dark mode support
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:wght@300;400;700&display=swap');

/* ================================================
   CSS CUSTOM PROPERTIES - DESIGN TOKENS
   ================================================ */

:root {
  /* Brand Colors */
  --primary-hue: 240;
  --primary-500: hsl(var(--primary-hue), 70%, 60%);
  --primary-600: hsl(var(--primary-hue), 75%, 50%);
  --primary-700: hsl(var(--primary-hue), 80%, 40%);

  /* Accent Colors */
  --accent-hue: 280;
  --accent-500: hsl(var(--accent-hue), 75%, 65%);
  --accent-600: hsl(var(--accent-hue), 80%, 55%);

  /* Light Mode */
  --bg-primary: hsl(0, 0%, 100%);
  --bg-secondary: hsl(220, 15%, 97%);
  --bg-tertiary: hsl(220, 15%, 93%);
  --text-primary: hsl(220, 20%, 15%);
  --text-secondary: hsl(220, 15%, 40%);
  --text-tertiary: hsl(220, 10%, 60%);
  --border-color: hsl(220, 15%, 88%);
  --shadow-color: hsl(220, 20%, 15%);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
  --gradient-hero: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Layout */
  --max-width-content: 1280px;
  --max-width-text: 720px;
  --header-height: 4rem;
  /* Batik Pattern Tokens */
  --batik-color-primary: rgba(100, 100, 255, 0.03);
  --batik-color-secondary: rgba(74, 20, 140, 0.04);
  --batik-blend: normal;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-primary: hsl(220, 20%, 10%);
  --bg-secondary: hsl(220, 18%, 14%);
  --bg-tertiary: hsl(220, 16%, 18%);
  --text-primary: hsl(220, 15%, 95%);
  --text-secondary: hsl(220, 12%, 75%);
  --text-tertiary: hsl(220, 10%, 55%);
  --border-color: hsl(220, 15%, 25%);
  --shadow-color: hsl(0, 0%, 0%);

  --gradient-hero: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

  /* Dark Mode Batik */
  --batik-color-primary: rgba(100, 100, 255, 0.05);
  --batik-color-secondary: rgba(74, 20, 140, 0.1);
  --batik-blend: overlay;
}

/* ================================================
   RESET & BASE STYLES
   ================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-600);
}

/* ================================================
   LAYOUT UTILITIES
   ================================================ */

.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.content-wrapper {
  max-width: var(--max-width-text);
  margin-left: auto;
  margin-right: auto;
}

/* ================================================
   HEADER & NAVIGATION
   ================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(var(--bg-primary), 0.9);
  height: var(--header-height);
  transition: all var(--transition-base);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  font-size: var(--text-xl);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform var(--transition-fast);
}

.site-logo:hover {
  transform: scale(1.05);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

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

.nav-link:hover::after {
  width: 100%;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition-base);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-500);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ================================================
   HERO SECTION
   ================================================ */

.hero {
  background: var(--gradient-hero);
  /* Batik-inspired CSS Pattern */
  background-image:
    radial-gradient(circle at 50% 50%, transparent 50%, var(--batik-color-primary) 50%, var(--batik-color-primary) 60%, transparent 60%),
    linear-gradient(45deg, var(--batik-color-secondary) 25%, transparent 25%, transparent 75%, var(--batik-color-secondary) 75%, var(--batik-color-secondary)),
    linear-gradient(135deg, var(--batik-color-secondary) 25%, transparent 25%, transparent 75%, var(--batik-color-secondary) 75%, var(--batik-color-secondary));
  background-size: 60px 60px, 40px 40px, 40px 40px;
  background-position: 0 0, 0 0, 20px 20px;
  background-blend-mode: var(--batik-blend);
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, var(--primary-500) 0%, transparent 60%);
  opacity: 0.1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease;
}

.hero-description {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto var(--space-xl);
  animation: fadeInUp 0.8s ease 0.2s backwards;
  padding: 0 var(--space-lg);
}

/* ================================================
   SEARCH & FILTERS
   ================================================ */

.search-section {
  padding: var(--space-2xl) 0;
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-3xl);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: all var(--transition-base);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px hsla(var(--primary-hue), 70%, 60%, 0.1);
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.filter-tag {
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tag:hover,
.filter-tag.active {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ================================================
   BLOG POST GRID
   ================================================ */

.posts-section {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-500);
}

.post-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gradient-primary);
}

.post-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.post-date,
.post-reading-time {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.post-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.post-excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  flex: 1;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: auto;
}

.post-tag {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ================================================
   FOOTER
   ================================================ */

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-2xl) 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.footer-text {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.social-links {
  display: flex;
  gap: var(--space-md);
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  color: var(--text-secondary);
}

.social-link:hover {
  background: var(--primary-500);
  color: white;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

/* Tablet and below */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }
}

/* Mobile landscape and below */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.25rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --text-xl: 1.125rem;
    --space-3xl: 2.5rem;
    --space-2xl: 2rem;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: var(--text-sm);
  }

  .nav-link {
    font-size: var(--text-sm);
  }

  .theme-toggle {
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .hero {
    padding: var(--space-2xl) 0;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-description {
    font-size: var(--text-lg);
  }

  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .post-detail-title {
    font-size: var(--text-3xl);
  }

  .post-detail-content {
    font-size: var(--text-base);
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --space-2xl: 1.5rem;
  }

  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .search-container {
    gap: var(--space-md);
  }

  .filter-tags {
    gap: var(--space-xs);
  }

  .filter-tag {
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
  }

  .nav-menu {
    gap: var(--space-xs);
  }

  .nav-link {
    font-size: var(--text-xs);
  }

  .theme-toggle span {
    display: none;
  }

  .theme-toggle {
    padding: var(--space-sm);
    width: 36px;
    height: 36px;
    justify-content: center;
  }

  .hero {
    padding: var(--space-xl) 0;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-description {
    font-size: var(--text-base);
  }

  .post-card {
    border-radius: var(--radius-md);
  }

  .post-content {
    padding: var(--space-md);
  }
}


/* ================================================
   ENHANCED LAYOUT - SIDEBAR & TWO-COLUMN
   ================================================ */

.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-2xl);
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}

.main-content {
  min-width: 0;
  /* Prevent overflow */
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  max-height: calc(100vh - var(--header-height) - var(--space-2xl));
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.sidebar-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

/* ================================================
   POST DETAIL CONTENT STYLING
   ================================================ */

.post-detail {
  padding: var(--space-3xl) 0;
}

.post-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-color);
}

.post-detail-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

.post-detail-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.post-detail-thumbnail {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-xl);
}

.post-detail-content {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-detail-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  font-family: var(--font-sans);
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

.post-detail-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-family: var(--font-sans);
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

.post-detail-content p {
  margin-bottom: var(--space-lg);
}

/* Images dalam content - FULL WIDTH */
.post-detail-content img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-xl) 0;
  box-shadow: var(--shadow-md);
}

.post-detail-content ul,
.post-detail-content ol {
  margin: var(--space-lg) 0;
  padding-left: var(--space-2xl);
}

.post-detail-content li {
  margin-bottom: var(--space-sm);
  line-height: 1.8;
}

.post-detail-content blockquote {
  border-left: 4px solid var(--primary-500);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--text-tertiary);
}

.post-detail-content code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
}

.post-detail-content pre {
  background: var(--bg-tertiary);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-xl) 0;
  border: 1px solid var(--border-color);
}

.post-detail-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.post-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-color);
}

.detail-tag {
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.share-section {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.share-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.share-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.share-btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.share-btn:hover {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ================================================
   COMMENTS SECTION
   ================================================ */

.comments-section {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 2px solid var(--border-color);
}

.comments-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.comments-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: var(--text-base);
  line-height: 1.6;
}

#disqus_thread {
  margin-top: var(--space-xl);
}

/* Disqus iframe styling adjustments */
#disqus_thread iframe {
  border-radius: var(--radius-md);
}

/* ================================================
   TABLE OF CONTENTS
   ================================================ */

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

.toc-item {
  margin-bottom: var(--space-xs);
}

.toc-link {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

.toc-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-left-color: var(--primary-500);
  padding-left: var(--space-md);
}

.toc-link.active {
  color: var(--primary-500);
  background: var(--bg-tertiary);
  border-left-color: var(--primary-500);
  font-weight: 600;
  padding-left: var(--space-md);
}

.toc-item.toc-h3 {
  margin-left: var(--space-md);
}

.toc-item.toc-h3 .toc-link {
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* ================================================
   DOWNLOAD SECTION
   ================================================ */

.download-box {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  color: white;
  text-align: center;
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.download-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: white;
}

.download-desc {
  font-size: var(--text-xs);
  opacity: 0.9;
  margin-bottom: var(--space-md);
  color: white;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: white;
  color: var(--primary-600);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ================================================
   READING PROGRESS BAR
   ================================================ */

.reading-progress {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bg-tertiary);
  z-index: 99;
}

.reading-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 150ms ease;
}

/* ================================================
   BREADCRUMB NAVIGATION
   ================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumb-link {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
  color: var(--primary-500);
}

.breadcrumb-separator {
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* ================================================
   ALERT BOXES
   ================================================ */

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  border-left: 4px solid;
  display: flex;
  gap: var(--space-md);
  align-items: start;
}

.alert-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  margin-bottom: var(--space-xs);
  font-size: var(--text-base);
}

.alert-info {
  background: hsl(210, 100%, 95%);
  border-left-color: hsl(210, 100%, 50%);
  color: hsl(210, 100%, 25%);
}

[data-theme="dark"] .alert-info {
  background: hsl(210, 100%, 15%);
  border-left-color: hsl(210, 100%, 50%);
  color: hsl(210, 100%, 80%);
}

.alert-warning {
  background: hsl(45, 100%, 95%);
  border-left-color: hsl(45, 100%, 50%);
  color: hsl(45, 100%, 20%);
}

[data-theme="dark"] .alert-warning {
  background: hsl(45, 100%, 15%);
  border-left-color: hsl(45, 100%, 50%);
  color: hsl(45, 100%, 80%);
}

.alert-success {
  background: hsl(142, 76%, 95%);
  border-left-color: hsl(142, 76%, 36%);
  color: hsl(142, 76%, 20%);
}

[data-theme="dark"] .alert-success {
  background: hsl(142, 76%, 15%);
  border-left-color: hsl(142, 76%, 45%);
  color: hsl(142, 76%, 80%);
}

.alert-danger {
  background: hsl(0, 84%, 95%);
  border-left-color: hsl(0, 84%, 60%);
  color: hsl(0, 84%, 25%);
}

[data-theme="dark"] .alert-danger {
  background: hsl(0, 84%, 15%);
  border-left-color: hsl(0, 84%, 60%);
  color: hsl(0, 84%, 80%);
}

/* ================================================
   CODE BLOCKS ENHANCED
   ================================================ */

.code-block-wrapper {
  position: relative;
  margin: var(--space-xl) 0;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.code-language {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.copy-code-btn {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.copy-code-btn:hover {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

.copy-code-btn.copied {
  background: hsl(142, 76%, 45%);
  color: white;
  border-color: hsl(142, 76%, 45%);
}

/* ================================================
   RELATED POSTS
   ================================================ */

.related-post {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: var(--space-sm);
}

.related-post:hover {
  background: var(--bg-tertiary);
}

.related-post-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.related-post-info {
  flex: 1;
  min-width: 0;
}

.related-post-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.related-post-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ================================================
   HOMEPAGE SIDEBAR
   ================================================ */

.homepage-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.widget-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

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

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-item:last-child {
  border-bottom: none;
}

.category-item:hover {
  color: var(--primary-500);
  padding-left: var(--space-xs);
}

.category-name {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.category-count {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ================================================
   ARCHIVE PAGE STYLES - SIMPLE LIST TOC
   ================================================ */

.archive-page {
  padding: var(--space-3xl) 0;
  min-height: calc(100vh - var(--header-height));
}

.archive-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 2px solid var(--border-color);
}

.archive-title {
  font-size: var(--text-5xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Simple Stats */
.archive-controls {
  margin-bottom: var(--space-3xl);
}

.archive-stats-simple {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.stat-simple {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.stat-simple strong {
  color: var(--primary-500);
  font-size: var(--text-xl);
  font-weight: 700;
}

/* Simple Search */
.search-box-simple {
  max-width: 600px;
  margin: 0 auto;
}

/* TOC List by Category */
.toc-list {
  max-width: 900px;
  margin: 0 auto;
}

.toc-category-section {
  margin-bottom: var(--space-3xl);
}

.toc-category-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 3px solid var(--primary-500);
}

.category-icon {
  font-size: var(--text-3xl);
}

.category-count {
  margin-left: auto;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  background: var(--primary-500);
  color: white;
  border-radius: var(--radius-full);
}

/* Article List */
.toc-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.toc-article-item {
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
}

.toc-article-item:hover {
  background: var(--bg-tertiary);
  border-left-width: 6px;
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.toc-article-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.toc-article-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  line-height: 1.4;
}

.toc-article-item:hover .toc-article-title {
  color: var(--primary-500);
}

.toc-article-meta {
  display: flex;
  gap: var(--space-md);
  flex-shrink: 0;
}

.toc-meta-item {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.toc-article-excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.toc-tag {
  padding: 2px var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-tertiary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.empty-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-description {
  color: var(--text-tertiary);
  max-width: 400px;
}

/* Active Nav Link */
.nav-link.active {
  color: var(--primary-500);
  font-weight: 600;
}

.nav-link.active::after {
  width: 100%;
}

/* Responsive TOC */
@media (max-width: 768px) {
  .archive-stats-simple {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .toc-article-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .toc-article-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .toc-category-title {
    font-size: var(--text-xl);
  }
}

/* ================================================
   RESPONSIVE - SIDEBAR LAYOUT
   ================================================ */

.archive-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-500);
}

.stat-number {
  font-size: var(--text-4xl);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Filters */
.archive-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-md);
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-select {
  padding: var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  transition: all var(--transition-base);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px hsla(var(--primary-hue), 70%, 60%, 0.1);
}

.filter-select:hover {
  border-color: var(--primary-500);
}

/* Archive List */
.archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-2xl);
}

.archive-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.archive-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-500);
}

.archive-item-thumbnail {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.archive-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.archive-item:hover .archive-item-thumbnail img {
  transform: scale(1.05);
}

.archive-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: var(--space-lg);
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.archive-item:hover .archive-item-overlay {
  transform: translateY(0);
}

.read-more-btn {
  color: white;
  font-weight: 600;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.archive-item-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.archive-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.archive-item-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-item-excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-item-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: auto;
}

.archive-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.archive-category {
  padding: var(--space-xs) var(--space-sm);
  background: var(--primary-500);
  color: white;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.archive-tag {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.archive-tag-more {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--primary-500);
  font-weight: 600;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-tertiary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.empty-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-description {
  color: var(--text-tertiary);
  max-width: 400px;
}

/* Active Nav Link */
.nav-link.active {
  color: var(--primary-500);
  font-weight: 600;
}

.nav-link.active::after {
  width: 100%;
}

/* Responsive Archive */
@media (max-width: 768px) {
  .archive-filters {
    grid-template-columns: 1fr;
  }

  .archive-list {
    grid-template-columns: 1fr;
  }

  .archive-stats {
    grid-template-columns: 1fr;
  }
}

/* ================================================
   RESPONSIVE - SIDEBAR LAYOUT
   ================================================ */

@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr 250px;
    gap: var(--space-lg);
  }

  .sidebar {
    font-size: var(--text-sm);
  }
}

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

  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
    order: -1;
    /* Move sidebar to top on mobile */
  }

  .reading-progress {
    display: none;
    /* Hide on mobile */
  }
}

/* ================================================
   SKELETON LOADING ANIMATION
   ================================================ */

.skeleton-loading {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg,
      var(--bg-tertiary) 0%,
      var(--bg-secondary) 50%,
      var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.post-thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 66.67%;
  /* 3:2 aspect ratio */
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.post-thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}