/* ── Article content ── */
:root {
  --reading-measure: 45rem;
}

.text-reading-column {
  width: 100%;
  max-width: var(--reading-measure);
}

/* Detail pages: title in left third; body starts aligned with the title */
.text-page-main {
  align-self: start;
}

.article-content {
  width: 100%;
  max-width: var(--reading-measure);
  line-height: 1.8;
  color: #1b1c15;
}

/* Section headings in articles/posts: match text font, set size by level */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #1b1c15;
  border-left: none;
  padding-left: 0;
}

.article-content h1 {
  font-size: 1.4em;
}

.article-content h2 {
  font-size: 1.4em;
}

.article-content h3 {
  font-size: 1.2em;
}

.article-content h4 {
  font-size: 1em;
}

.article-content p {
  margin-bottom: 1rem;
}

/* Poem blocks preserve line breaks typed in Markdown without trailing spaces. */
.article-content .poem {
  white-space: normal;
  line-height: 1.65;
  margin: 0;
}

.article-content .poem p {
  white-space: pre-line;
  margin: 0;
}

.article-content .poem p+p {
  /* One blank line between stanzas. */
  margin-top: 1.65em;
}

.article-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  list-style-type: disc;
  list-style-position: outside;
}

.article-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  list-style-type: decimal;
  list-style-position: outside;
}

.article-content li {
  margin-bottom: 0.3rem;
}

.article-content code {
  background: #eeeeee;
  padding: 0.1rem 0.3rem;
  border-radius: 0.125rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
}

.article-content pre {
  background: #eeeeee;
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

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

.article-content a {
  color: #8e4d27;
}

.article-content img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.article-content figure {
  margin: 1.5rem auto;
  text-align: center;
  width: 100%;
  display: block;
}

.article-content .mermaid {
  margin: 2rem 0;
  text-align: center;
}

.article-content .mermaid svg {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
}

.article-content figcaption {
  font-size: 0.8rem;
  color: #86736a;
  margin-top: 0.4rem;
  text-align: center;
}

.article-content blockquote {
  background: #f5f5f5;
  padding: 1rem 1.5rem;
  border-radius: 0.25rem;
  margin: 1.5em 0;
  color: #53433c;
  line-height: 1.65;
  font-size: inherit;
  font-style: normal;
  border-left: none;
}

.article-content blockquote a {
  color: #8e4d27;
  text-decoration: underline;
}

.article-content blockquote p {
  margin-bottom: 0.5rem;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ── Tables ── */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9em;
}

.article-content th,
.article-content td {
  border: 1px solid #d9c2b8;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.article-content thead th {
  background: #f5f5f5;
  font-weight: 600;
  color: #1b1c15;
}

.article-content tbody tr:nth-child(even) {
  background: #fafafa;
}

/* ── Article sidebar heading (title + description live in the left column) ── */
.article-sidebar-heading {
  border-bottom: 1px solid #ede5e0;
  padding-bottom: 1.5rem;
}

.article-sidebar-title {
  font-family: 'Newsreader', serif;
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  line-height: 1.15;
  font-weight: 500;
  color: #1b1c15;
  margin: 0 0 0.75rem;
}

.article-sidebar-description {
  font-family: 'Work Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #53433c;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* ── Article meta ── */
.article-meta {
  color: #86736a;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* ── Internal cross-citation links (xcite) ── */
a.xcite-ref {
  color: #56642b;
  text-decoration-line: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-style: dotted;
}

a.xcite-ref:hover {
  color: #3e4c16;
  text-decoration-style: solid;
}

.xcite-missing {
  color: #ba1a1a;
  font-family: monospace;
  font-size: 0.85em;
}

/* ── Inline note block (gray, similar to CV/portfolio boxes) ── */
.article-content .article-note {
  background: #f5f5f5;
  padding: 1rem 1.5rem;
  border-radius: 0.25rem;
  margin: 1.5em 0;
  font-size: 0.875rem;
  color: #53433c;
  line-height: 1.65;
}

.article-content .article-note > :last-child {
  margin-bottom: 0;
}
