/* ── Reset & base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
img, svg { display: block; max-width: 100%; }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 56px;
  background: #373277;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  color: #93e6fc;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.logo:hover { color: #fff; }

.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 0.375rem 0.625rem;
  border-radius: 5px;
  transition: color 0.1s, background 0.1s;
}

.nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav a.nav-active { color: #fff; }

.sign-in-btn {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6355c7;
  background: #93e6fc;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 0.1s;
}

.sign-in-btn:hover { background: #fff; }

/* ── Layout ───────────────────────────────────────────── */
.site-main {
  margin-top: 56px;
  min-height: calc(100vh - 56px - 60px);
}

/* ── Post list ────────────────────────────────────────── */
.post-list-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.blog-header { margin-bottom: 3rem; }

.blog-title {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.blog-description {
  color: #666;
  margin: 0;
  font-size: 1.0625rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.post-card { display: flex; flex-direction: column; gap: 0.75rem; }

.post-card-image-link img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
}

.post-card-content { display: flex; flex-direction: column; gap: 0.25rem; }

.post-card-title { font-size: 1.375rem; margin: 0; }
.post-card-title a { text-decoration: none; color: #111; }
.post-card-title a:hover { color: #373277; }

.post-card-excerpt { color: #444; margin: 0.25rem 0 0; font-size: 0.9375rem; }

.post-card-meta { font-size: 0.8125rem; color: #888; margin-top: 0.25rem; }

/* ── Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.9375rem;
}

.pagination a {
  color: #373277;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  transition: background 0.1s;
}
.pagination a:hover { background: #f4f4f8; }

/* ── Single post ──────────────────────────────────────── */
.post-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.post-header { margin-bottom: 2rem; }

.post-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #373277;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  margin-right: 0.5rem;
}
.post-tag:hover { color: #6355c7; }

.post-title {
  font-size: 2.25rem;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.post-meta { font-size: 0.875rem; color: #888; }

.post-feature-image { margin: 0 0 2.5rem; }

.post-feature-image img {
  width: 100%;
  border-radius: 6px;
  max-height: 480px;
  object-fit: cover;
}

.post-feature-image figcaption {
  font-size: 0.8125rem;
  color: #888;
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Post content ─────────────────────────────────────── */
.gh-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #222;
}

.gh-content p { margin: 0 0 1.5em; }
.gh-content h2 { font-size: 1.5rem; margin: 2em 0 0.75em; }
.gh-content h3 { font-size: 1.25rem; margin: 1.75em 0 0.5em; }
.gh-content h4 { font-size: 1.125rem; margin: 1.5em 0 0.5em; }

.gh-content img {
  border-radius: 4px;
  margin: 1.5em auto;
  height: auto;
}

.gh-content figure { margin: 2em 0; }
.gh-content figcaption {
  font-size: 0.8125rem;
  color: #888;
  text-align: center;
  margin-top: 0.5rem;
}

.gh-content a { color: #373277; }
.gh-content a:hover { color: #6355c7; }

.gh-content blockquote {
  border-left: 3px solid #373277;
  padding-left: 1.25rem;
  margin-left: 0;
  color: #444;
  font-style: italic;
}

.gh-content pre {
  background: #f4f4f8;
  padding: 1rem 1.25rem;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.gh-content code {
  background: #f4f4f8;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.875em;
}

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

.gh-content ul, .gh-content ol { padding-left: 1.5rem; margin: 0 0 1.5em; }
.gh-content li { margin-bottom: 0.375em; }

.gh-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 2.5em 0;
}

/* ── Post nav ─────────────────────────────────────────── */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.9375rem;
}

.post-nav a { color: #373277; text-decoration: none; max-width: 45%; }
.post-nav a:hover { text-decoration: underline; }
.post-nav-next { text-align: right; margin-left: auto; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  background: #f8f8fc;
  border-top: 1px solid #eee;
  padding: 1.25rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.8125rem;
  color: #888;
}

.footer-inner p { margin: 0; }
.footer-inner a { color: #373277; text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav { display: none; }
  .sign-in-btn { display: none; }
  .post-title { font-size: 1.75rem; }
  .blog-title { font-size: 1.5rem; }
  .post-container, .post-list-container { padding: 2rem 1rem; }
}
