/* =========================================================
   articles.css - Final layout with right TOC and bold headings
   ========================================================= */

/* Base */
:root {
  --accent: #0ea5a4;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #ffffff;
  --content-max-width: 780px;
  --toc-width: 260px;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  line-height: 1.7;
}

/* Layout */
.page-grid {
  grid-template-columns: minmax(0, 1fr) var(--toc-width);
  gap: 10px;
  justify-content: center;
  padding: 2rem 1.25rem;
  max-width: calc(var(--content-max-width) + var(--toc-width) + 120px);
  margin: 0 auto;
}

@media (max-width: 992px) {
  .page-grid {
    display: block;
    max-width: var(--content-max-width);
    padding: 1.25rem;
  }
}

/* Article content */
.article-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.article-content h1 {
  font-size: 2rem;
}

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

.article-content h3 {
  font-size: 1.15rem;
}

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

/* Hero section */
.article-hero {
  margin-bottom: 2rem;
}

.article-hero img {
  width: 100%;
  border-radius: 12px;
  margin-top: 1rem;
}

.article_text_body{
  text-align: justify;
}

/* Table of contents */
#toc {
  position: sticky;
  top: 120px;
  align-self: start;
}

.toc-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(10, 10, 30, 0.06);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}

.toc-card h6 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: none;
  color: var(--text);
}

#toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#toc li {
  margin: 0.25rem 0;
}

#toc a {
  text-decoration: none;
  color: #475569;
  display: block;
  padding: 0.15rem 0;
  transition: color 0.2s ease;
}

#toc a:hover {
  color: var(--accent);
}

#toc a.active {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 992px) {
  #toc {
    position: static;
    margin-top: 2rem;
    width: 100%;
  }
  .toc-card {
    box-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.1);
  }
}

/* Code blocks, tables, blockquotes */
.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.article-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5rem;
}

.article-content th, .article-content td {
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.75rem;
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  background: rgba(14,165,164,0.05);
  padding: 0.8rem 1rem;
  margin: 1.25rem 0;
}

/* Footer */
footer {
  margin-top: 3rem;
}