/* =====================================================================
   Semantic Autoblog — Public Site
   Design concept: an editorial "knowledge index" — a topic library, not
   a generic blog. Structure (breadcrumbs, entity chips, contents rail)
   is treated as visible information, echoing the topical map underneath.

   Tokens
   Ink:      #1C2331   headings, nav
   Paper:    #FBF9F4   page background (warm, not stark white)
   Surface:  #FFFFFF   cards
   Border:   #E6E2D6
   Text:     #2C2A25
   Muted:    #726C5E
   Accent:   #B8863B   (overridable via --accent from Settings)
   Line:     #D8D2C2
   ===================================================================== */

:root {
  --ink: #1c2331;
  --paper: #fbf9f4;
  --surface: #ffffff;
  --border: #e6e2d6;
  --text: #2c2a25;
  --muted: #726c5e;
  --accent: #b8863b;
  --line: #d8d2c2;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --content-width: 700px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--ink); text-decoration-color: var(--line); }
a:hover { color: var(--accent); }

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

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------------- Header ---------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.site-brand {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
}

.site-brand a { color: inherit; }
.site-brand a:hover { color: inherit; text-decoration: none; }

.site-brand .dot { color: var(--accent); }

.site-nav { display: flex; gap: 26px; }
.site-nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .01em;
}
.site-nav a:hover { color: var(--ink); }

.site-tagline {
  background: var(--ink);
  color: #c6cad6;
  font-size: 13px;
  text-align: center;
  padding: 7px 12px;
}
.site-tagline strong { color: #fff; }

/* ---------------- Layout ---------------- */
.page-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 70px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 46px;
  align-items: start;
}

.page-body.narrow { grid-template-columns: 1fr; max-width: 760px; }

/* ---------------- Hero (home) ---------------- */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 54px 0 46px;
  background:
    radial-gradient(700px 240px at 85% -40px, color-mix(in srgb, var(--accent) 10%, transparent), transparent);
}

.hero-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.hero .eyebrow {
  font-size: 12.5px; font-weight: 700; color: var(--accent);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.12;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 16px;
  max-width: 15ch;
}

.hero p.lede { font-size: 17px; color: var(--muted); max-width: 60ch; margin: 0; }

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs { margin-bottom: 22px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; font-size: 12.5px; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--line); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs li[aria-current] { color: var(--ink); font-weight: 600; }

/* ---------------- Post cards (index/list) ---------------- */
.post-list { display: flex; flex-direction: column; gap: 30px; }

.post-card { display: flex; gap: 20px; padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.post-card:last-child { border-bottom: none; }

.post-card .thumb {
  width: 168px; height: 118px; flex-shrink: 0; border-radius: 4px;
  overflow: hidden; background: var(--line);
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-card .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.post-card .meta a { color: var(--accent); }

.post-card h2 { font-family: var(--font-serif); font-size: 22px; line-height: 1.3; margin: 0 0 8px; font-weight: 600; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--accent); text-decoration: none; }

.post-card p.excerpt { font-size: 14.5px; color: var(--muted); margin: 0; }

/* ---------------- Single post ---------------- */
article.post h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--ink);
  margin: 6px 0 16px;
}

.post-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 26px;
  padding-bottom: 22px; border-bottom: 1px solid var(--border);
}

.post-meta .sep { color: var(--line); }

.post-featured-image { margin-bottom: 30px; border-radius: 4px; overflow: hidden; }

.post-content { font-family: var(--font-serif); font-size: 18px; line-height: 1.75; color: var(--text); max-width: var(--content-width); }
.post-content p { margin: 0 0 22px; }
.post-content h2 { font-family: var(--font-serif); font-size: 25px; font-weight: 600; color: var(--ink); margin: 40px 0 16px; }
.post-content h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--ink); margin: 30px 0 14px; }
.post-content ul, .post-content ol { margin: 0 0 22px; padding-left: 24px; }
.post-content li { margin-bottom: 8px; }
.post-content a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.post-content blockquote {
  margin: 26px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic;
}

.entity-tags { margin: 34px 0; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.entity-tags .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.entity-chip {
  display: inline-flex; align-items: center; padding: 5px 13px; margin: 0 6px 6px 0;
  border: 1px solid var(--line); border-radius: 100px; font-size: 12.5px; font-weight: 600;
  color: var(--ink); background: var(--surface);
}
.entity-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.source-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 18px; font-size: 13.5px; color: var(--muted); margin: 30px 0;
}
.source-box a { color: var(--ink); font-weight: 600; }

/* ---------------- Sidebar ---------------- */
.sidebar-block { margin-bottom: 34px; }
.sidebar-block h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 16px; font-weight: 700;
}

.topical-tree a {
  display: block; font-size: 14px; color: var(--text); padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.topical-tree a:hover { color: var(--accent); text-decoration: none; }
.topical-tree .entity-type { font-size: 10.5px; color: var(--muted); text-transform: uppercase; margin-left: 6px; }

.related-post { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.related-post:last-child { border-bottom: none; }
.related-post:hover { text-decoration: none; color: var(--accent); }

.source-context-box {
  background: var(--ink); color: #d7dae4; border-radius: 6px; padding: 20px;
  font-size: 13.5px; line-height: 1.6;
}
.source-context-box h3 { color: #fff; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 34px 0;
  margin-top: 40px;
}
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer p { font-size: 13px; color: var(--muted); margin: 0; }
.site-footer nav a { font-size: 13px; color: var(--muted); margin-left: 18px; }

/* ---------------- Pagination ---------------- */
.pagination { display: flex; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span {
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; color: var(--text);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------- Utility ---------------- */
.empty-note { color: var(--muted); padding: 40px 0; }

@media (max-width: 860px) {
  .page-body { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .post-card { flex-direction: column; }
  .post-card .thumb { width: 100%; height: 180px; }
  .site-nav { display: none; }
}
