/* Basic styling */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Responsive media queries */
@media (max-width: 850px) {
  body {
    max-width: 95%;
  }
}

@media (max-width: 600px) {
  body {
    padding: 15px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    font-size: 1.3em;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  h1 {
    font-size: 1.6em;
  }
  
  h2 {
    font-size: 1.2em;
  }
  
  nav a {
    margin-right: 10px;
  }
}

header {
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

header .title {
  margin-bottom: 10px;
}

nav a {
  margin-right: 15px;
  text-decoration: none;
  color: #0366d6;
}

nav a:hover {
  text-decoration: underline;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 0;
}

@media (max-width: 480px) {
  .nav-links {
    gap: 10px;
  }
  
  nav a {
    margin-right: 0;
  }
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2em;
  padding-bottom: 0.3em;
}

h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
}

p, ul, ol {
  margin-bottom: 16px;
}

code {
  font-family: 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
}

pre {
  font-family: 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  word-wrap: normal;
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: #f6f8fa;
  border-radius: 3px;
}

pre code {
  background-color: transparent;
  padding: 0;
}

blockquote {
  padding: 0 1em;
  color: #6a737d;
  border-left: 0.25em solid #dfe2e5;
  margin: 0 0 16px 0;
}

blockquote.callout {
  padding: 0.75em 1em;
  color: #24292e;
  background-color: #f1f8ff;
  border-left: none;
  border-radius: 4px;
  margin: 1.5em 0;
}

blockquote.callout p:last-child,
blockquote.callout ul:last-child,
blockquote.callout ol:last-child {
  margin-bottom: 0;
}

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
  height: 0.2em;
  padding: 0;
  margin: 24px 0;
  background-color: #eaecef;
  border: 0;
}

/* Ensure code blocks have proper styling */
.highlight pre {
  margin-bottom: 0;
}

/* Tags */
.tag {
  background-color: white;
  border-radius: 3px;
  color: #555;
  display: inline-block;
  font-size: 0.8em;
  margin-right: 0.5em;
  padding: 0.2em 0.5em;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid #d5d5d5;
}

.tag:hover {
  background-color: #e9e9e9;
  color: #555;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-color: #d5d5d5;
}

.microblog-post:last-child {
  border-bottom: none;
}

.microblog-date {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 1em;
}

/* Blog list styles */
.blog-list, .blog-posts {
  list-style-type: none;
  padding: 0;
}
.blog-list li, .blog-posts li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.blog-title {
  text-align: left;
  margin-right: 20px;
  flex: 1;
}
.blog-date {
  text-align: right;
  color: #666;
  white-space: nowrap;
}

/* Responsive blog list for small screens */
@media (max-width: 480px) {
  .blog-list li, .blog-posts li {
    flex-direction: column;
  }
  .blog-title {
    margin-right: 0;
    margin-bottom: 5px;
  }
  .blog-date {
    text-align: left;
    font-size: 0.9em;
  }
}

/* Style for blog-posts in tagged pages */
.blog-posts li span {
  white-space: nowrap;
  color: #666;
  margin-right: 15px;
}

@media (max-width: 480px) {
  .blog-posts li {
    flex-direction: column;
    margin-bottom: 15px;
  }
  
  .blog-posts li span {
    margin-right: 0;
    margin-bottom: 5px;
    font-size: 0.9em;
  }
}

/* Make images responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Center Graphviz SVGs */
svg[aria-label^="graphviz"] {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

svg[aria-label^="graphviz"] text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Make code blocks responsive */
pre {
  max-width: 100%;
  overflow-x: auto;
}

/* Custom table styles for buffer pool tables */
.buffer-pool-table {
  width: auto;
  max-width: 350px;
  margin: 15px auto;
  border-collapse: collapse;
  font-size: 0.85em;
}

.buffer-pool-table th,
.buffer-pool-table td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid #ddd;
}

.buffer-pool-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
}

.buffer-pool-table td {
  background-color: #fff;
}

.buffer-pool-table tr:hover td {
  background-color: #f1f3f5;
}

/* Highlight clock hand position */
.buffer-pool-table td:contains("<-") {
  font-weight: bold;
  color: #e74c3c;
}

/* Responsive table for small screens */
@media (max-width: 600px) {
  .buffer-pool-table {
    font-size: 0.8em;
  }
  
  .buffer-pool-table th,
  .buffer-pool-table td {
    padding: 6px 8px;
  }
}

/* Benchmark table */
.benchmark-table {
  border-collapse: collapse;
  font-size: 0.9em;
  width: 80%;
  margin: 0 auto;
}

.benchmark-table th,
.benchmark-table td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: right;
}

.benchmark-table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.benchmark-table .highlight-row {
  background-color: #eef6f0;
}

.taxonomy-table {
  border-collapse: collapse;
  font-size: 0.9em;
  width: 100%;
}

.taxonomy-table th,
.taxonomy-table td {
  border: 1px solid #ddd;
  padding: 6px 10px;
  text-align: left;
}

.taxonomy-table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
}

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Alternative: Compact table style for state transitions */
.clock-replacer-state {
  width: auto;
  margin: 15px 0;
  display: inline-block;
}

.clock-replacer-state th {
  background-color: #e9ecef;
}

.clock-replacer-state td {
  min-width: 50px;
}
