/*
 * The documentation pages (Docs module). Colours are the site's own tokens
 * (templates/assets/css/theme.css): nothing here picks a colour of its own
 * beyond the call-out accents, which are named for what they mean.
 */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Hero (the docs home and a product's) ----------------------------------- */
.docs-hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--accent-soft), var(--bg) 80%); border-bottom: 1px solid var(--border); }
.docs-hero h1 { margin: 10px 0 8px; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -.03em; }
.docs-hero p { max-width: 640px; margin: 0 0 18px; color: var(--muted); font-size: 18px; }
.docs-hero .docs-search { max-width: 560px; margin-bottom: 18px; }

.docs-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 36px 0 72px; }
.docs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.docs-card h2 { margin: 0 0 10px; font-size: 19px; }
.docs-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.docs-card li { display: grid; gap: 2px; }
.docs-card li small { color: var(--muted); line-height: 1.4; }

/* ---- Search box ------------------------------------------------------------- */
.docs-search { display: flex; gap: 8px; }
.docs-search input[type=search] { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font: inherit; background: var(--surface); color: var(--text); }
.docs-search input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: var(--accent); box-shadow: none; }

/* ---- Page: sidebar, article, on-this-page ----------------------------------- */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr) 210px; gap: 36px; padding: 32px 0 72px; align-items: start; }
.docs-side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding-right: 8px; }
.docs-side .docs-search { margin-bottom: 14px; }
.docs-side .docs-search button { padding: 8px 12px; }
.docs-product { display: block; margin-bottom: 10px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.docs-group { margin-bottom: 16px; }
.docs-group-title { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.docs-group ul { list-style: none; margin: 0; padding: 0; }
.docs-group a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text); font-size: 15px; line-height: 1.4; }
.docs-group a:hover { background: var(--surface-2); text-decoration: none; }
.docs-group a[aria-current=page] { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.docs-draft-pill { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 10px; background: var(--surface-2); color: var(--warning); font-size: 11px; font-weight: 700; vertical-align: middle; }
.docs-menu-toggle { display: none; }

.docs-main { min-width: 0; }
.docs-main-wide { grid-column: 1 / -1; max-width: 820px; }
.docs-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.docs-main h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.docs-lead { margin: 0 0 8px; color: var(--muted); font-size: 18px; }
.docs-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.docs-banner { margin-bottom: 18px; padding: 10px 14px; border: 1px solid var(--warning); border-radius: 10px; background: var(--surface-2); font-size: 14px; }

.docs-toc { position: sticky; top: 88px; font-size: 14px; }
.docs-toc-title { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.4; }
.docs-toc li a:hover { color: var(--text); text-decoration: none; }
.docs-toc li a.active { border-left-color: var(--accent); color: var(--accent-2); }
.docs-toc .docs-toc-3 a { padding-left: 24px; font-size: 13px; }

/* ---- The page's own words --------------------------------------------------- */
.docs-body { font-size: 16.5px; line-height: 1.7; }
.docs-body h1, .docs-body h2, .docs-body h3, .docs-body h4 { position: relative; margin: 1.9em 0 .55em; line-height: 1.25; scroll-margin-top: 88px; }
.docs-body h2 { padding-top: .5em; border-top: 1px solid var(--border); font-size: 24px; }
.docs-body h3 { font-size: 19px; }
.docs-body h4 { font-size: 16px; }
.docs-body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.docs-anchor { margin-left: 6px; color: var(--border-strong); font-weight: 400; opacity: 0; text-decoration: none; }
.docs-body h1:hover .docs-anchor, .docs-body h2:hover .docs-anchor, .docs-body h3:hover .docs-anchor, .docs-body h4:hover .docs-anchor, .docs-anchor:focus { opacity: 1; }
.docs-body p { margin: 0 0 1em; }
.docs-body ul, .docs-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.docs-body li { margin: .25em 0; }
.docs-body li > ul, .docs-body li > ol { margin: .3em 0; }
.docs-body li > pre { margin: .6em 0; }
.docs-body img { display: block; max-width: 100%; height: auto; margin: 1em 0; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.docs-body hr { margin: 2em 0; border: 0; border-top: 1px solid var(--border); }
.docs-body blockquote { margin: 0 0 1em; padding: .1em 1em; border-left: 3px solid var(--border-strong); color: var(--muted); }
.docs-body :not(pre) > code { padding: .1em .38em; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: .88em; overflow-wrap: anywhere; }

.docs-body pre.doc-code { position: relative; margin: 0 0 1.2em; padding: 14px 16px; overflow-x: auto; border-radius: 10px; background: var(--footer); color: var(--footer-text); font-size: 14px; line-height: 1.55; }
.docs-body pre.doc-code code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }
.doc-copy { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border: 1px solid var(--footer-muted); border-radius: 6px; background: transparent; color: var(--footer-text); font: inherit; font-size: 12px; cursor: pointer; opacity: .85; }
.doc-copy:hover, .doc-copy:focus { opacity: 1; background: rgba(255, 255, 255, .08); }

.doc-table { margin: 0 0 1.2em; overflow-x: auto; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-table th, .doc-table td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.doc-table th { background: var(--surface-2); font-weight: 700; }

.doc-callout { margin: 0 0 1.2em; padding: 12px 16px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; background: var(--bg-soft); }
.doc-callout > :last-child { margin-bottom: 0; }
.doc-callout-title { margin-bottom: 4px; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.doc-callout-note { border-left-color: var(--accent); }
.doc-callout-tip { border-left-color: var(--success); background: var(--success-soft); }
.doc-callout-warning { border-left-color: var(--warning); }
.doc-callout-danger { border-left-color: var(--danger); background: var(--danger-soft); }

/* ---- Previous / next, results ----------------------------------------------- */
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 16px; }
.docs-pager a { display: grid; gap: 2px; max-width: 48%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.docs-pager a:hover { border-color: var(--accent); text-decoration: none; }
.docs-pager small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.docs-pager span { font-weight: 600; color: var(--accent-2); }
.docs-next { margin-left: auto; text-align: right; }
.docs-help { font-size: 14px; }

.docs-results { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 18px; }
.docs-results li { display: grid; gap: 2px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.docs-results li > a { font-size: 18px; font-weight: 600; }
.docs-results small { color: var(--muted); }
.docs-results p { margin: 4px 0 0; color: var(--text); font-size: 15px; }

/* ---- Narrower screens -------------------------------------------------------- */
@media (max-width: 1100px) {
  .docs { grid-template-columns: 240px minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; }
  .docs-menu-toggle { display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
  .docs-menu-toggle::after { content: "\25BE"; float: right; }
  .docs-side { position: static; display: none; max-height: none; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
  .docs-side.open { display: block; }
  .docs-pager a { max-width: 100%; }
}

@media (max-width: 560px) {
  .docs-pager { flex-direction: column; }
  .docs-next { margin-left: 0; text-align: left; }
  .docs-hero { padding-top: 36px; }
}
