/* ============================================================
   ASTUTELY GHOST THEME
   Fraunces + DM Sans · #5046e4 pop · #f7f5f0 bg
   ============================================================ */

:root {
  --pop: #5046e4;
  --pop-dark: #3d35c0;
  --bg: #f7f5f0;
  --bg-alt: #eeeae2;
  --text: #111111;
  --text-muted: #666666;
  --border: #e0dbd0;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --max-width: 1160px;
  --narrow-width: 720px;
  --radius: 4px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── CONTAINERS ─────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.container--narrow {
  max-width: var(--narrow-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo .reg {
  font-size: 0.5em;
  vertical-align: super;
  font-weight: 400;
  opacity: 0.6;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
}

.main-nav .nav-cta {
  background: var(--text);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.main-nav .nav-cta:hover {
  background: #333;
  color: #fff;
}

/* ── BLOG HERO ──────────────────────────────────────────── */
.blog-hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

.blog-eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pop);
  margin-bottom: 1rem;
}

.blog-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.blog-hero h1 em {
  font-style: italic;
  color: var(--pop);
}

.blog-intro {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.6;
}

/* ── TAG HEADER ─────────────────────────────────────────── */
.tag-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.tag-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.tag-description {
  font-size: 1.0625rem;
  color: var(--text-muted);
}

/* ── POST LIST ──────────────────────────────────────────── */
.post-list {
  padding: 3rem 0 5rem;
}

.post-list .container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
}

/* ── POST CARD ──────────────────────────────────────────── */
.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.07);
}

.post-card-image-wrap {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover .post-card-image {
  transform: scale(1.03);
}

.post-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pop);
  margin-bottom: 0.75rem;
  display: block;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.post-card-title a {
  color: var(--text);
  transition: color 0.2s;
}

.post-card-title a:hover {
  color: var(--pop);
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.post-card-reading-time::before {
  content: '· ';
}

/* ── PAGINATION ─────────────────────────────────────────── */
.pagination {
  padding: 2rem 0 4rem;
}

.pagination .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── POST PAGE ──────────────────────────────────────────── */
.post-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.post-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pop);
  margin-bottom: 1rem;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.post-excerpt {
  font-size: 1.1875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-dot {
  opacity: 0.4;
}

/* ── FEATURE IMAGE ──────────────────────────────────────── */
.post-feature-image {
  padding: 2.5rem 0 0;
}

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

.post-feature-image figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* ── POST CONTENT ───────────────────────────────────────── */
.post-content {
  padding: 3.5rem 0 4rem;
}

.post-content p {
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
}

.post-content h4 {
  font-size: 1rem;
  font-weight: 500;
  margin: 1.5rem 0 0.5rem;
}

.post-content a {
  color: var(--pop);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content a:hover {
  color: var(--pop-dark);
}

.post-content strong { font-weight: 500; }

.post-content em { font-style: italic; }

.post-content ul,
.post-content ol {
  margin: 1.25rem 0 1.5rem 1.5rem;
}

.post-content li {
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 3px solid var(--pop);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
}

.post-content blockquote p {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  margin: 0;
}

.post-content pre {
  background: #1a1a1a;
  color: #e8e8e8;
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--bg-alt);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

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

.post-content img {
  border-radius: 6px;
  margin: 2rem auto;
  width: 100%;
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Wide/full width images inside post */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: 2rem calc(50% - 42.5vw);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  margin: 2rem calc(50% - 50vw);
}

/* Bookmark card */
.kg-bookmark-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin: 1.5rem 0;
}

.kg-bookmark-content {
  padding: 1rem 1.25rem;
  flex: 1;
}

.kg-bookmark-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kg-bookmark-description {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── POST FOOTER ────────────────────────────────────────── */
.post-footer {
  padding: 2.5rem 0 4rem;
  border-top: 1px solid var(--border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag-pill {
  font-size: 0.8125rem;
  font-weight: 400;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.tag-pill:hover {
  border-color: var(--pop);
  color: var(--pop);
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-name {
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.author-bio {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── POST NAV ───────────────────────────────────────────── */
.post-nav {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  background: #fff;
}

.post-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-nav-next {
  text-align: right;
}

.post-nav-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.post-nav-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--text);
  transition: color 0.2s;
}

.post-nav-item:hover .post-nav-title {
  color: var(--pop);
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--pop);
  color: #fff;
}

.btn-primary:hover {
  background: var(--pop-dark);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--pop);
  color: var(--pop);
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: #fff;
  font-weight: 400;
}

.footer-copy {
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

/* ── ERROR PAGE ─────────────────────────────────────────── */
.error-page {
  padding: 8rem 0;
  text-align: center;
}

.error-page h1 {
  font-family: var(--font-serif);
  font-size: 6rem;
  font-weight: 300;
  color: var(--border);
  margin-bottom: 1rem;
}

.error-page p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }

  .blog-hero {
    padding: 3rem 0 2.5rem;
  }

  .post-list .container {
    grid-template-columns: 1fr;
  }

  .post-nav-inner {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    text-align: left;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .kg-width-wide {
    width: 100%;
    margin: 2rem 0;
  }
}

@media (max-width: 480px) {
  .container,
  .container--narrow {
    padding: 0 1.25rem;
  }

  .post-title {
    font-size: 2rem;
  }
}
