/* =========================================================
   Pulsechain Bridge — Wikipedia-style stylesheet
   White background, sticky left TOC, right infobox, serif body
   ========================================================= */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: #202122;
  font-family: "Georgia", "Charter", "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

a:visited {
  color: #0b0080;
}

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

/* Accessibility skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #ffffff;
  color: #0645ad;
  padding: 8px 12px;
  border: 1px solid #a2a9b1;
  z-index: 1000;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- Top bar (thin) ---------- */
.site-header {
  border-bottom: 1px solid #a7d7f9;
  background: #f6f6f6;
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__brand {
  font-family: "Linux Libertine", "Georgia", serif;
  font-size: 18px;
  font-weight: normal;
  color: #202122;
}

.site-header__brand a {
  color: inherit;
  text-decoration: none;
}

.site-header__tabs {
  font-size: 12px;
  color: #54595d;
  padding: 4px 10px;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  background: #f8f9fa;
}

/* ---------- Page layout ---------- */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ---------- Left TOC ---------- */
.toc {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  padding: 12px 14px;
  font-size: 13px;
  font-family: "Helvetica Neue", "Arial", sans-serif;
  line-height: 1.5;
  scrollbar-width: thin;
}

.toc__title {
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #a2a9b1;
  color: #202122;
}

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

.toc ol ol {
  margin-left: 14px;
}

.toc li {
  margin: 2px 0;
  counter-increment: section;
}

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

.toc a::before {
  content: counters(section, ".") " ";
  color: #54595d;
  font-weight: 600;
}

.toc ol ol a::before {
  font-weight: 400;
}

.toc a:hover {
  background: #eaecf0;
  text-decoration: underline;
}

.toc a.is-active {
  background: #eaf3ff;
  font-weight: 700;
  color: #202122;
}

.toc__toggle {
  display: none;
}

/* ---------- Main article ---------- */
.article {
  min-width: 0;
}

.article__title {
  font-family: "Linux Libertine", "Georgia", serif;
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 4px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #a2a9b1;
  color: #000;
}

.article__updated {
  font-size: 12px;
  color: #54595d;
  margin: 0 0 18px 0;
  font-family: "Helvetica Neue", "Arial", sans-serif;
}

.article__lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.article__lead-text {
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  padding: 14px 16px;
  font-size: 15px;
}

.article__lead-text p {
  margin: 0 0 10px 0;
}

.article__lead-text p:last-child {
  margin-bottom: 0;
}

/* ---------- Infobox ---------- */
.infobox {
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 13px;
  font-family: "Helvetica Neue", "Arial", sans-serif;
  line-height: 1.45;
  width: 100%;
}

.infobox__title {
  background: #ccccff;
  color: #000;
  text-align: center;
  padding: 8px 6px;
  font-weight: 700;
  border-bottom: 1px solid #a2a9b1;
  font-size: 14px;
}

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

.infobox th,
.infobox td {
  padding: 6px 8px;
  border-bottom: 1px solid #d6d8db;
  text-align: left;
  vertical-align: top;
}

.infobox th {
  width: 38%;
  font-weight: 700;
  color: #202122;
  background: transparent;
}

.infobox tr:last-child th,
.infobox tr:last-child td {
  border-bottom: none;
}

/* ---------- Headings ---------- */
.article h2 {
  font-family: "Linux Libertine", "Georgia", serif;
  font-weight: 400;
  font-size: 1.6rem;
  margin: 32px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #a2a9b1;
  color: #000;
}

.article h3 {
  font-family: "Helvetica Neue", "Arial", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 22px 0 8px;
  color: #202122;
}

.article h4 {
  font-family: "Helvetica Neue", "Arial", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin: 18px 0 6px;
  color: #202122;
}

.article p {
  margin: 0 0 14px 0;
}

.article ul,
.article ol {
  margin: 0 0 14px 22px;
  padding: 0;
}

.article li {
  margin-bottom: 6px;
}

.article blockquote {
  border-left: 3px solid #a2a9b1;
  margin: 12px 0;
  padding: 6px 14px;
  color: #54595d;
  background: #f8f9fa;
}

/* ---------- Data tables (Wikipedia-style) ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 14px;
  font-family: "Helvetica Neue", "Arial", sans-serif;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
}

.data-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: 4px 0 6px;
  color: #202122;
}

.data-table th,
.data-table td {
  border: 1px solid #a2a9b1;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: #eaecf0;
}

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #f8f9fa;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-family: "Helvetica Neue", "Arial", sans-serif;
}

.faq details[open] summary {
  margin-bottom: 8px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid #a2a9b1;
  margin-top: 40px;
  padding: 18px 16px 30px;
  font-size: 12px;
  color: #54595d;
  text-align: center;
  font-family: "Helvetica Neue", "Arial", sans-serif;
}

.site-footer p {
  margin: 4px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .article__lead {
    grid-template-columns: 1fr;
  }
  .infobox {
    max-width: 360px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .toc__toggle {
    display: block;
    width: 100%;
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 10px 12px;
    font-family: "Helvetica Neue", "Arial", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .toc__list {
    display: none;
    margin-top: 8px;
  }

  .toc.is-open .toc__list {
    display: block;
  }

  .article__title {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
  .article h2 {
    font-size: 1.35rem;
  }
  .article h3 {
    font-size: 1.05rem;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .toc,
  .site-footer {
    display: none;
  }
  .layout {
    display: block;
  }
  body {
    color: #000;
    background: #fff;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
}
