/* The documentation: sidebar | content | on this page. */

.docs {
    display: grid;
    grid-template-columns: 232px minmax(0, 760px) 168px;
    column-gap: 40px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    justify-content: center;
}
.docs > * { min-width: 0; }

/* ---------------------------------------------------------------- sidebar */
.docs-sidebar {
    position: sticky;
    top: var(--header-h);
    align-self: start;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 28px 16px 40px 0;
    border-right: 1px solid var(--border);
}
.doc-tree details { margin-bottom: 22px; }
.doc-tree summary {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    padding: 4px 0;
}
.doc-tree summary .icon { width: 14px; height: 14px; color: var(--text-3); transition: transform .15s; transform: rotate(-90deg); }
.doc-tree details[open] summary .icon { transform: none; }
.doc-tree ul { list-style: none; margin: 6px 0 0 6px; padding: 0 0 0 12px; border-left: 1px solid var(--border); }
.doc-tree li a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.3;
}
.doc-tree li a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.doc-tree li a[aria-current="page"] { background: var(--sel); color: var(--sel-text); font-weight: 600; }
.doc-tree li a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--accent); }

/* ---------------------------------------------------------------- content */
.docs-main { padding: 28px 0 96px; }
.docs-menubar { display: none; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--text-2); margin-bottom: 14px; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs .sep { color: var(--text-3); }
.breadcrumbs [aria-current="page"] { color: var(--text); }
.docs-main > header h1 { font-size: clamp(32px, 1.6rem + 1.4vw, 40px); font-weight: 700; line-height: 1.2; }
.docs-lead { font-size: 18px; color: var(--text-2); margin: 12px 0 10px; }
.docs-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.docs-meta a { color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.docs-meta a:hover { color: var(--text); }

.prose { font-size: 16px; line-height: 1.7; }
.prose h2 { font-size: 26px; font-weight: 700; line-height: 1.3; margin: 56px 0 12px; }
.prose h3 { font-size: 20px; font-weight: 600; line-height: 1.4; margin: 36px 0 10px; }
.prose > h2:first-child, .prose > .toc-inline + h2 { margin-top: 32px; }
.prose .anchor { margin-left: 8px; color: var(--text-3); opacity: 0; font-weight: 400; text-decoration: none; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 16px; }
.prose li { margin: 6px 0; }
.prose li + li { margin-top: 12px; }
.prose li > p + p { margin-top: 8px; }
.prose li > p { margin: 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a, .prose a.nav-link { color: var(--link); font-weight: 500; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* screenshots */
.prose img, .shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; margin: 20px 0 8px; }
.shot { margin: 24px 0; }
.shot img { margin: 0; }
.shot figcaption { margin-top: 10px; font-size: 13.5px; color: var(--text-3); }

/* callouts */
.callout { position: relative; margin: 24px 0; padding: 16px 20px 16px 48px; border: 1px solid var(--note-border); border-left-width: 3px; border-radius: 10px; background: var(--note-bg); color: var(--text); font-size: 15px; }
.callout > .icon { position: absolute; left: 18px; top: 17px; width: 18px; height: 18px; color: var(--note-fg); }
.callout__title { display: block; font-weight: 600; font-size: 14.5px; color: var(--note-fg); margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; }
.callout--tip { background: var(--tip-bg); border-color: var(--tip-border); }
.callout--tip > .icon, .callout--tip .callout__title { color: var(--tip-fg); }
.callout--warning { background: var(--warn-bg); border-color: var(--warn-border); }
.callout--warning > .icon, .callout--warning .callout__title { color: var(--warn-fg); }
.callout--danger { background: var(--danger-bg); border-color: var(--danger-border); }
.callout--danger > .icon, .callout--danger .callout__title { color: var(--danger-fg); }

/* screenshots shown smaller than they are open full size on a click */
.prose img.zoomable { cursor: zoom-in; }
dialog.zoom { max-width: 96vw; max-height: 94vh; padding: 0; border: 0; background: transparent; overflow: visible; }
dialog.zoom::backdrop { background: rgb(0 0 0 / .82); }
dialog.zoom img { display: block; max-width: 96vw; max-height: 90vh; width: auto; height: auto; border: 1px solid var(--border-strong); border-radius: 8px; cursor: zoom-out; }
dialog.zoom p { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }

/* tables */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th { background: var(--surface); text-align: left; font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 10px 14px; }
.prose td { padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: top; }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; }
.pager a:hover { border-color: var(--border-strong); text-decoration: none; }
.pager .label { display: block; font-size: 13px; color: var(--text-3); }
.pager .title { display: block; font-size: 17px; font-weight: 600; color: var(--link); }
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 599px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* ---------------------------------------------------------------- on this page */
.docs-toc {
    position: sticky;
    top: var(--header-h);
    align-self: start;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 32px 0 40px;
    font-size: 13.5px;
}
.docs-toc h2, .toc-inline summary { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.docs-toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-toc li a, .toc-inline li a { position: relative; display: block; padding: 4px 0 4px 12px; color: var(--text-2); line-height: 1.4; }
.docs-toc li.l3 a, .toc-inline li.l3 a { padding-left: 24px; }
.docs-toc li a:hover { color: var(--text); text-decoration: none; }
.docs-toc li a.is-current { color: var(--link); font-weight: 600; }
.docs-toc li a.is-current::before { content: ""; position: absolute; left: -2px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--accent); }
.docs-toc .back-to-top { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--text-3); font-size: 13px; }
.toc-inline { display: none; margin: 16px 0 8px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; }
.toc-inline summary { cursor: pointer; margin: 0; }
.toc-inline[open] summary { margin-bottom: 10px; }

/* ---------------------------------------------------------------- breakpoints */
@media (max-width: 1199px) {
    .docs { grid-template-columns: 232px minmax(0, 760px); }
    .docs-toc { display: none; }
    .toc-inline { display: block; }
}
@media (max-width: 959px) {
    .docs { grid-template-columns: minmax(0, 1fr); padding: 0; }
    .docs-sidebar { display: none; }
    .docs-main { padding: 0 20px 72px; }
    .docs-menubar {
        position: sticky;
        top: var(--header-h);
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 10px;
        height: 44px;
        margin: 0 -20px 20px;
        padding: 0 12px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        font-size: 13.5px;
        color: var(--text-2);
    }
    .docs-menubar button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--text); font: 600 13.5px var(--sans); cursor: pointer; }
    .docs-menubar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .code-block pre { font-size: 12.5px; }
}
