/* Custom CSS for mdBook blog */

:root {
  --content-max-width: 760px;
  --sidebar-width: 300px;
  --page-padding: 15px;
  --menu-bar-height: 50px;
}

/* Main content styling */
.content {
  max-width: var(--content-max-width);
  line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Improve typography */
h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.2rem;
  border-bottom: 2px solid var(--theme-hover);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
}

/* Code blocks */
pre {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  background-color: var(--inline-code-color);
}

/* Links */
a {
  color: var(--links);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Post list styling */
.content h3 a {
  color: var(--fg);
  font-weight: 600;
}

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

/* Blog post metadata */
.content p em {
  color: var(--fg-muted, #666);
  font-size: 0.95em;
}

/* Responsive design */
@media (max-width: 768px) {
  .content {
    padding: 0 var(--page-padding);
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
}

/* Dark mode improvements */
@media (prefers-color-scheme: dark) {
  :root {
    --fg-muted: #aaa;
  }
}

/* Light mode improvements */
@media (prefers-color-scheme: light) {
  :root {
    --fg-muted: #666;
  }
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--quote-border);
  background-color: var(--quote-bg);
  font-style: italic;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
}

th, td {
  border: 1px solid var(--table-border-color);
  padding: 0.75rem;
  text-align: left;
}

th {
  background-color: var(--table-header-bg);
  font-weight: 600;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

li {
  margin: 0.5rem 0;
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 1px solid var(--theme-hover);
  margin: 2rem 0;
}
