/* docs.css — Microsoft Learn-style documentation page (page-specific, loaded via @@section Styles) */

.docs-page {
    /* Scoped override: the global --border-dark is nearly invisible on dark bg.
       Redefining it here only affects elements inside .docs-page. */
    --border-dark: rgba(255, 255, 255, .09);
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr) 230px;
    gap: 2.5rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
    align-items: start;
}

/* ---------------- Left navigation ---------------- */
.docs-nav {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding-right: .5rem;
}

.docs-search {
    margin-bottom: 1rem;
}

.docs-search-input {
    width: 100%;
    padding: .55rem .8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: .9rem;
    outline: none;
}

.docs-search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(14, 167, 231, .25);
}

.docs-search-input::placeholder {
    color: var(--text-muted);
}

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

.docs-tree-list .docs-tree-list {
    /* nested levels */
    margin-left: .65rem;
    border-left: 1px solid var(--border-dark);
    padding-left: .35rem;
}

/* Collapse children by default; expand when active trail or toggled/searched */
.docs-tree-item.has-children > .docs-tree-list {
    display: none;
}

.docs-tree-item.expanded > .docs-tree-list,
.docs-tree-item.search-expand > .docs-tree-list {
    display: block;
}

.docs-tree-item.search-hidden {
    display: none;
}

.docs-tree-row {
    display: flex;
    align-items: center;
    gap: .15rem;
}

.docs-tree-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 auto;
}

.docs-tree-caret {
    transition: transform .15s ease;
    font-size: .7rem;
    line-height: 1;
}

.docs-tree-item.expanded > .docs-tree-row .docs-tree-caret,
.docs-tree-item.search-expand > .docs-tree-row .docs-tree-caret {
    transform: rotate(90deg);
}

.docs-tree-spacer {
    width: 1.25rem;
    flex: 0 0 auto;
}

.docs-tree-link {
    display: block;
    flex: 1 1 auto;
    padding: .35rem .55rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .92rem;
    line-height: 1.3;
}

.docs-tree-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .04);
}

.docs-tree-link.active {
    color: var(--accent-blue);
    background: rgba(14, 167, 231, .12);
    font-weight: 600;
}

.docs-tree-empty {
    color: var(--text-muted);
    font-size: .85rem;
    padding: .5rem .25rem;
}

/* ---------------- Center content ---------------- */
.docs-content {
    min-width: 0;
}

.docs-breadcrumbs {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}

.docs-breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.docs-breadcrumbs a:hover {
    color: var(--accent-blue);
}

.docs-breadcrumb-sep {
    color: var(--border-dark);
}

.docs-breadcrumb-current {
    color: var(--text-primary);
}

.docs-article {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 1rem;
    max-width: 820px;
}

.docs-article h1 {
    font-size: 2rem;
    margin: 0 0 1.25rem;
}

.docs-article h2 {
    font-size: 1.45rem;
    margin: 2.25rem 0 1rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--border-dark);
}

.docs-article h3 {
    font-size: 1.15rem;
    margin: 1.75rem 0 .75rem;
}

.docs-article :is(h1, h2, h3, h4) {
    scroll-margin-top: 90px; /* offset for the sticky site header on anchor jumps */
}

/* Hover-reveal "copy link" anchor injected next to h2/h3/h4 by docs.js. */
.docs-article .docs-heading {
    position: relative;
}

.docs-heading-anchor {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: .4rem;
    vertical-align: middle;
    color: var(--text-muted);
    opacity: 0;
    text-decoration: none;
    transition: opacity .12s ease, color .12s ease;
}

.docs-heading:hover .docs-heading-anchor,
.docs-heading-anchor:focus-visible {
    opacity: 1;
}

.docs-heading-anchor:hover {
    color: var(--accent-blue);
    text-decoration: none;
}

.docs-heading-anchor.copied {
    opacity: 1;
    color: var(--accent-green);
}

.docs-heading-anchor.copied::after {
    content: "Copied!";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    padding: .3rem .45rem;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: var(--bg-darkest);
    color: var(--text-primary);
    font-size: .72rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.docs-article p,
.docs-article ul,
.docs-article ol {
    margin: 0 0 1rem;
}

.docs-article a {
    color: var(--accent-blue);
    text-decoration: none;
}

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

.docs-article code {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: .1rem .35rem;
    font-size: .88em;
}

.docs-article pre {
    background: var(--bg-darkest);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    margin: 0 0 1.25rem;
}

.docs-article pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: .88rem;
}

.docs-article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
    margin: .5rem 0 1.25rem;
}

.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
    font-size: .92rem;
}

.docs-article th,
.docs-article td {
    border: 1px solid var(--border-dark);
    padding: .55rem .75rem;
    text-align: left;
}

.docs-article th {
    background: var(--bg-card);
    color: var(--text-primary);
}

.docs-article blockquote {
    border-left: 3px solid var(--accent-blue);
    margin: 0 0 1.25rem;
    padding: .25rem 0 .25rem 1rem;
    color: var(--text-muted);
}

/* ---------------- Right "On this page" ---------------- */
.docs-onthispage {
    font-size: .85rem;
}

.docs-otp-sticky {
    position: sticky;
    top: 1.5rem;
}

.docs-otp-title {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .72rem;
    color: var(--text-muted);
    margin: 0 0 .6rem;
    font-weight: 700;
}

.docs-otp-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--border-dark);
}

.docs-otp-item a {
    display: block;
    padding: .25rem .75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1px;
    line-height: 1.35;
}

.docs-otp-item a:hover {
    color: var(--text-primary);
}

.docs-otp-item.active a {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

.docs-otp-level-3 a {
    padding-left: 1.5rem;
    font-size: .8rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
    .docs-page {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .docs-onthispage {
        display: none;
    }
}

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

    .docs-nav {
        position: static;
        max-height: none;
        overflow: visible;
        border-bottom: 1px solid var(--border-dark);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}
