/* ============================================================
   Raydium Finance — encyclopedia-style article stylesheet
   Plain white background, serif body, sticky left Contents,
   right-hand infobox. No dates displayed.
   ============================================================ */

:root {
  --text: #202122;
  --link: #3366cc;
  --link-visited: #3366cc;
  --border: #a2a9b1;
  --border-light: #c8ccd1;
  --infobox-header: #cedff2;
  --infobox-sub: #e6eefc;
  --toc-active-bg: #eaf3ff;
  --sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --content-max: 720px;
  --toc-width: 240px;
  --header-h: 46px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------------- Top header bar ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 22px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
}
.site-header .brand {
  font-family: var(--sans);
  font-size: 17px;
  color: #202122;
  font-weight: 400;
}

/* ---------------- Page layout ---------------- */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* ---------------- Sticky Table of Contents ---------------- */
.toc {
  flex: 0 0 var(--toc-width);
  width: var(--toc-width);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  align-self: flex-start;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  padding-right: 6px;
}
.toc-title {
  font-weight: 700;
  font-size: 13px;
  color: #202122;
  margin: 0 0 10px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.toc > ol > li { counter-increment: toc; margin: 2px 0; }
.toc ol ol {
  counter-reset: subtoc;
  margin-left: 14px;
}
.toc ol ol > li { counter-increment: subtoc; }
.toc a {
  display: block;
  padding: 3px 6px 3px 8px;
  border-left: 3px solid transparent;
  color: var(--link);
}
.toc > ol > li > a::before {
  content: counter(toc) ". ";
  color: #54595d;
  font-weight: 400;
}
.toc ol ol > li > a::before {
  content: counter(toc) "." counter(subtoc) " ";
  color: #54595d;
  font-weight: 400;
}
.toc a:hover { text-decoration: underline; }
.toc a.active {
  background: var(--toc-active-bg);
  border-left-color: var(--link);
  text-decoration: none;
}

/* ---------------- Main article ---------------- */
.article {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1000px;
}

.article h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  margin: 34px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  clear: none;
}

.article h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  margin: 24px 0 8px;
}

.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 26px; }
.article li { margin: 4px 0; }

/* Lead paragraph box (matches reference bordered intro) */
.lead {
  border: 1px solid var(--border-light);
  background: #ffffff;
  padding: 14px 16px;
  margin: 18px 0 20px;
}
.lead p:last-child { margin-bottom: 0; }

/* ---------------- Infobox (floated right) ---------------- */
.infobox {
  float: right;
  width: 292px;
  margin: 4px 0 18px 24px;
  border: 1px solid var(--border);
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  background: #fff;
}
.infobox caption {
  background: var(--infobox-header);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-bottom: none;
}
.infobox th, .infobox td {
  border: 1px solid var(--border);
  padding: 7px 9px;
  vertical-align: top;
  text-align: left;
}
.infobox th {
  width: 38%;
  background: #f8f9fa;
  font-weight: 700;
}
.infobox .infobox-sub {
  background: var(--infobox-sub);
  text-align: center;
  font-weight: 700;
}
.infobox img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* ---------------- Figures / images ---------------- */
figure {
  margin: 18px 0;
  border: 1px solid var(--border-light);
  padding: 6px;
  background: #f8f9fa;
  max-width: 340px;
}
figure.right { float: right; margin: 4px 0 16px 22px; }
figure img { width: 100%; height: auto; display: block; }
figcaption {
  font-family: var(--sans);
  font-size: 12px;
  color: #54595d;
  padding: 6px 4px 2px;
}

/* ---------------- Misc ---------------- */
.toc-inline {
  border: 1px solid var(--border-light);
  background: #f8f9fa;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  display: inline-block;
}
hr { border: none; border-top: 1px solid var(--border-light); margin: 26px 0; }
.clearfix::after { content: ""; display: block; clear: both; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; gap: 20px; padding: 20px 16px 60px; }
  .toc {
    position: static;
    width: 100%;
    max-height: none;
    border: 1px solid var(--border-light);
    background: #f8f9fa;
    padding: 12px 14px;
  }
  .infobox { float: none; width: 100%; margin: 0 0 18px; }
  figure.right { float: none; margin: 18px 0; max-width: 100%; }
}
