* {
  box-sizing: border-box;
}

:root {
  --color-header: #e8e8e8;
  --color-sidebar: #c8e6c9;
  --color-main: #fff9e6;
  --header-height: 60px;
  --sidebar-width: 300px;
  --font-mono: 'Roboto Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-main);
  color: #333;
}

.layout-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-header);
  height: var(--header-height);
  border-bottom: 1px solid #ddd;
  transition: transform 0.3s ease;
}

.header-content {
  max-width: 100%;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

/* Sticky reveal animation */
.header.hide {
  transform: translateY(-100%);
}

/* Layout wrapper */
.layout-wrapper {
  display: flex;
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-sidebar);
  padding: 2rem 1.5rem;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
}

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

.nav-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.nav-sidebar li {
  margin-bottom: 1rem;
}

.nav-sidebar a {
  text-decoration: none;
  color: #333;
  transition: color 0.2s ease;
  display: block;
  padding: 0.5rem 0;
}

.nav-sidebar a:hover {
  color: #0d6efd;
  text-decoration: underline;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 2rem;
  background-color: var(--color-main);
  overflow-y: auto;
}

.main-content h1 {
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #222;
}

.main-content h2 {
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #333;
}

.main-content p {
  line-height: 1.6;
  color: #555;
  margin-bottom: 1rem;
}

/* Articles list */
.article-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}

.article-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

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

.article-date {
  font-size: 0.9rem;
  color: #888;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
}

.article-description {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
    --header-height: 50px;
  }

  .layout-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #ddd;
    padding: 1rem;
  }

  .nav-sidebar ul {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

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

  .main-content {
    padding: 1.5rem;
  }

  .header-content {
    padding: 0 1rem;
  }

  .header h1 {
    font-size: 1.25rem;
  }
}

/* Article content */
.article-content {
  line-height: 1.7;
  max-width: 800px;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.article-content code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-content pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

.article-content pre code {
  padding: 0;
  background: none;
}
