/* Article presentation only; stored content and index cards stay untouched. */
#post-main .page-stack {
  margin-top: 88px;
}

body.site-header-in-flow #post-main .page-stack {
  margin-top: 0;
}

#post-main .info-wrap {
  padding: 16px 40px 40px;
}

#post-main .post-article-topbar {
  position: static;
  padding: 0 0 16px;
  background: transparent;
}

#post-main .post-back-link {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #cfc3ae;
  border-radius: 12px;
  background: #fffdf8;
  color: #514635;
  font-size: 16px;
  line-height: 1.5;
  backdrop-filter: none;
}

#post-main .post-back-link:hover {
  border-color: #a48652;
  background: #f3ead9;
  color: #28251f;
}

#post-main .post-article {
  border: 1px solid #ded5c5;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 6px 24px rgba(17, 16, 14, 0.06);
}

#post-main .post-hero {
  min-height: 0;
  padding: 32px;
  gap: 0;
  background-color: #211f1b;
  background-image:
    linear-gradient(110deg, rgba(28, 26, 22, 0.94), rgba(17, 16, 14, 0.82)),
    var(--post-hero-bg, linear-gradient(135deg, #343027, #151410));
  box-shadow: none;
}

#post-main .post-hero::before,
#post-main .post-hero::after {
  content: none;
}

#post-main .post-hero-content {
  max-width: 880px;
  margin: 0;
  gap: 16px;
}

#post-main .post-article-title {
  color: #f8f5ef;
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: -0.025em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

#post-main .post-article-date {
  color: #d8c39a;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
}

#post-main .post-article-excerpt {
  padding-left: 16px;
  border-left: 2px solid #b9975e;
  color: #e3dbcf;
  font-size: 18px;
  line-height: 1.7;
}

#post-main .post-article-body {
  min-width: 0;
  padding: 32px;
  background: #fffdf8;
  color: #3e3a33;
}

#post-main .post-article-toc {
  min-width: 0;
  margin-bottom: 32px;
  padding: 8px 18px;
  border: 1px solid #dfd2ba;
  border-radius: 14px;
  background: #f5efe3;
  color: #514635;
}

#post-main .post-article-toc summary {
  color: #403728;
  font-size: 18px;
}

#post-main .post-article-toc a {
  padding-block: 12px;
  color: #66512c;
  font-size: 16px;
  line-height: 1.6;
  text-decoration: none;
  word-break: keep-all;
}

#post-main .post-article-toc li + li {
  border-top: 1px solid #e2d8c6;
}

#post-main .post-article-toc a:hover {
  color: #28251f;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#post-main
  :is(
    .post-back-link,
    .post-article-toc a,
    .post-article-toc summary
  ):focus-visible {
  outline: 3px solid #957744;
  outline-offset: 3px;
}

#post-main .post-article-content {
  min-width: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1.8;
}

/* The original dark reading theme forces descendant colors with !important. */
#post-main .post-article-content,
#post-main .post-article-content * {
  color: #3e3a33 !important;
}

#post-main .post-article-content p {
  margin-bottom: 1.1em;
  line-height: 1.8;
}

#post-main
  .post-article-content
  :is(h1, h2, h3, h4, h5, h6, .post-reading-heading),
#post-main
  .post-article-content
  :is(h1, h2, h3, h4, h5, h6, .post-reading-heading)
  * {
  color: #28251f !important;
}

#post-main .post-article-content .post-reading-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid #d5c29a;
}

#post-main .post-article-content a,
#post-main .post-article-content a * {
  color: #80612b !important;
  text-decoration-color: currentColor;
}

#post-main .post-article-content blockquote {
  margin-block: 24px;
  padding: 16px 20px;
  border-left: 3px solid #b9975e;
  border-radius: 0 10px 10px 0;
  background: #f5efe3;
}

#post-main .post-article-content :is(table, th, td) {
  border-color: #d7cbb6;
}

#post-main .post-article-content th,
#post-main .post-article-content th * {
  background: #eee4d1 !important;
  color: #28251f !important;
}

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

#post-main .post-article-content hr {
  margin-block: 32px;
  border-top-color: #d5c29a;
}

#post-main .post-article-end {
  padding: 20px 32px;
  border-top: 1px solid #ded5c5;
  background: #f7f3eb;
}

@media (min-width: 1200px) {
  #post-main .post-article-body:has(.post-article-toc) {
    display: grid;
    grid-template-columns: 220px minmax(0, 760px);
    align-items: start;
    justify-content: center;
    gap: 32px;
  }

  #post-main .post-article-body > .post-article-toc {
    width: 100%;
    margin: 0;
  }

  #post-main .post-article-body > .post-article-content {
    width: 100%;
    margin-block: 0;
  }
}

@media (max-width: 767px) {
  #post-main .info-wrap {
    padding: 16px 16px 32px;
  }

  #post-main .post-hero,
  #post-main .post-article-body {
    padding: 24px 20px;
  }

  #post-main .post-article-title {
    font-size: 26px;
  }

  #post-main .post-article-toc {
    padding-inline: 14px;
  }

  #post-main .post-article-end {
    padding: 16px 20px;
  }
}
