/* Article Body Typography */
.article-content-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--foreground);
  margin-bottom: 2.75rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Tailwind Typography sets .prose to max-width: 65ch. Keep article copy at
   the full width of the main post column instead of leaving a blank strip. */
.article-content-body.prose {
  width: 100%;
  max-width: 100%;
}

.article-content-body > * {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .article-content-body {
    font-size: 1.125rem;
    line-height: 1.85;
    margin-bottom: 3.5rem;
  }
}

.article-content-body p {
  margin-bottom: 1.35rem;
  font-weight: 400;
}

@media (min-width: 640px) {
  .article-content-body p {
    margin-bottom: 1.65rem;
  }
}

.article-content-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 2rem 0 0.85rem;
  line-height: 1.35;
  color: var(--foreground);
  scroll-margin-top: 85px;
}

@media (min-width: 640px) {
  .article-content-body h2 {
    font-size: 1.75rem;
    margin: 2.75rem 0 1.25rem;
    line-height: 1.3;
  }
}

.article-content-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0.65rem;
  line-height: 1.4;
  color: var(--foreground);
  scroll-margin-top: 85px;
}

@media (min-width: 640px) {
  .article-content-body h3 {
    font-size: 1.35rem;
    margin: 2rem 0 1rem;
    line-height: 1.35;
  }
}

.article-content-body blockquote {
  position: relative;
  border: 1px solid var(--border);
  background: var(--secondary);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  font-size: 0.975rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--foreground);
}

@media (min-width: 640px) {
  .article-content-body blockquote {
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin: 2.25rem 0;
    font-size: 1.1rem;
  }
}

.article-content-body ul, 
.article-content-body ol {
  margin: 1rem 0 1.25rem 1.25rem;
}

@media (min-width: 640px) {
  .article-content-body ul, 
  .article-content-body ol {
    margin: 1.25rem 0 1.75rem 1.5rem;
  }
}

.article-content-body li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.article-content-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.2em 0.5em;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  word-break: break-word;
}

.article-content-body pre {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin: 1.5rem 0;
}

.article-content-body pre code {
  background-color: transparent;
  border: none;
  padding: 0;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.article-content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 1.5rem 0;
  display: block;
}

@media (min-width: 640px) {
  .article-content-body img {
    border-radius: 16px;
    margin: 2rem 0;
  }
}

/* In-Article Table of Contents Block */
.article-content-body .table-of-contents {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem 1.65rem;
  margin: 2.25rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

@media (max-width: 640px) {
  .article-content-body .table-of-contents {
    border-radius: 14px;
    padding: 1rem 1.15rem;
    margin: 1.5rem 0;
  }
}

.article-content-body .table-of-contents .toc-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--foreground);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-content-body .table-of-contents ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.article-content-body .table-of-contents ul ul {
  padding-left: 1.25rem;
  margin-top: 0.35rem;
  gap: 0.35rem;
}

.article-content-body .table-of-contents li {
  margin-bottom: 0;
  font-size: 0.925rem;
  line-height: 1.55;
}

.article-content-body .table-of-contents a {
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-block;
}

.article-content-body .table-of-contents a:hover {
  color: #e11d48;
  transform: translateX(3px);
}

.dark .article-content-body .table-of-contents a:hover {
  color: #fb7185;
}
