/* Theron Docs — Stride-like docs chrome, Theron tokens */

body.docs-site {
    background: var(--bg-primary);
    /* Reserve space for fixed header so content never sits underneath */
    padding-top: 56px;
}

/*
 * landing-theme.css styles every `nav` as sticky + z-index 1000.
 * Docs uses <nav> for breadcrumbs, TOC, and top links — without this reset,
 * those stick at top:0 and paint over the fixed menu bar while scrolling.
 */
body.docs-site nav {
    position: static;
    top: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
    z-index: auto;
    transition: none;
}

.docs-skip-link {
    position: absolute;
    left: -9999px;
    top: 0.75rem;
    z-index: 1200;
    padding: 0.55rem 0.9rem;
    background: var(--bg-secondary, #1a1a1a);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.docs-skip-link:focus {
    left: 0.75rem;
}

.docs-site :focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* —— Top bar —— */
.docs-topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100;
    height: 56px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--card-border);
}

.docs-topnav-inner {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.25rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    max-width: none;
}

.docs-topnav-left,
.docs-topnav-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    height: 100%;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
    line-height: 1;
}

.docs-logo img {
    height: 28px;
    width: auto;
}

.docs-logo-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.docs-top-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin: 0 0 0 0.5rem;
    padding: 0;
    /* Inherits body.docs-site nav reset; keep height from flex alignment */
    height: auto;
}

.docs-top-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    line-height: 1.2;
    transition: color 0.15s ease, background 0.15s ease;
}

.docs-top-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.docs-top-links a.active {
    color: var(--text-primary);
}

.docs-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(49, 49, 49, 0.55);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
    min-width: 220px;
    color: var(--text-tertiary);
}

.docs-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    min-width: 0;
}

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

.docs-search-kbd {
    font-size: 0.7rem;
    font-family: inherit;
    color: var(--text-tertiary);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    background: rgba(0, 0, 0, 0.25);
}

.docs-launch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    background: var(--primary-green);
    color: #000000 !important;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    text-decoration: none !important;
    text-transform: none;
    white-space: nowrap;
    border: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.docs-launch-btn:hover {
    filter: brightness(1.06);
    color: #000000 !important;
}

.docs-menu-btn {
    display: none;
    align-items: center;
    gap: 0.45rem;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
}

.docs-menu-btn.active {
    border-color: var(--primary-blue);
    color: var(--text-primary);
}

/* —— Layout: full-bleed sidebar + content + TOC —— */
.docs-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 56px);
    max-width: none;
    margin: 0;
}

.docs-sidebar {
    position: sticky;
    top: 56px;
    align-self: start;
    height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 1.25rem 0.85rem 2.5rem 1rem;
    border-right: 1px solid var(--card-border);
    background: var(--bg-secondary);
    scrollbar-width: thin;
}

.docs-sidebar-search-mobile {
    display: none;
    margin-bottom: 1rem;
    padding: 0 0.35rem;
}

.docs-search--sidebar {
    min-width: 0;
    width: 100%;
}

.docs-sidebar-section {
    margin-bottom: 1.5rem;
}

.docs-sidebar-section-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    padding: 0.4rem 0.65rem;
    text-decoration: none;
}

.docs-sidebar-section-title:hover {
    color: var(--primary-blue);
}

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

.docs-sidebar-nav--nested {
    margin-left: 0.55rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--card-border);
}

.docs-sidebar-nav a {
    display: block;
    padding: 0.38rem 0.65rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    line-height: 1.35;
    font-weight: 450;
}

.docs-sidebar-item--child {
    margin-left: 0.55rem;
}

.docs-sidebar-item--child a {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    padding-left: 0.75rem;
}

.docs-sidebar-item--child a:hover,
.docs-sidebar-item--child a.active {
    color: var(--text-primary);
}

.docs-sidebar-item--roundup a {
    color: var(--text-tertiary);
}

.docs-sidebar-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.docs-sidebar-nav a.active {
    color: var(--text-primary);
    background: rgba(98, 157, 255, 0.12);
    font-weight: 550;
}

.docs-content-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem;
    min-width: 0;
    align-items: start;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    justify-self: start;
}

.docs-main {
    padding: 2rem 1.5rem 4rem 2.5rem;
    min-width: 0;
    max-width: 760px;
}

.docs-toc {
    position: sticky;
    top: 72px;
    padding: 2rem 1rem 2rem 0;
    align-self: start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    width: 280px;
}

.docs-mobile-toc {
    display: none;
    margin: 0 0 1.25rem;
    padding: 0.85rem 0 0.25rem;
    border-top: 1px solid var(--card-border);
}

.docs-mobile-toc[hidden] {
    display: none !important;
}

.docs-toc[hidden] {
    display: none !important;
}

.docs-toc-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 0 0 0.65rem;
}

.docs-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-left: 1px solid var(--card-border);
    padding-left: 0.75rem;
}

.docs-toc-nav a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1.35;
}

.docs-toc-nav a:hover {
    color: var(--text-primary);
}

.docs-toc-nav a.docs-toc-h3 {
    padding-left: 0.65rem;
    font-size: 0.74rem;
}

/* —— Article —— */
.docs-article {
    max-width: 720px;
    margin: 0;
    padding-top: 0;
}

.docs-breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.docs-breadcrumb a {
    color: var(--text-tertiary);
    text-decoration: none;
}

.docs-breadcrumb a:hover {
    color: var(--primary-blue);
}

.docs-article h1 {
    font-size: clamp(1.85rem, 3.5vw, 2.4rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.18;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.docs-byline {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-bottom: 1.75rem;
}

.docs-byline strong {
    color: var(--text-secondary);
    font-weight: 550;
}

.docs-section-lead {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* Stride-like callout */
.docs-in-short {
    background: rgba(98, 157, 255, 0.07);
    border: 1px solid rgba(98, 157, 255, 0.22);
    border-left: 3px solid var(--primary-blue);
    border-radius: 10px;
    padding: 1rem 1.15rem 1.05rem;
    margin: 1.75rem 0 2rem;
}

.docs-in-short .label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-blue);
    margin-bottom: 0.4rem;
}

.docs-in-short p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.6;
}

.docs-content {
    line-height: 1.75;
}

.docs-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 0.9rem;
    letter-spacing: -0.015em;
    scroll-margin-top: 80px;
}

.docs-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.75rem 0 0.65rem;
    scroll-margin-top: 80px;
}

.docs-content p {
    margin-bottom: 1.15rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.75;
}

.docs-content ul,
.docs-content ol {
    margin: 1.15rem 0;
    padding-left: 1.35rem;
    color: var(--text-secondary);
}

.docs-content li {
    margin-bottom: 0.55rem;
    font-size: 1.02rem;
    line-height: 1.7;
}

.docs-content strong {
    color: var(--text-primary);
}

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

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

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: rgba(49, 49, 49, 0.45);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}

.docs-content table th {
    background: rgba(98, 157, 255, 0.08);
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
}

.docs-content table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-secondary);
    vertical-align: top;
}

.docs-content table tr:last-child td {
    border-bottom: none;
}

.docs-content .table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.docs-content .table-wrap table {
    margin: 0;
    min-width: 520px;
}

.docs-cta {
    background: rgba(49, 49, 49, 0.45);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2.25rem 0;
    text-align: left;
}

.docs-cta p {
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
    font-size: 0.98rem;
}

.docs-cta a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-green);
    color: #000000;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.35rem;
    border-radius: 12px;
    text-decoration: none;
    text-transform: none;
    letter-spacing: -0.01em;
    transition: filter 0.2s ease;
}

.docs-cta a.btn-primary:hover {
    filter: brightness(1.06);
    text-decoration: none;
    color: #000000;
}

.docs-faq {
    margin: 2.5rem 0;
}

.docs-faq h2 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
    scroll-margin-top: 80px;
}

.docs-faq details {
    border-bottom: 1px solid var(--card-border);
    background: transparent;
    margin-bottom: 0;
    padding: 0.9rem 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.docs-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

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

.docs-faq summary::after {
    content: '';
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-top: -0.2rem;
}

.docs-faq details[open] summary::after {
    transform: rotate(225deg);
    margin-top: 0.15rem;
}

.docs-faq details[open] summary {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.docs-faq details p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.docs-related {
    margin: 2.5rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.docs-related h2 {
    font-size: 1rem;
    margin-bottom: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

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

.docs-related li {
    margin-bottom: 0.45rem;
}

.docs-related a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.925rem;
}

.docs-card-grid {
    display: grid;
    gap: 0.65rem;
    margin: 1.25rem 0 2rem;
}

.docs-card {
    display: block;
    padding: 1rem 1.1rem;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.docs-card:hover {
    border-color: rgba(98, 157, 255, 0.4);
    background: rgba(49, 49, 49, 0.35);
    text-decoration: none;
}

.docs-card h3 {
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
}

.docs-card p {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 56px;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
}

.docs-overlay.visible {
    display: block;
}

body.docs-nav-open {
    overflow: hidden;
}

/* Docs pages: quieter marketing footer */
body.docs-site > footer {
    border-top: 1px solid var(--card-border);
    margin-top: 0;
}

.cluster-links {
    margin: 1.75rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--card-border);
}

.cluster-links h2,
.cluster-links h3 {
    font-size: 1rem;
    margin: 0 0 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.cluster-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cluster-links li {
    margin-bottom: 0.4rem;
}

.cluster-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.95rem;
}

.cluster-links a:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .docs-content-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: none;
    }

    .docs-toc {
        display: none;
    }

    .docs-mobile-toc:not([hidden]) {
        display: block;
    }
}

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

    .docs-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        width: min(300px, 88vw);
        height: calc(100% - 56px);
        max-height: calc(100% - 56px);
        z-index: 1080;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        padding-top: 1rem;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-sidebar-search-mobile {
        display: block;
    }

    .docs-menu-btn {
        display: inline-flex;
    }

    .docs-top-links {
        display: none;
    }

    .docs-search:not(.docs-search--sidebar) {
        display: none;
    }

    .docs-main {
        padding: 1.35rem 1.15rem 3rem;
        max-width: none;
    }

    .docs-menu-btn-label {
        display: none;
    }
}

@media (min-width: 480px) and (max-width: 1100px) {
    .docs-menu-btn-label {
        display: inline;
    }
}
