*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Georgia, 'Times New Roman', 'Linux Libertine', serif;
  font-size: 16px;
  line-height: 1.7;
  color: #222;
  background-color: #fff;
}

a {
  color: #0645ad;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Layout ─────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid #a2a9b1;
  padding: 12px 24px;
  background: #fff;
}

.site-header h2 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #000;
  margin: 0;
}

.site-header h2 span {
  color: #555;
  font-size: 14px;
  margin-left: 6px;
}

.page-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  gap: 32px;
}

/* ── Sticky Table of Contents ───────────────────── */

.toc-sidebar {
  flex: 0 0 260px;
  position: relative;
}

.toc-container {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.toc-container h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #c8ccd1;
  color: #222;
}

.toc-container ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-counter;
}

.toc-container > ol > li {
  counter-increment: toc-counter;
  margin-bottom: 4px;
}

.toc-container > ol > li > a::before {
  content: counter(toc-counter) ". ";
  font-weight: 600;
}

.toc-container ol ol {
  padding-left: 18px;
  counter-reset: toc-sub-counter;
  margin-top: 2px;
}

.toc-container ol ol li {
  counter-increment: toc-sub-counter;
  margin-bottom: 2px;
}

.toc-container ol ol li a::before {
  content: counter(toc-counter) "." counter(toc-sub-counter) " ";
}

.toc-container a {
  color: #0645ad;
  text-decoration: none;
  display: block;
  padding: 2px 4px;
  border-radius: 2px;
  transition: background-color 0.15s;
}

.toc-container a:hover {
  background-color: #eaecf0;
  text-decoration: none;
}

.toc-container a.active {
  background-color: #d5e4f7;
  font-weight: 600;
}

.toc-toggle {
  display: none;
  background: none;
  border: 1px solid #a2a9b1;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f8f9fa;
  margin-bottom: 16px;
}

/* ── Article Content ────────────────────────────── */

.article-content {
  flex: 1;
  min-width: 0;
}

.article-content h1 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 4px;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 6px;
  color: #000;
}

.article-meta {
  font-size: 13px;
  color: #72777d;
  margin-bottom: 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.article-summary {
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
}

.article-summary p {
  margin-bottom: 8px;
}

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

.article-content h2 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #000;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 4px;
  margin: 36px 0 14px;
  line-height: 1.3;
}

.article-content h3 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #000;
  margin: 28px 0 10px;
  line-height: 1.3;
}

.article-content p {
  margin-bottom: 14px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 14px 24px;
}

.article-content li {
  margin-bottom: 4px;
}

/* ── Info Box (right-aligned fact box) ───────────── */

.info-box {
  float: right;
  width: 300px;
  margin: 0 0 20px 24px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.info-box-title {
  background: #cce0f5;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: #000;
}

.info-box table {
  width: 100%;
  border-collapse: collapse;
}

.info-box td {
  padding: 5px 12px;
  border-top: 1px solid #e0e0e0;
  vertical-align: top;
}

.info-box td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 110px;
  color: #333;
}

/* ── Tables ──────────────────────────────────────── */

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
}

.article-content th,
.article-content td {
  border: 1px solid #a2a9b1;
  padding: 8px 12px;
  text-align: left;
}

.article-content th {
  background: #eaecf0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
}

.article-content td {
  background: #fff;
}

/* ── Blockquotes ─────────────────────────────────── */

.article-content blockquote {
  border-left: 3px solid #c8ccd1;
  margin: 16px 0 16px 12px;
  padding: 4px 16px;
  color: #555;
  font-style: italic;
}

/* ── Footer ──────────────────────────────────────── */

.site-footer {
  border-top: 1px solid #a2a9b1;
  padding: 20px 24px;
  font-size: 13px;
  color: #72777d;
  text-align: center;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 860px) {
  .page-wrapper {
    flex-direction: column;
    padding: 16px;
    gap: 0;
  }

  .toc-sidebar {
    flex: none;
    width: 100%;
    margin-bottom: 20px;
  }

  .toc-container {
    position: static;
    max-height: none;
  }

  .toc-container.collapsed ol {
    display: none;
  }

  .toc-toggle {
    display: block;
  }

  .info-box {
    float: none;
    width: 100%;
    margin: 0 0 20px;
  }
}

@media print {
  .toc-sidebar,
  .site-header,
  .site-footer {
    display: none;
  }

  .page-wrapper {
    display: block;
    max-width: 100%;
  }

  .article-content {
    font-size: 12pt;
  }
}
