/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 0;
}
.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-foreground);
  text-decoration: none;
}
.logo-image {
  height: 32px;
  width: auto;
}
.site-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}
.site-tagline {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: auto;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}
.rss-link {
  color: var(--color-muted-foreground);
}

/* Post Grid */
.post-grid {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0;
}

/* Post Card */
.post-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.post-card-link:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.post-card-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.post-card-content {
  padding: 1.25rem;
}
.post-card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--color-muted);
  color: var(--color-accent);
  font-weight: 500;
}
.post-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-muted-foreground);
}

/* Single Post */
.post {
  padding: 2.5rem 0 4rem;
}
.post-header {
  margin-bottom: 2rem;
}
.post-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.post-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}
.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Post Hero */
.post-hero {
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
}
.post-hero img {
  width: 100%;
}

/* Post Body — Typography */
.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
}
.post-body > * + * {
  margin-top: 1.25rem;
}
.post-body h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 2.5rem;
  line-height: 1.2;
}
.post-body h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  line-height: 1.3;
}
.post-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  line-height: 1.4;
}
.post-body p {
  margin: 0;
}
.post-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-body strong {
  font-weight: 600;
}
.post-body code {
  font-family: var(--font-code);
  background: var(--color-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
}
.post-body li {
  margin-top: 0.4rem;
}
.post-body li > ul, .post-body li > ol {
  margin-top: 0.25rem;
}
.post-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 1rem;
  margin-left: 0;
  color: var(--color-muted-foreground);
  font-style: italic;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Code Block */
.code-block {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.code-header {
  background: var(--color-muted);
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}
.code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: var(--color-muted);
}
.code-block code {
  font-family: var(--font-code);
  font-size: 0.875rem;
  background: none;
  padding: 0;
  line-height: 1.6;
}

/* Image Block */
.image-block {
  margin: 0;
}
.image-block img {
  border-radius: 8px;
}
.image-block figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted-foreground);
  margin-top: 0.5rem;
}

/* Callout */
.callout {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--color-muted);
  border: 1px solid var(--color-border);
}
.callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.callout-content {
  flex: 1;
}

/* Bookmark */
.bookmark {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.bookmark-link {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.25rem;
  text-decoration: none;
}
.bookmark-url {
  font-size: 0.85rem;
  color: var(--color-muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bookmark-caption {
  font-size: 0.9rem;
}

/* Author Card */
.author-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--color-muted);
  margin-top: 3rem;
  align-items: flex-start;
}
.author-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-card-info h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.author-card-info p {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}

/* 404 */
.not-found {
  text-align: center;
  padding: 6rem 0;
}
.not-found h1 {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-muted-foreground);
  margin-bottom: 0.5rem;
}
.not-found p {
  font-size: 1.125rem;
  color: var(--color-muted-foreground);
  margin-bottom: 2rem;
}
.back-link {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  border-radius: 8px;
  font-weight: 500;
  transition: opacity 0.2s;
}
.back-link:hover {
  opacity: 0.9;
  color: var(--color-primary-foreground);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 6rem 0;
}
.empty-state h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--color-muted-foreground);
}

/* Responsive */
@media (min-width: 768px) {
  .container {
    max-width: 768px;
    padding: 0 2rem;
  }
  .post-title {
    font-size: 2.75rem;
  }
}
