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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #222;
  background: #fff;
  margin: 0;
}

/* Layout */

header {
  border-bottom: 1px solid #e5e5e5;
  padding: 0.75rem 1rem;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

main {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
}

footer {
  border-top: 1px solid #e5e5e5;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
  color: #666;
  margin-top: 3rem;
}

/* Header */

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #222;
  text-decoration: none;
  white-space: nowrap;
}

.site-title:hover {
  color: #0066cc;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  color: #444;
  text-decoration: none;
  font-size: 0.95rem;
}

nav a:hover {
  color: #0066cc;
}

/* Home post list */

.tagline {
  color: #555;
  margin-top: -0.5rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.post-list li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.post-date {
  font-size: 0.82rem;
  color: #888;
  white-space: nowrap;
  min-width: 6rem;
}

.post-title {
  color: #222;
  text-decoration: none;
  font-weight: 500;
}

.post-title:hover {
  color: #0066cc;
}

/* Tags and categories chips */

.tag-list,
.post-categories {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag,
.category {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  text-decoration: none;
  line-height: 1.6;
}

.tag {
  background: #f0f4ff;
  color: #3355aa;
}

.tag:hover {
  background: #d8e4ff;
}

.category {
  background: #f0f8f0;
  color: #2a6e2a;
}

.category:hover {
  background: #d4edda;
}

/* Post page */

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e5e5;
}

.post-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

.post-content h2 {
  margin-top: 2rem;
  font-size: 1.3rem;
}

.post-content h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
}

.post-content li {
  margin: 0.2rem 0;
}

.post-content a {
  color: #0066cc;
}

.post-content a:hover {
  text-decoration: none;
}

.post-content code {
  font-size: 0.875em;
  background: #f5f5f5;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

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

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

/* Tags / Categories index pages */

.tag-group,
.category-group {
  margin-bottom: 2rem;
}

.tag-group h2,
.category-group h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.tag-group ul,
.category-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-group li,
.category-group li {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.count {
  font-size: 0.85rem;
  color: #888;
  font-weight: normal;
}

/* Responsive */

@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.2rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }
}
