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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
  color: #222;
  background: #fff;
  margin: 0;
  padding: 0;
}

a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
}
.site-title:hover { text-decoration: none; }

header nav a {
  margin-left: 1.5rem;
  color: #555;
  font-size: 0.95rem;
}
header nav a:hover { color: #222; text-decoration: none; }

/* Page wrapper: sidebar + main */
.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

/* Sidebar */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  padding-top: 3rem;
  position: sticky;
  top: 2rem;
}

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

.sidebar-nav li {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-nav a {
  font-size: 0.88rem;
  color: #333;
  line-height: 1.4;
}
.sidebar-nav a:hover { color: #0066cc; text-decoration: none; }

.sidebar-date {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.1rem;
}

/* Main content */
main {
  flex: 1;
  min-width: 0;
  max-width: 680px;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* Post list (index / tag pages) */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-item { margin-bottom: 2.5rem; }

.post-item .post-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.post-item .post-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.4rem;
}

.post-item .post-desc {
  margin: 0;
  color: #444;
  font-size: 0.97rem;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }

.tag {
  font-size: 0.78rem;
  color: #555;
  background: #f4f4f4;
  border-radius: 3px;
  padding: 0.15rem 0.55rem;
}
.tag:hover { background: #e8e8e8; text-decoration: none; color: #222; }

/* Single post */
.post-header { margin-bottom: 2.5rem; }
.post-header h1 { font-size: 2rem; margin: 0 0 0.75rem; line-height: 1.25; }
.post-description { display: block; font-size: 1.1rem; color: #555; margin: 0 0 0.75rem; line-height: 1.5; }
.post-header .post-meta { display: block; font-size: 0.88rem; color: #888; margin: 0; }

.post-body { max-width: 100%; }
.post-body h2 { font-size: 1.4rem; margin-top: 2.5rem; }
.post-body h3 { font-size: 1.15rem; margin-top: 2rem; }
.post-body p { margin: 1rem 0; }
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid #ddd;
  color: #555;
}
.post-body pre {
  background: #f6f6f6;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}
.post-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: #f6f6f6;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
.post-body pre code { background: none; padding: 0; font-size: inherit; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.5rem 0;
}
.post-body th, .post-body td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
}
.post-body th { font-weight: 600; border-bottom-color: #ccc; }

/* Page heading */
.page-heading {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 2rem;
}

/* Mobile: hide sidebar */
@media (max-width: 860px) {
  .sidebar { display: none; }
}
