/* ============================================
   Glitch AI Engine Website - Docs Pages Styles
   ============================================ */

/* Documentation Layout */
.docs-container {
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
    padding-top: var(--navbar-height);
    --docs-float-gap: 12px;
}

/* Sidebar - mobile drawer base */
.docs-sidebar {
    width: var(--sidebar-width, 280px);
    min-width: var(--sidebar-width, 280px);
    background: var(--color-frost-surface);
    padding: 0.75rem 0 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    transition: transform 0.3s ease;
}

/* Desktop: centered content shell - sidebar is NOT in this flow */
@media (min-width: 769px) {
    .docs-page .docs-container {
        display: block;
        max-width: var(--page-max-width, 1200px);
        margin-left: auto;
        margin-right: auto;
        padding: calc(var(--navbar-height) + var(--spacing-24, 24px))
            var(--page-padding-x, 24px)
            0;
        box-sizing: border-box;
    }

    .docs-page .docs-sidebar.is-floating {
        position: fixed;
        width: var(--sidebar-width, 280px);
        height: auto;
        max-height: calc(100vh - var(--navbar-height) - var(--docs-float-gap) * 2);
        border: 1px solid var(--color-pewter-rule);
        border-radius: var(--radius-cards, 4px);
        z-index: 90;
        box-sizing: border-box;
    }

    .docs-page .docs-content {
        width: 100%;
        padding: 0 0 4rem;
        border-left: none;
    }

    .docs-page.float-nav-overlap .docs-content {
        padding-left: calc(var(--sidebar-width, 280px) + var(--spacing-24, 24px));
    }

    .docs-page .docs-content-wrapper {
        max-width: min(100%, var(--docs-content-max, 900px));
        margin: 0;
    }
}

.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.docs-sidebar-content {
    padding: 0 1.5rem 6rem 1.5rem; /* Increased bottom padding for mobile */
}

.docs-sidebar h3 {
    font-family: var(--font-geist-mono);
    color: var(--color-granite-mute);
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
    line-height: 1.3;
}

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

.docs-sidebar ul li {
    margin-bottom: 0.25rem;
}

.docs-sidebar-link-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-stone-mid);
    opacity: 0.9;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.docs-sidebar-link-label {
    flex: 1;
    min-width: 0;
}

.docs-sidebar a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: var(--font-geist);
    color: var(--color-iron-caption);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-cards, 4px);
    font-size: 14px;
    letter-spacing: -0.03em;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    position: relative;
    border-left: 2px solid transparent;
}

.docs-sidebar a::after {
    content: '⟶';
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
    color: var(--color-granite-mute);
    opacity: 0.45;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.docs-sidebar a:hover {
    color: var(--color-ink);
    background: var(--color-frost-surface);
}

.docs-sidebar a:hover .docs-sidebar-link-icon,
.docs-sidebar a.active .docs-sidebar-link-icon {
    color: var(--color-signal-orange);
    opacity: 1;
}

.docs-sidebar a:hover::after {
    opacity: 1;
    color: var(--color-signal-orange);
    transform: translateX(2px);
}

.docs-sidebar a.active {
    color: var(--color-ink);
    background: var(--color-frost-surface);
    font-weight: 400;
    border-left: 2px solid var(--color-signal-orange);
}

.docs-sidebar a.active::after {
    opacity: 1;
    color: var(--color-signal-orange);
}

.docs-sidebar .sidebar-section {
    margin-bottom: 0;
}

.docs-sidebar .sidebar-section + .sidebar-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-pewter-rule);
}

/* Main Content Area */
.docs-content {
    padding: 2rem 0 3rem;
    background: transparent;
}

.docs-content-wrapper {
    max-width: min(100%, var(--docs-content-max, 900px));
    margin: 0;
}

.docs-content h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.docs-content h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.docs-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.docs-content h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-content p {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.docs-content ul,
.docs-content ol {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.docs-content li {
    margin-bottom: 0.75rem;
}


.docs-content code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9375rem;
    border: 1px solid var(--code-border);
}

.docs-content pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    position: relative;
}

.docs-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Syntax-highlighted code blocks (JSON, shell, file lists) */
.docs-content .code-block {
    position: relative;
    margin-bottom: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-cards, 4px);
    overflow: hidden;
    border: 1px solid var(--color-pewter-rule);
    box-shadow: none;
    background: var(--color-frost-surface);
    padding: 1rem 3.25rem 1rem 1.25rem;
}

.docs-content .code-block:has(pre) {
    padding: 0;
    padding-right: 0;
}

.docs-content .code-block pre {
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--color-frost-surface);
    border: none;
    border-radius: 0;
    padding: 1rem 3.25rem 1rem 1.25rem;
    overflow-x: auto;
}

.docs-content .code-block pre code,
.docs-content .code-block .command-syntax {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--color-ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    box-sizing: border-box;
}

.docs-content .c-key { color: var(--color-ink); }
.docs-content .c-str { color: var(--color-graphite-body); }
.docs-content .c-bool { color: var(--color-ember-edge); }
.docs-content .c-num { color: var(--color-iron-caption); }
.docs-content .c-brace { color: var(--color-granite-mute); }
.docs-content .c-punct { color: var(--color-granite-mute); }
.docs-content .c-path { color: var(--color-ink); }
.docs-content .c-cmd { color: var(--color-signal-orange); }
.docs-content .c-flag { color: var(--color-graphite-body); }
.docs-content .c-arg { color: var(--color-iron-caption); }
.docs-content .c-ellipsis { color: var(--color-granite-mute); font-style: italic; }
.docs-content .c-prop { color: var(--color-ink); }

.docs-content .code-block .command-syntax {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.15rem 0;
    box-shadow: none;
    border: none;
    background: transparent;
    overflow-x: auto;
}

.docs-content .code-block .command-syntax::before {
    color: var(--color-signal-orange);
}

.docs-content .code-block .command-syntax + .command-syntax {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--color-pewter-rule);
}

.docs-content .code-block .command-syntax .c-path {
    color: var(--color-ink);
}

/* Code block copy button */
.docs-content .code-block .code-block-copy {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    padding: 0;
    margin: 0;
    background: var(--color-paper-white);
    border: 1px solid var(--color-pewter-rule);
    border-radius: var(--radius-buttons, 4px);
    cursor: pointer;
    color: var(--color-granite-mute);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-content .code-block .code-block-copy:hover {
    background: var(--color-frost-surface);
    border-color: var(--color-ink);
    color: var(--color-ink);
}

.docs-content .code-block .code-block-copy.copied {
    background: var(--color-frost-surface);
    border-color: var(--color-ink);
    color: var(--color-ink);
}

.docs-content .code-block .code-block-copy svg {
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

/* Terminal command prompt */
.terminal-cmd,
.command-syntax {
    font-family: 'JetBrains Mono', monospace;
}

.terminal-cmd::before,
.command-syntax::before {
    content: '$ ';
    color: var(--color-signal-orange);
    font-weight: 400;
    user-select: none;
}

.docs-content .terminal-cmd {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--color-frost-surface);
    border: 1px solid var(--color-pewter-rule);
    color: var(--color-ink);
    font-weight: 400;
    padding: 0.3rem 0.55rem 0.3rem 0.35rem;
    border-radius: var(--radius-badges, 4px);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.docs-content .terminal-cmd::before {
    color: var(--color-signal-orange);
}

/* ===== Doc content blocks (info, warning, command cards) ===== */
.docs-content .info-box {
    background: rgba(2, 2, 2, 0.1);
    border: 1px solid rgba(2, 2, 2, 0.22);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0.625rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 18px rgba(2, 2, 2, 0.08);
}

.docs-content .warning-box {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-left: 4px solid #f59e0b;
    border-radius: 0.625rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.08);
}

.docs-content .command-card {
    background: rgba(2, 2, 2, 0.07);
    border: 1px solid rgba(2, 2, 2, 0.2);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(2, 2, 2, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.docs-content .command-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 24px rgba(2, 2, 2, 0.12);
}

.docs-content .info-box p,
.docs-content .warning-box p,
.docs-content .command-card p,
.docs-content .command-card li {
    color: var(--text-primary);
    font-size: 1.0625rem;
    line-height: 1.75;
}

.docs-content .info-box p,
.docs-content .warning-box p {
    margin-bottom: 0;
}

.docs-content .info-box strong,
.docs-content .warning-box strong,
.docs-content .command-card strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.docs-content .info-box.info-box-sm {
    padding: 0.85rem 1.1rem;
}

.docs-content .info-box.info-box-sm p {
    font-size: 0.875rem;
    line-height: 1.55;
}

.docs-content .info-box.info-box-sm kbd {
    font-size: 0.78em;
}

.docs-content .block-highlight {
    display: inline;
    font-family: var(--font-geist-mono);
    color: var(--color-ink);
    font-weight: 400;
    background: var(--color-frost-surface);
    border: 1px solid var(--color-pewter-rule);
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-badges, 4px);
    font-size: 0.9em;
}

.docs-content .info-box code,
.docs-content .warning-box code,
.docs-content .command-card code:not(.terminal-cmd) {
    color: var(--accent-primary);
    background: rgba(2, 2, 2, 0.14);
    border: 1px solid rgba(2, 2, 2, 0.25);
    font-weight: 600;
}

.docs-content .command-card h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 700;
}

.docs-content .command-card h4::before {
    content: '▸ ';
    opacity: 0.85;
}

.docs-content .command-card p {
    margin-bottom: 0.5rem;
}

.docs-content .command-card .code-block {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 100%;
}

/* command-syntax only styled inside .code-block - no extra box per line */
.docs-content .command-card .code-block .command-syntax {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.15rem 0;
    margin: 0;
    box-shadow: none;
}

.docs-content .command-card ol,
.docs-content .command-card ul {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.docs-content .command-card ol li:last-child,
.docs-content .command-card p:last-child {
    margin-bottom: 0;
}

/* Legacy selectors kept for non-docs-content contexts */
.command-card {
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-box {
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* Featured capability callouts */
.feature-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.docs-content .feature-highlight-card {
    background: rgba(2, 2, 2, 0.06);
    border: 1px solid rgba(2, 2, 2, 0.18);
    border-radius: 0.75rem;
    padding: 1.25rem 1.35rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 14px rgba(2, 2, 2, 0.06);
}

.docs-content .feature-highlight-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 22px rgba(2, 2, 2, 0.12);
}

.docs-content .feature-highlight-card.featured {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(2, 2, 2, 0.14) 0%, rgba(2, 2, 2, 0.04) 100%);
    box-shadow: 0 6px 24px rgba(2, 2, 2, 0.1);
}

.feature-highlight-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.35rem;
}

.feature-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-primary);
    background: rgba(2, 2, 2, 0.14);
    border: 1px solid rgba(2, 2, 2, 0.22);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
}

.feature-highlight-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.docs-content .feature-highlight-card p {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.docs-content .feature-highlight-card h3 {
    color: var(--accent-primary);
}

.feature-highlight-card p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.feature-highlight-card .feature-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-primary);
    text-decoration: none;
}

.feature-highlight-card .feature-link:hover {
    text-decoration: underline;
}

.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
}

.feature-table th,
.feature-table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.85rem;
    text-align: left;
    vertical-align: top;
}

.feature-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.feature-table td {
    color: var(--text-secondary);
}

.docs-content .feature-table code {
    color: var(--color-ink);
    background: var(--color-frost-surface);
    border: 1px solid var(--color-pewter-rule);
    font-weight: 400;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
}

.docs-content .feature-table code.terminal-cmd {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--color-ink);
    background: var(--color-frost-surface);
    border: 1px solid var(--color-pewter-rule);
    font-weight: 400;
    font-size: 0.82rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-badges, 4px);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.feature-table kbd,
.docs-content-wrapper kbd {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8em;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 1px 0 var(--border-color);
}

.docs-content .feature-table {
    table-layout: fixed;
    width: 100%;
}

.docs-content .palette-cmd-table col.palette-col-num {
    width: 3rem;
}

.docs-content .palette-cmd-table col.palette-col-name {
    width: 26%;
}

.docs-content .palette-cmd-table col.palette-col-cmd {
    width: auto;
}

.docs-content .palette-cmd-table th:first-child,
.docs-content .palette-cmd-table td:first-child {
    width: 3rem;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.docs-content .palette-cmd-table th:nth-child(2),
.docs-content .palette-cmd-table td:nth-child(2) {
    width: 26%;
    min-width: 10.5rem;
}

.docs-content .palette-cmd-table th:nth-child(3),
.docs-content .palette-cmd-table td:nth-child(3) {
    width: auto;
}

/* Menus page — column widths by content type */
.docs-content .menus-table-2col col.menus-col-label {
    width: 22%;
}

.docs-content .menus-table-2col col.menus-col-detail {
    width: auto;
}

.docs-content .menus-table-3col col.menus-col-item {
    width: 17%;
}

.docs-content .menus-table-3col:not(.menus-table-tab) {
    table-layout: fixed;
}

.docs-page .docs-content .feature-table.menus-table-3col:not(.menus-table-tab) {
    table-layout: fixed;
}

.docs-content .menus-table-3col:not(.menus-table-tab) col.menus-col-item {
    width: 28%;
}

.docs-content .menus-table-3col:not(.menus-table-tab) col.menus-col-behavior {
    width: auto;
}

.docs-content .menus-table-3col:not(.menus-table-tab) col.menus-col-shortcut {
    width: 24%;
}

.docs-content .menus-table-3col col.menus-col-behavior {
    width: auto;
}

.docs-content .menus-table-3col col.menus-col-shortcut {
    width: 21%;
}

.docs-page .docs-content .feature-table.menus-table-tab {
    table-layout: fixed;
}

.docs-content .menus-table-tab col.menus-col-item {
    width: 26%;
}

.docs-content .menus-table-tab col.menus-col-behavior {
    width: 28%;
}

.docs-content .menus-table-tab col.menus-col-shortcut {
    width: 32%;
}

.docs-content .menus-table-tab th:first-child,
.docs-content .menus-table-tab td:first-child {
    width: 26%;
}

.docs-content .menus-table-tab th:nth-child(2),
.docs-content .menus-table-tab td:nth-child(2) {
    width: 28%;
}

.docs-content .menus-table-tab th:nth-child(3),
.docs-content .menus-table-tab td:nth-child(3) {
    width: 32%;
}

.docs-content .menus-table-2col th:first-child,
.docs-content .menus-table-2col td:first-child {
    width: 22%;
    min-width: 0;
}

.docs-content .menus-table-3col th:first-child,
.docs-content .menus-table-3col td:first-child {
    width: 17%;
    min-width: 0;
}

.docs-content .menus-table-3col:not(.menus-table-tab) th:first-child,
.docs-content .menus-table-3col:not(.menus-table-tab) td:first-child {
    width: 28%;
    overflow-wrap: normal;
    word-break: normal;
}

.docs-content .menus-table-3col th:nth-child(2),
.docs-content .menus-table-3col td:nth-child(2) {
    min-width: 0;
}

.docs-content .menus-table-3col th:nth-child(3),
.docs-content .menus-table-3col td:nth-child(3) {
    width: 21%;
    min-width: 0;
    white-space: normal;
}

.docs-content .menus-table-3col:not(.menus-table-tab) th:nth-child(3),
.docs-content .menus-table-3col:not(.menus-table-tab) td:nth-child(3) {
    width: 24%;
}

.docs-page .docs-content .feature-table.menus-table {
    table-layout: auto;
    overflow: visible;
    max-width: 100%;
}

.docs-content .menus-table th,
.docs-content .menus-table td {
    overflow-wrap: break-word;
    word-break: normal;
}

.docs-content .menus-table th:first-child,
.docs-content .menus-table td:first-child {
    overflow-wrap: normal;
    word-break: normal;
}

.docs-content .menus-table kbd {
    white-space: normal;
}

.docs-content .palette-cmd-table code.terminal-cmd,
.docs-page .docs-content .palette-cmd-table code.terminal-cmd {
    display: inline;
    width: auto;
    max-width: none;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.5;
    vertical-align: baseline;
}

.docs-content .feature-table td .terminal-cmd::before {
    color: var(--color-signal-orange);
}

.docs-content .feature-table td .block-highlight,
.docs-content .feature-table td code.block-highlight {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
}

.warning-box p {
    margin-bottom: 0;
    color: var(--text-primary);
}

/* Navigation Cards */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
}



.nav-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(2, 2, 2, 0.15);
    text-decoration: none;
}

.nav-card h3 {
    color: var(--accent-primary);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.nav-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.9375rem;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--accent-primary);
    color: white;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
}

.sidebar-toggle:focus,
.sidebar-toggle:focus-visible {
    outline: none;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle .sidebar-icon {
    width: 1.375rem;
    height: 1.375rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-home-button {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--bg-card);
    color: var(--accent-primary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-home-button:hover {
    transform: scale(1.05);
    background: var(--bg-hover);
}

.mobile-home-button:focus,
.mobile-home-button:focus-visible {
    outline: none;
}

.mobile-home-button:active {
    transform: scale(0.95);
}

.mobile-home-button svg {
    width: 1.375rem;
    height: 1.375rem;
    display: block;
}

/* Responsive Design */
@media (min-width: 1440px) {
    .docs-page .docs-container {
        --docs-float-gap: 20px;
    }

    .docs-content {
        padding-top: 3rem;
        padding-bottom: 3.5rem;
    }
}

@media (min-width: 1920px) {
    .docs-page .docs-container {
        --docs-float-gap: 24px;
    }
}

@media (max-width: 768px) {
    .docs-page .docs-container {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
        padding-top: var(--navbar-height);
    }

    .docs-page .docs-sidebar {
        position: fixed;
        left: 0;
        top: var(--navbar-height);
        height: calc(100vh - var(--navbar-height));
        height: calc(100dvh - var(--navbar-height));
        transform: translateX(-100%);
        width: var(--sidebar-width, 280px);
        min-width: var(--sidebar-width, 280px);
        border: none;
        border-right: 1px solid var(--color-pewter-rule);
        border-radius: 0;
        z-index: 200;
        box-shadow: none;
    }

    .docs-page .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(2, 2, 2, 0.12);
    }

    .docs-page.docs-sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(2, 2, 2, 0.35);
        z-index: 150;
    }

    .docs-page .footer {
        z-index: 1;
    }

    .docs-content {
        margin-left: 0;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .docs-content h1 {
        font-size: 2rem;
    }

    .docs-content h2 {
        font-size: 1.75rem;
    }

    .docs-content h3 {
        font-size: 1.375rem;
    }
    
    /* Reduce paragraph and text sizes on mobile */
    .docs-content p {
        font-size: 0.9375rem; /* Reduced from 1.0625rem */
        line-height: 1.7;
        margin-bottom: 1.25rem;
    }
    
    .docs-content li {
        font-size: 0.9375rem;
        line-height: 1.7;
    }
    
    .docs-content ul,
    .docs-content ol {
        font-size: 0.9375rem;
    }

    .sidebar-toggle {
        display: flex;
    }

    .mobile-home-button {
        display: flex;
    }

    .docs-sidebar-content {
        padding-bottom: 8rem; /* Extra padding on mobile for buttons */
    }

    .nav-cards {
        grid-template-columns: 1fr;
    }
}

/* Video Embed Styles */
.video-section {
    margin: 2.5rem 0;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.video-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.video-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.75rem;
}

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.video-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.video-link svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Compact Video Section for Individual Pages */
.video-section-compact {
    margin: 2rem 0 2.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 100%;
    width: 100%;
}

.video-section-compact h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-section-compact p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
}

.video-wrapper-compact {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    width: 100%;
}

.video-wrapper-compact iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.75rem;
}

.video-link-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.video-link-compact:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.video-link-compact svg {
    width: 1.125rem;
    height: 1.125rem;
}

@media (max-width: 768px) {
    .video-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .video-section h2 {
        font-size: 1.25rem;
    }
    
    .video-section-compact {
        padding: 1.5rem;
        margin: 1.5rem 0 2rem;
    }
    
    .video-section-compact h3 {
        font-size: 1.125rem;
    }
    
    .video-section-compact p {
        font-size: 0.9375rem;
    }
}

/* -- Glitch AI icon (inline, matches app ai_icon.py) -- */
.docs-glitch-ai-icon {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.2em;
    margin: 0 0.1em;
    color: var(--color-signal-orange);
    flex-shrink: 0;
}

/* -- Theme gallery (matches Glitch in-app Settings cards) -- */
.theme-gallery-lead {
    margin: -0.5rem 0 1.25rem;
    color: var(--color-granite-mute);
    font-size: 0.9375rem;
}

.theme-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
}

.theme-preview-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-panels, 4px);
    background: var(--color-paper-white);
    border: 1px solid color-mix(in srgb, var(--color-signal-orange) 40%, var(--color-ash-hairline));
    box-shadow: none;
}

.theme-preview-card--default {
    border-width: 2px;
    border-color: color-mix(in srgb, var(--color-signal-orange) 55%, var(--color-ash-hairline));
}

.theme-card-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--color-ash-hairline);
    background: var(--color-paper-white);
}

.theme-card-name-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--theme-accent);
    flex-shrink: 0;
}

.theme-card-name-text {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--color-ink);
}

.theme-card-name-badge {
    font-family: var(--font-geist-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-signal-orange);
    border: 1px solid color-mix(in srgb, var(--color-signal-orange) 35%, transparent);
    border-radius: var(--radius-badges, 4px);
    padding: 2px 7px;
    background: var(--color-surface-warm);
}

.theme-preview-shell {
    overflow: hidden;
    border-radius: 0;
    min-height: 168px;
    background: var(--theme-shell-bg);
}

.theme-preview-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-preview-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.theme-preview-dot-close { background: rgba(184, 92, 92, 0.5); }
.theme-preview-dot-min { background: rgba(196, 148, 74, 0.5); }
.theme-preview-dot-max { background: rgba(94, 168, 108, 0.5); }

.theme-preview-window-title {
    font-family: var(--font-geist-mono);
    font-size: 0.76rem;
    font-weight: 600;
    text-align: center;
    color: color-mix(in srgb, var(--theme-secondary) 40%, transparent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-preview-terminal {
    padding: 10px 10px 11px;
    background: rgba(4, 6, 10, 0.16);
    border-radius: 0;
}

.theme-preview-line {
    font-family: var(--font-geist-mono);
    font-size: 0.72rem;
    line-height: 1.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-preview-prompt {
    color: var(--theme-fg);
    font-weight: 700;
}

.theme-preview-command {
    color: rgba(245, 247, 250, 0.96);
}

.theme-preview-status {
    color: var(--theme-secondary);
}

/* Theme tokens from glitch-terminal/core/modules/profiles.py */
.theme-preview-card--vritra_matrix {
    --theme-shell-bg: #08090A;
    --theme-fg: #00FF66;
    --theme-accent: #55FF99;
    --theme-secondary: #8F95A3;
}

.theme-preview-card--ghost_glitch {
    --theme-shell-bg: linear-gradient(135deg, #101216, #1C1F26);
    --theme-fg: #00E5FF;
    --theme-accent: #00E5FF;
    --theme-secondary: #A0A5B5;
}

.theme-preview-card--obsidian_purple {
    --theme-shell-bg: #0B0A0F;
    --theme-fg: #B983FF;
    --theme-accent: #9D4EDD;
    --theme-secondary: #7A7E85;
}

.theme-preview-card--crimson_breach {
    --theme-shell-bg: linear-gradient(135deg, #050505, #1A080A);
    --theme-fg: #FF3333;
    --theme-accent: #FF3333;
    --theme-secondary: #B0888A;
}

.theme-preview-card--monochrome_pro {
    --theme-shell-bg: #000000;
    --theme-fg: #F8F9FA;
    --theme-accent: #F8F9FA;
    --theme-secondary: #6C757D;
}

.theme-preview-card--cosmic_aurora {
    --theme-shell-bg: linear-gradient(135deg, #0A0915, #0A242D);
    --theme-fg: #00FAAA;
    --theme-accent: #00FAAA;
    --theme-secondary: #94A3B8;
}

.theme-preview-card--amber_obsidian {
    --theme-shell-bg: linear-gradient(135deg, #060608, #2B170A);
    --theme-fg: #FF7B00;
    --theme-accent: #FF7B00;
    --theme-secondary: #A1A1AA;
}

.theme-preview-card--deep_horizon {
    --theme-shell-bg: linear-gradient(135deg, #0F1219, #1D2433);
    --theme-fg: #38BDF8;
    --theme-accent: #38BDF8;
    --theme-secondary: #CBD5E1;
}

.theme-preview-card--ash_magma {
    --theme-shell-bg: linear-gradient(135deg, #0A0A0C, #260D12);
    --theme-fg: #F43F5E;
    --theme-accent: #F43F5E;
    --theme-secondary: #A8A29E;
}

.theme-preview-card--bio_hazard {
    --theme-shell-bg: linear-gradient(135deg, #05070A, #142512);
    --theme-fg: #A3E635;
    --theme-accent: #A3E635;
    --theme-secondary: #E2E8F0;
}

@media (max-width: 900px) {
    .theme-gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .theme-preview-shell {
        min-height: 148px;
    }

    .theme-preview-line {
        font-size: 0.68rem;
    }
}

