/* Georgia covers Latin; the Chinese fonts supply Han glyphs per platform. */
:root {
  --blog-serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC",
    "Source Han Serif SC", "SimSun", serif;
  --blog-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --paper: #f5f0e8;
  --surface: #fffbf6;
  --surface-muted: #eee5d9;
  --ink: #382f29;
  --muted-ink: #72665b;
  --line: #ded2c3;
  --accent: #a94f38;
  --accent-dark: #873d2b;
  --walnut: #40332e;
}

body,
input,
button,
textarea,
select,
.article-entry,
.entry-summary,
.article-meta,
.entry-meta,
.widget,
.archive-article {
  font-family: var(--blog-serif);
}

h1, h2, h3, h4, h5, h6,
.site-title,
.site-description,
.article-title,
.entry-title,
.widget-title,
.archive-year,
.archive-article-title,
#main-navigation li a,
.nav-link {
  font-family: var(--blog-serif);
}

.site-title {
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.015em;
  text-transform: none;
}

.site-description,
.article-title,
.entry-title {
  letter-spacing: 0.01em;
  text-transform: none;
}

.article-title,
.entry-title {
  font-weight: 700;
  line-height: 1.3;
}

.article-entry {
  line-height: 1.85;
}

/* Let the post and its table of contents use the full reading area. */
body[data-spy="scroll"] #main {
  width: 100%;
  margin: 0;
}

.article-entry pre,
.article-entry code,
.article-entry kbd,
.article-entry samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Bootstrap wraps <pre> by default; keep code and line numbers aligned. */
.article-entry figure.highlight {
  overflow-x: auto;
}

.article-entry figure.highlight table {
  width: max-content;
  min-width: 100%;
}

.article-entry figure.highlight pre {
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  overflow: visible;
}

.article-entry figure.highlight .gutter pre,
.article-entry figure.highlight .code pre {
  font-size: 13px;
  line-height: 1.7;
}

.article-entry figure.highlight .gutter {
  white-space: nowrap;
}

/* Homepage article previews */
.home-preview {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}

.home-preview .entry-thumbnail {
  display: block;
  float: none;
  width: 100%;
  height: 180px;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.home-preview .entry-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-preview .entry-summary {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 180px;
  margin: 0;
  overflow: hidden;
}

.home-preview .preview-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
  margin: 0;
}

.home-preview .article-more-link {
  flex: none;
  margin: auto 0 0;
  text-align: right;
}

@media (max-width: 600px) {
  .home-preview {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-preview .entry-summary {
    height: 180px;
  }
}

/* Warm paper palette */
body,
#wrap,
#container {
  background: var(--paper);
  color: var(--ink);
}

#originBgDiv {
  background: var(--paper) !important;
}

#articleInner,
.article-inner,
.widget-wrap,
#page-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

#articleInner {
  padding: 24px;
}

.widget-wrap {
  padding: 18px;
}

@media (max-width: 600px) {
  #articleInner {
    padding: 18px;
  }
}

.site-header,
.site-footer {
  background: var(--walnut);
}

.site-title a,
.site-footer a {
  color: var(--surface);
}

.site-description,
.site-footer,
.entry-meta,
.article-meta,
.article-date,
.article-footer,
.widget-title,
.archive-year {
  color: var(--muted-ink);
}

.site-description,
.site-footer {
  color: #e6d8ca;
}

#main-navigation .sf-menu,
.nav-open,
.nav-close {
  background: #342a26;
}

#main-navigation li a:hover,
#main-navigation li.sfHover > a,
#main-navigation li.current_page_item > a,
#main-navigation li.current-menu-item > a,
#main-navigation li.current-menu-parent > a,
#main-navigation li.current-page-parent > a,
#main-navigation li.current-page-ancestor > a,
#main-navigation li.current_page_ancestor > a,
#main-navigation li:hover ul,
#main-navigation li.sfHover ul {
  background: var(--accent);
}

#main-navigation li:hover li a:hover,
#main-navigation li.sfHover li a:hover {
  background: var(--accent-dark);
}

#main-navigation li li a {
  color: var(--surface);
}

#main-navigation li li,
#main-navigation li li:hover ul,
#main-navigation li li.sfHover ul {
  border-color: var(--accent-dark);
}

@media (max-width: 960px) {
  #main-navigation > .sf-menu > ul {
    background: var(--walnut);
  }
}

.article,
.article-entry,
.article-entry h1,
.article-entry h2,
.article-entry h3,
.article-entry h4,
.article-entry h5,
.article-entry h6,
.article-title,
.article-header h1 a,
.entry-title a {
  color: var(--ink);
}

.article-entry a,
.widget a,
.archive-article a,
.article-more-link a,
.article-category-link,
.article-tag-list-link {
  color: var(--accent);
}

.article-entry a:hover,
.widget a:hover,
.archive-article a:hover,
.article-more-link a:hover,
.article-title:hover,
.article-date:hover,
.article-category-link:hover,
.archive-article-title:hover,
.archive-article-date:hover,
.nav-link:hover,
a.article-title:hover,
.widget li a:hover,
.entry-title a:hover {
  color: var(--accent-dark);
}

.widget-title,
.widget-title span,
.ins-search-container {
  border-color: var(--accent);
}

.archives-tags-wrap blockquote,
.archives-category-wrap blockquote {
  background: var(--surface-muted);
  color: var(--ink);
}

.archives-tags-wrap blockquote a:hover,
.archives-category-wrap blockquote a:hover,
.nav .active > a {
  color: var(--accent);
}

.entry-footer,
.article-entry th,
.article-entry td,
.toc-article,
.home-preview .entry-thumbnail {
  border-color: var(--line);
}

.article-entry figure.highlight,
.article-entry > pre,
.article-entry blockquote,
.article-entry code {
  background: var(--surface-muted);
}

.article-entry figure.highlight pre,
.article-entry pre code {
  background: transparent;
}

#page-nav .prev,
#page-nav .next {
  background: var(--walnut);
}

#page-nav a:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Content types: readable UI type for articles and works, print type for notes. */
.kind-article .article-entry,
.kind-article .article-header,
.kind-article .article-header h1,
.kind-article .article-entry h1,
.kind-article .article-entry h2,
.kind-article .article-entry h3,
.kind-article .article-entry h4,
.kind-article .article-entry h5,
.kind-article .article-entry h6,
.kind-article .article-meta,
.kind-article .entry-footer,
.kind-work .work-detail,
.kind-work .article-entry h1,
.kind-work .article-entry h2,
.kind-work .article-entry h3,
.kind-work .article-entry h4,
.kind-work .article-entry h5,
.kind-work .article-entry h6,
.collection-card-article,
.collection-card-work,
.collection-card-article h3,
.collection-card-work h3 {
  font-family: var(--blog-ui);
}

.kind-note .article-entry,
.kind-note .article-header,
.kind-note .article-header h1,
.kind-note .article-meta,
.kind-note .entry-footer,
.collection-card-note {
  font-family: var(--blog-serif);
}

.kind-note .article-entry {
  font-size: 1.07em;
  line-height: 2;
}

.kind-note .article-entry p {
  margin-bottom: 1.35em;
}

.kind-note #articleInner {
  background: #fffdf8;
}

.kind-article .article-header h1.article-title,
.kind-note .article-header h1.article-title {
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 3.2vw, 2.8rem);
  line-height: 1.28;
}

/* Give the home and collection pages the full content width. */
.full-width #main {
  width: 100%;
  margin: 0;
  float: none;
}

.landing-page,
.collection-page,
.explore-page {
  width: 100%;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--blog-ui);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-intro {
  padding: 10px 0 40px;
  border-bottom: 1px dashed var(--line);
}

.landing-intro h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.25;
}

.landing-intro > p:last-child,
.section-heading p,
.collection-page-header > p:last-child {
  color: var(--muted-ink);
}

.home-section {
  padding: 40px 0;
}

.home-section + .home-section {
  border-top: 1px dashed var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2,
.collection-page-header h1 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
}

.section-heading p {
  margin: 0;
}

.view-all {
  flex: none;
  margin-top: 13px;
  color: var(--accent);
  font-family: var(--blog-ui);
  font-weight: 600;
  text-decoration: none;
}

.view-all:hover {
  color: var(--accent-dark);
}

.section-posts {
  display: grid;
  gap: 16px;
}

.collection-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.collection-card-image {
  display: block;
  width: 100%;
  height: 150px;
  overflow: hidden;
  border-radius: 5px;
}

.collection-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.collection-card-meta {
  display: flex;
  gap: 14px;
  color: var(--muted-ink);
  font-size: 0.82rem;
}

.collection-card-meta span {
  color: var(--accent);
  font-weight: 700;
}

.collection-card h3 {
  margin: 8px 0 6px;
  font-size: clamp(1.4rem, 2.1vw, 1.65rem);
  line-height: 1.3;
}

.collection-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.collection-card h3 a:hover {
  color: var(--accent);
}

.collection-card-body > p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.65;
}

.collection-card-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}

.collection-card-link:hover {
  color: var(--accent-dark);
}

.collection-page-header {
  margin-bottom: 26px;
  padding: 10px 0 26px;
  border-bottom: 1px dashed var(--line);
}

.collection-page-header > p:last-child {
  margin: 0;
}

.empty-collection {
  padding: 28px;
  color: var(--muted-ink);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.explore-grid a {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 170px;
  padding: 24px;
  color: var(--muted-ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.explore-grid a:hover {
  border-color: var(--accent);
}

.explore-grid strong {
  color: var(--ink);
  font-size: 1.6rem;
}

/* Works use an editorial profile on the left of the project story. */
.work-detail {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.work-facts,
.work-article {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.work-facts h2 {
  margin: 0 0 22px;
  font-family: var(--blog-ui);
  font-size: 1.2rem;
}

.work-facts dl,
.work-facts dd {
  margin: 0;
}

.work-facts dt {
  margin: 18px 0 5px;
  color: var(--muted-ink);
  font-size: 0.8rem;
}

.work-facts dd {
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.work-article h1 {
  margin: 0 0 25px;
  font-family: var(--blog-ui);
  font-size: clamp(2.1rem, 3.2vw, 2.8rem);
  line-height: 1.28;
}

.work-article .article-entry {
  font-family: var(--blog-ui);
}

@media (max-width: 700px) {
  .collection-card,
  .work-detail,
  .explore-grid {
    grid-template-columns: 1fr;
  }

  .collection-card-image {
    height: 190px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .view-all {
    margin-top: 4px;
  }
}
