/* Blog, pages and nav additions. Uses the homepage tokens, fonts and components from site.css. */

.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-link {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.13s;
}
.nav-link:hover { color: var(--accent); }

/* Page head */
.page-head {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding-block: 56px 48px;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.page-head .wrap { padding: 0; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 44px); margin-bottom: 12px; }
.page-head p { font-size: 17px; color: var(--fg-muted); max-width: 620px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 13px; color: var(--fg-faint);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--fg-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-hidden] { opacity: .6; }

/* Category chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.cat-chip {
  font-family: var(--font-head);
  font-size: 12px; font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--fg-muted);
  text-decoration: none;
  transition: border-color .14s, color .14s, background .14s;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Listing */
.blog-section {
  padding-block: 56px 88px;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.blog-section .wrap { padding: 0; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .14s, transform .14s;
}
.post-card:hover { border-color: var(--accent-mid); transform: translateY(-2px); }
.post-card-img { aspect-ratio: 16 / 9; background: var(--accent-tint); overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-img.empty { display: flex; align-items: center; justify-content: center; color: var(--accent); }
.post-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-cat {
  align-self: flex-start;
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint);
  padding: 4px 9px; border-radius: 4px;
  margin-bottom: 12px;
  text-decoration: none;
}
.post-card h2 {
  font-family: var(--font-head);
  font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 10px;
  text-wrap: balance;
}
.post-card p { font-size: 15px; color: var(--fg-muted); line-height: 1.6; margin-bottom: 18px; }
.post-meta { margin-top: auto; font-size: 13px; color: var(--fg-faint); display: flex; gap: 10px; flex-wrap: wrap; }

.empty-state {
  text-align: center; color: var(--fg-muted);
  border: 1.5px dashed var(--border); border-radius: 14px;
  padding: 64px 24px; font-size: 17px;
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span {
  font-family: var(--font-head); font-size: 13px; font-weight: 600;
  min-width: 40px; text-align: center;
  padding: 10px 14px; border-radius: 6px;
  border: 1.5px solid var(--border);
  color: var(--fg-muted); text-decoration: none; background: var(--bg-card);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .gap { border: none; background: none; }

/* Article */
.article-head {
  padding-block: 48px 8px;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.article-head .narrow, .article-body .narrow { max-width: 760px; margin: 0 auto; }
.article-head h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 18px; }
.article-lede { font-size: 19px; color: var(--fg-muted); line-height: 1.6; margin-bottom: 22px; }
.article-meta { font-size: 14px; color: var(--fg-faint); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.article-cover {
  max-width: 980px; margin: 32px auto 0;
  padding-left: var(--gutter); padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.article-cover img { width: 100%; border-radius: 14px; border: 1px solid var(--border); display: block; }
.article-body {
  padding-block: 40px 72px;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.prose { font-size: 18px; line-height: 1.75; color: var(--fg); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: var(--font-head); font-size: clamp(22px, 2.6vw, 28px); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.25; margin-top: 2em; text-wrap: balance;
}
.prose h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin-top: 1.7em; }
.prose h4 { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin-top: 1.5em; }
.prose p, .prose li { color: var(--fg); }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-hover); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-tint);
  padding: 14px 20px; border-radius: 0 8px 8px 0; color: var(--fg-muted);
}
.prose img { border-radius: 10px; border: 1px solid var(--border); height: auto; }
.prose hr { border: none; border-top: 1px solid var(--border); margin-block: 2em; }
.prose pre, .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.prose pre { background: var(--bg-subtle); border: 1px solid var(--border); padding: 16px 18px; border-radius: 10px; overflow-x: auto; }
.prose :not(pre) > code { background: var(--bg-subtle); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { background: var(--bg-subtle); font-family: var(--font-head); }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }

.cta-box {
  margin-top: 56px;
  background: var(--accent); border-radius: 14px;
  padding: 32px 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-box h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.02em; margin-bottom: 4px; }
.cta-box p { font-size: 15px; color: rgba(255,255,255,.75); max-width: 440px; }
.cta-box .btn { background: #fff; color: var(--accent); padding: 12px 24px; font-size: 14px; }
.cta-box .btn:hover { background: var(--accent-tint); }

.related { background: var(--bg-subtle); border-top: 1px solid var(--border); padding-block: 64px 80px; padding-left: var(--gutter); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.related .wrap { padding: 0; }
.related h2 { font-family: var(--font-head); font-size: 24px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 28px; }

.preview-bar { background: #FFF4D6; color: #6B4E00; text-align: center; font-size: 13px; padding: 8px; font-family: var(--font-head); font-weight: 600; }

.notfound { text-align: center; padding: 120px 20px; }
.notfound .code { font-family: var(--font-head); font-weight: 800; font-size: 72px; letter-spacing: -0.04em; color: var(--accent); line-height: 1; margin-bottom: 14px; }
.notfound p { color: var(--fg-muted); margin-bottom: 28px; font-size: 17px; }

@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .nav-right { gap: 14px; }
  .prose { font-size: 17px; }
  .cta-box { padding: 26px 22px; }
  .page-head { padding-block: 40px 36px; }
}

.article-head .post-cat { margin-bottom: 16px; }

.post-card-img picture, .article-cover picture { display: block; }
.article-cover img { height: auto; }
