/* ─── DOCUMENTATION ───────────────────────────────────────────────────────────
   Shared styles for /docs/ (landing, section, and article pages). Pages are
   generated from docs-src/ by `node builder/docs.js`. */

.docs-nav-active {
  color: #1a1840 !important;
  font-weight: 500 !important;
}

/* ─── Hero (landing + compact variant) ─────────────────────────────────────── */

.docs-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: white;
  padding: 72px 24px 76px;
}

.docs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/hero/8.png") center 42% / cover no-repeat;
  transform: scale(1.02);
  z-index: 0;
}

.docs-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 2, 22, 0.72) 0%, rgba(10, 8, 48, 0.55) 60%, rgba(14, 10, 60, 0.62) 100%);
  z-index: 1;
}

.docs-hero > * {
  position: relative;
  z-index: 2;
}

.docs-hero h1 {
  font-size: 3.1em;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: white;
  margin: 0 0 10px;
}

.docs-hero h1 em {
  font-style: italic;
  font-weight: 400;
}

.docs-hero p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.1em;
  max-width: 560px;
  margin: 0 auto 28px;
}

.docs-hero.compact {
  padding: 34px 24px 38px;
}

.docs-hero.compact h1 {
  font-size: 2em;
  margin: 0 0 18px;
}

.docs-hero.compact h1 a {
  color: inherit;
  text-decoration: none;
}

/* ─── Search ────────────────────────────────────────────────────────────────── */

.docs-search {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}

.docs-search input {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  height: 56px;
  padding: 0 20px 0 52px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  color: #2d2924;
  background: white url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a7e72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") 20px center no-repeat;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.docs-hero.compact .docs-search input {
  height: 46px;
  font-size: 15px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.docs-search input:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(102, 110, 232, 0.55),
    0 10px 40px rgba(0, 0, 0, 0.3);
}

.docs-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  z-index: 20;
  max-height: 420px;
  overflow-y: auto;
}

.docs-search-results.open {
  display: block;
}

.docs-search-results a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: #2d2924;
}

.docs-search-results a:last-child {
  border-bottom: 0;
}

.docs-search-results a:hover,
.docs-search-results a.selected {
  background: #f4f2ff;
}

.docs-search-results .title {
  font-weight: 500;
  color: #1a1840;
}

.docs-search-results .section {
  display: block;
  font-size: 0.82em;
  color: #8a7e72;
  margin-top: 2px;
}

.docs-search-results .empty {
  padding: 16px 20px;
  color: #8a7e72;
  font-size: 0.95em;
}

/* ─── Page containers ───────────────────────────────────────────────────────── */

.docs-container {
  max-width: 1070px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.docs-breadcrumbs {
  font-size: 0.9em;
  color: #8a7e72;
  padding: 26px 0 18px;
}

.docs-breadcrumbs a {
  color: #555abf;
  text-decoration: none;
}

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

.docs-breadcrumbs span.sep {
  margin: 0 8px;
  color: #c4bcb1;
}

/* ─── Landing page: section grid ───────────────────────────────────────────── */

.docs-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 44px;
}

.docs-section-card {
  background: #faf7f2;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 26px 28px 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.docs-section-card:hover {
  box-shadow: 0 10px 30px rgba(40, 30, 80, 0.08);
  transform: translateY(-2px);
}

.docs-section-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(160deg, #7c80ee 0%, #5558d8 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.docs-section-card .icon svg {
  width: 20px;
  height: 20px;
}

.docs-section-card h2 {
  font-size: 1.35em;
  font-weight: 500;
  margin: 0 0 4px;
  color: #1a1840;
}

.docs-section-card h2 a {
  color: inherit;
  text-decoration: none;
}

.docs-section-card h2 a:hover {
  color: #555abf;
}

.docs-section-card p.desc {
  margin: 0 0 14px;
  color: #6f6559;
  font-size: 0.95em;
}

.docs-section-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-section-card li {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.docs-section-card li a {
  display: block;
  padding: 8px 0;
  color: #3d3830;
  text-decoration: none;
  font-size: 0.95em;
}

.docs-section-card li a:hover {
  color: #555abf;
}

.docs-section-card .see-all {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.9em;
  font-weight: 500;
  color: #555abf;
  text-decoration: none;
}

.docs-section-card .see-all:hover {
  text-decoration: underline;
}

/* ─── Two-column layout (section + article pages) ──────────────────────────── */

.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 24px;
}

.docs-sidebar h4 {
  font-family: "DM Sans", sans-serif;
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a7e72;
  margin: 8px 0 10px;
}

.docs-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

.docs-sidebar li a {
  display: block;
  padding: 7px 12px;
  margin-left: -12px;
  border-radius: 6px;
  color: #3d3830;
  text-decoration: none;
  font-size: 0.93em;
  line-height: 1.4em;
}

.docs-sidebar li a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1a1840;
}

.docs-sidebar li.current a {
  background: rgba(102, 110, 232, 0.12);
  color: #3d42a8;
  font-weight: 500;
}

.docs-main {
  min-width: 0;
}

.docs-main > h1 {
  font-size: 2.3em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #1a1840;
  margin: 0 0 8px;
}

.docs-main p.section-desc {
  color: #6f6559;
  font-size: 1.08em;
  margin: 0 0 28px;
}

/* ─── Section page: article list ───────────────────────────────────────────── */

.docs-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.docs-article-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.docs-article-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 4px;
  text-decoration: none;
  color: #1a1840;
  font-size: 1.05em;
  transition: padding-left 140ms ease;
}

.docs-article-list a:hover {
  color: #555abf;
  padding-left: 10px;
}

.docs-article-list a::after {
  content: "\2192";
  margin-left: auto;
  color: #c4bcb1;
  transition: transform 140ms ease, color 140ms ease;
}

.docs-article-list a:hover::after {
  color: #555abf;
  transform: translateX(3px);
}

.docs-article-list .summary {
  display: block;
  font-size: 0.85em;
  color: #8a7e72;
  margin-top: 2px;
}

/* ─── Pro badge ─────────────────────────────────────────────────────────────── */

.pro-badge {
  display: inline-block;
  vertical-align: middle;
  font-family: "DM Sans", sans-serif;
  font-size: 0.68em;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b4fc9;
  background: rgba(102, 110, 232, 0.14);
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.5em;
  white-space: nowrap;
}

.docs-article-list .pro-badge,
.docs-section-card .pro-badge {
  margin-left: 6px;
}

/* ─── Article page ──────────────────────────────────────────────────────────── */

.docs-article-meta {
  font-size: 0.88em;
  color: #8a7e72;
  margin: 0 0 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.docs-article-meta .pro-badge {
  font-size: 0.82em;
}

.docs-article-body {
  font-size: 1.05em;
  line-height: 1.7em;
  color: #3d3528;
}

.docs-article-body p.lede {
  font-size: 1.12em;
  color: #2d2924;
}

.docs-article-body h2 {
  font-size: 1.55em;
  font-weight: 500;
  color: #1a1840;
  margin: 44px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.docs-article-body h3 {
  font-family: "DM Sans", sans-serif;
  font-size: 1.1em;
  font-weight: 500;
  color: #1a1840;
  margin: 30px 0 6px;
}

.docs-article-body h4 {
  font-family: "DM Sans", sans-serif;
  font-size: 1em;
  font-weight: 500;
  color: #3d3830;
  margin: 24px 0 4px;
}

.docs-article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 24px rgba(40, 30, 80, 0.08);
}

.docs-article-body img.inline {
  display: inline;
  margin: 0;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  vertical-align: middle;
}

.docs-article-body ul,
.docs-article-body ol {
  padding-left: 24px;
}

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

.docs-article-body code,
.docs-article-body kbd {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.docs-article-body kbd {
  font-family: "DM Sans", sans-serif;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom-width: 2px;
  background: #fff;
}

.docs-article-body pre {
  background: #2d2924;
  color: #f4efe6;
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.55em;
}

.docs-article-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.docs-article-body blockquote {
  margin: 20px 0;
  padding: 4px 20px;
  border-left: 3px solid rgba(102, 110, 232, 0.5);
  color: #6f6559;
}

.docs-article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0 24px;
  font-size: 0.95em;
}

.docs-article-body th,
.docs-article-body td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: top;
}

.docs-article-body th {
  font-weight: 500;
  color: #1a1840;
}

.docs-article-body .callout {
  background: rgba(102, 110, 232, 0.08);
  border: 1px solid rgba(102, 110, 232, 0.22);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0 28px;
  font-size: 0.95em;
}

.docs-article-body .callout.warning {
  background: rgba(214, 140, 40, 0.09);
  border-color: rgba(214, 140, 40, 0.3);
}

/* ─── Article footer: prev/next + help ─────────────────────────────────────── */

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.docs-pager a {
  text-decoration: none;
  color: #1a1840;
  max-width: 48%;
  font-size: 0.95em;
}

.docs-pager a:hover {
  color: #555abf;
}

.docs-pager a small {
  display: block;
  font-size: 0.8em;
  color: #8a7e72;
  margin-bottom: 2px;
}

.docs-pager a.next {
  margin-left: auto;
  text-align: right;
}

.docs-help {
  margin-top: 56px;
  background: #faf7f2;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.docs-help h3 {
  margin: 0 0 4px;
  font-size: 1.2em;
  font-weight: 500;
  color: #1a1840;
}

.docs-help p {
  margin: 0;
  color: #6f6559;
  font-size: 0.95em;
}

.docs-help .text {
  flex: 1;
  min-width: 240px;
}

.docs-help .btn {
  margin: 0;
  height: 42px;
  line-height: 42px;
  padding: 0 24px;
  font-size: 14px;
}

.docs-landing-help {
  margin-top: 56px;
}

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

@media (max-width: 800px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .docs-sidebar {
    position: static;
    order: 2;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .docs-sections {
    grid-template-columns: 1fr;
  }

  .docs-hero h1 {
    font-size: 2.3em;
  }
}

/* ─── Collapsible sections inside articles ─────────────────────────────────── */

.docs-article-body details {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #faf7f2;
  padding: 0 18px;
  margin: 14px 0;
}

.docs-article-body details summary {
  cursor: pointer;
  font-weight: 500;
  color: #1a1840;
  padding: 12px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-article-body details summary::-webkit-details-marker {
  display: none;
}

.docs-article-body details summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #8a7e72;
  border-bottom: 2px solid #8a7e72;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
  flex-shrink: 0;
}

.docs-article-body details[open] summary::before {
  transform: rotate(45deg);
}

.docs-article-body details[open] summary {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 8px;
}

.docs-article-body details > :last-child {
  margin-bottom: 14px;
}

.docs-article-body img.narrow {
  max-width: 340px;
}

.docs-article-body img.medium {
  max-width: 520px;
}

.docs-article-body td:first-child {
  font-weight: 500;
  color: #1a1840;
}
