/* ============================================
   Docs Section – GitBook-style layout
   ============================================ */

/* Override the site's default flex-container so the docs wrapper fills the space */
.docs-wrapper {
  display: flex;
  min-height: calc(100vh - 72px);
  background: #fff;
}

/* ---- Sidebar ---- */

.docs-sidebar {
  width: 280px;
  min-width: 280px;
  background: #fafbfc;
  border-right: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  z-index: 10;
}

.docs-sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 16px 0;
}

.docs-sidebar__top-link {
  list-style: none;
  margin-bottom: 8px;
}

.docs-sidebar__top-link .docs-sidebar__link {
  padding-left: 24px;
  font-weight: 600;
  font-size: 0.9rem;
}

.docs-sidebar__section {
  margin-bottom: 2px;
}

.docs-sidebar__section-title {
  display: block;
  padding: 10px 24px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-sidebar__pages {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar__pages--open {
  display: block;
}

.docs-sidebar__link {
  display: block;
  padding: 5px 24px 5px 46px;
  font-size: 0.835rem;
  color: #555;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
}

.docs-sidebar__link:hover {
  color: #009b72;
  background: rgba(0, 155, 114, 0.04);
  text-decoration: none;
}

.docs-sidebar__link--active {
  color: #009b72;
  font-weight: 600;
  background: rgba(0, 155, 114, 0.07);
  border-left-color: #009b72;
}

/* ---- Main content area ---- */

.docs-main {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-start;
}

.docs-content {
  width: 100%;
  max-width: 800px;
  padding: 32px 48px 64px;
  margin: 0 auto;
}

/* ---- On-page TOC (right sidebar) ---- */

.docs-toc {
  width: 220px;
  min-width: 220px;
  padding: 32px 16px 32px 0;
  position: sticky;
  top: 72px;
  height: fit-content;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  flex-shrink: 0;
}

.docs-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid #e8eaed;
}

.docs-toc__item {
  margin: 0;
}

.docs-toc__item--h2 {
  padding-left: 0;
}

.docs-toc__item--h3 {
  padding-left: 10px;
}

.docs-toc__link {
  display: block;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: #888;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}

.docs-toc__link:hover {
  color: #009b72;
  text-decoration: none;
}

.docs-toc__link--active {
  color: #1a1a1a;
  font-weight: 600;
  border-left-color: #009b72;
}

/* ---- Breadcrumb ---- */

.docs-breadcrumb {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 24px;
}

.docs-breadcrumb a {
  color: #009b72;
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  text-decoration: underline;
}

.docs-breadcrumb__sep {
  margin: 0 6px;
  color: #ccc;
}

/* ---- Article typography ---- */

.docs-article {
  line-height: 1.75;
  color: #2c2c2c;
}

.docs-article h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.docs-article h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 40px 0 12px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  color: #1a1a1a;
  line-height: 1.35;
  scroll-margin-top: 88px;
}

.docs-article h2:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.docs-article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 28px 0 8px;
  color: #1a1a1a;
  scroll-margin-top: 88px;
}

.docs-article p {
  margin: 0 0 16px;
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

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

.docs-article a {
  color: #009b72;
  text-decoration: none;
}

.docs-article a:hover {
  text-decoration: underline;
}

.docs-article code {
  background: #f4f5f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: #c7254e;
}

.docs-article pre {
  background: #f4f5f7;
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.docs-article pre code {
  background: none;
  padding: 0;
  color: #2c2c2c;
}

.docs-article blockquote {
  border-left: 3px solid #009b72;
  margin: 0 0 16px;
  padding: 12px 20px;
  background: rgba(0, 155, 114, 0.04);
  color: #444;
}

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

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 0.92rem;
}

.docs-article thead th {
  background: #f4f5f7;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #ddd;
}

.docs-article tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.docs-article tbody tr:hover {
  background: #fafbfc;
}

.docs-article img {
  max-width: 100%;
  border-radius: 6px;
  margin: 8px 0;
}

.docs-article hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 32px 0;
}

/* ---- Callout boxes ---- */

.docs-callout {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0 0 16px;
  border-left: 4px solid;
}

.docs-callout__header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-callout__icon {
  font-size: 1rem;
}

.docs-callout__body {
  font-size: 0.92rem;
  line-height: 1.6;
}

.docs-callout__body p:last-child {
  margin-bottom: 0;
}

.docs-callout--tip {
  background: #f0faf6;
  border-color: #009b72;
  color: #1a5c42;
}

.docs-callout--note {
  background: #f0f4ff;
  border-color: #4a7eff;
  color: #1e3a6e;
}

.docs-callout--warning {
  background: #fff8f0;
  border-color: #e8912d;
  color: #6e3a0a;
}

.docs-callout--info-advanced {
  background: #f5f0ff;
  border-color: #7c3aed;
  color: #3b1e6e;
}

/* ---- Prev / Next pagination ---- */

.docs-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.docs-pagination__link {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 48%;
}

.docs-pagination__link:hover {
  border-color: #009b72;
  box-shadow: 0 2px 8px rgba(0, 155, 114, 0.08);
  text-decoration: none;
}

.docs-pagination__link--prev {
  align-items: flex-start;
}

.docs-pagination__link--next {
  align-items: flex-end;
  margin-left: auto;
}

.docs-pagination__direction {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 500;
}

.docs-pagination__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #009b72;
  margin-top: 2px;
}

/* ---- Mobile toggle ---- */

.docs-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: #009b72;
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  align-items: center;
  gap: 6px;
}

.docs-sidebar-overlay {
  display: none;
}

/* ---- Responsive ---- */

@media (max-width: 1199px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 991px) {
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    min-width: 280px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: none;
  }

  .docs-sidebar--open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .docs-mobile-toggle {
    display: flex;
  }

  .docs-sidebar-overlay--visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
  }

  .docs-content {
    padding: 24px 20px 64px;
  }

  .docs-pagination {
    flex-direction: column;
  }

  .docs-pagination__link {
    max-width: 100%;
    width: 100%;
  }

  .docs-pagination__link--next {
    align-items: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .docs-article h1 {
    font-size: 1.6rem;
  }

  .docs-article h2 {
    font-size: 1.25rem;
  }

  .docs-content {
    padding: 16px 16px 48px;
  }
}

/* Treasury widget */
.docs-treasury {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

.docs-treasury__overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 1.5rem 0 2rem;
}

.docs-treasury__stat {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.docs-treasury__stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.docs-treasury__stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.docs-treasury__chart-wrap {
  max-width: 480px;
  margin: 1rem 0 2rem;
}

.docs-treasury__table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.docs-treasury__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.docs-treasury__table thead {
  background: #f8fafc;
}

.docs-treasury__table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.docs-treasury__table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  white-space: nowrap;
}

.docs-treasury__table tbody tr:last-child td {
  border-bottom: none;
}

.docs-treasury__table tbody tr:hover {
  background: #f8fafc;
}

.docs-treasury__table a {
  color: #2563eb;
  text-decoration: none;
}

.docs-treasury__table a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .docs-treasury__overview {
    grid-template-columns: 1fr;
  }

  .docs-treasury__chart-wrap {
    max-width: 100%;
  }
}
