/* GrayClay Guidebook — layout and prose overrides */

:root {
    --gc-sidebar-width: 16.5rem;
    --gc-navbar-height: 3.5rem;
    --gc-content-max: 48rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gc-docs-shell {
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
}

.gc-docs-navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: var(--gc-navbar-height);
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
}

.gc-docs-layout {
    display: grid;
    grid-template-columns: var(--gc-sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--gc-navbar-height));
}

.gc-docs-sidebar {
    position: sticky;
    top: var(--gc-navbar-height);
    height: calc(100vh - var(--gc-navbar-height));
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    padding: 1rem 0.75rem 2rem;
}

.gc-docs-main {
    min-width: 0;
}

.gc-docs-content {
    max-width: var(--gc-content-max);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.gc-docs-footer {
    max-width: var(--gc-content-max);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    color: #64748b;
    font-size: 0.875rem;
}

.gc-docs-prose h1 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.gc-docs-prose h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.375rem;
    font-weight: 600;
    color: #0f172a;
    scroll-margin-top: calc(var(--gc-navbar-height) + 1rem);
}

.gc-docs-prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e293b;
    scroll-margin-top: calc(var(--gc-navbar-height) + 1rem);
}

.gc-docs-prose p,
.gc-docs-prose li {
    line-height: 1.7;
    color: #334155;
}

.gc-docs-prose p {
    margin-top: 0.75rem;
}

.gc-docs-prose ul,
.gc-docs-prose ol {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
}

.gc-docs-prose li + li {
    margin-top: 0.35rem;
}

.gc-docs-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.1rem 0.35rem;
}

.gc-docs-prose pre {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.gc-docs-prose pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
}

.gc-docs-callout {
    margin-top: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: #1e3a8a;
}

.gc-docs-callout-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.gc-nav-module {
    margin-bottom: 0.25rem;
}

.gc-nav-module-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
    text-align: left;
    cursor: pointer;
}

.gc-nav-module-toggle:hover {
    background: #f8fafc;
    color: #0f172a;
}

.gc-nav-module.is-active-module .gc-nav-module-toggle {
    color: #0f172a;
}

.gc-nav-chevron {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: #94a3b8;
    transition: transform 0.15s ease;
}

.gc-nav-module.is-collapsed .gc-nav-chevron {
    transform: rotate(-90deg);
}

.gc-nav-module-pages {
    margin-top: 0.125rem;
    margin-bottom: 0.5rem;
    padding-left: 1.375rem;
    border-left: 1px solid #e2e8f0;
    margin-left: 0.875rem;
}

.gc-nav-module.is-collapsed .gc-nav-module-pages {
    display: none;
}

.gc-nav-link {
    display: block;
    border-radius: 0.375rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #64748b;
    text-decoration: none;
}

.gc-nav-link:hover {
    background: #f8fafc;
    color: #334155;
}

.gc-nav-link.is-active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.gc-module-card {
    display: block;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 1.25rem;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gc-module-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.gc-module-card h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.gc-module-card p {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

.gc-docs-sidebar-backdrop {
    display: none;
}

@media (max-width: 1023px) {
    .gc-docs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .gc-docs-sidebar {
        position: fixed;
        left: 0;
        top: var(--gc-navbar-height);
        z-index: 30;
        width: min(var(--gc-sidebar-width), 88vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    }

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

    .gc-docs-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: var(--gc-navbar-height) 0 0 0;
        z-index: 20;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .gc-docs-sidebar-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ─── Mega search ─────────────────────────────────────────────────────────── */

.gc-docs-search-trigger {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.gc-docs-search-trigger:hover {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.gc-docs-search-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gc-docs-search-trigger-kbd,
.gc-docs-search-kbd {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.2;
}

.gc-docs-search-mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.45rem 0.55rem;
    color: #475569;
    cursor: pointer;
}

.gc-docs-search-mobile-btn:hover {
    background: #f8fafc;
}

.gc-docs-search-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 1rem 1rem;
}

.gc-docs-search-modal.is-open {
    display: flex;
}

body.gc-docs-search-open {
    overflow: hidden;
}

.gc-docs-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.gc-docs-search-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 48rem;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.18);
}

.gc-docs-search-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1rem;
}

.gc-docs-search-input-icon {
    color: #94a3b8;
    font-size: 1.125rem;
}

.gc-docs-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 1rem 0;
    font-size: 1rem;
    color: #0f172a;
    outline: none;
}

.gc-docs-search-input::placeholder {
    color: #94a3b8;
}

.gc-docs-search-clear {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
}

.gc-docs-search-clear:hover {
    color: #64748b;
}

.gc-docs-search-results {
    max-height: min(60vh, 32rem);
    overflow-y: auto;
    padding: 0.5rem 0;
}

.gc-docs-search-group + .gc-docs-search-group {
    margin-top: 0.25rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.25rem;
}

.gc-docs-search-group-title {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.gc-docs-search-result {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.625rem 1rem;
    text-align: left;
    cursor: pointer;
}

.gc-docs-search-result:hover,
.gc-docs-search-result.is-active {
    background: #f8fafc;
}

.gc-docs-search-result.is-active .gc-docs-search-result-title {
    color: #2563eb;
}

.gc-docs-search-result-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
}

.gc-docs-search-result-meta {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: #64748b;
}

.gc-docs-search-result-snippet {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #475569;
}

.gc-docs-search-highlight {
    background: transparent;
    color: #2563eb;
    font-weight: 700;
}

.gc-docs-search-empty {
    padding: 2rem 1.5rem;
    text-align: center;
}

.gc-docs-search-empty-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
}

.gc-docs-search-empty-text {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

/* ─── Version notes ─────────────────────────────────────────────────────────── */

.gc-docs-sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.gc-docs-sidebar-footer-link {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.gc-releases-list {
    margin-top: 1rem;
    list-style: none;
    padding: 0;
}

.gc-releases-list-item + .gc-releases-list-item {
    margin-top: 0.5rem;
}

.gc-releases-list-link {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 0.75rem 1rem;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
    padding: 0.875rem 1rem;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gc-releases-list-link:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.gc-releases-list-tag {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #2563eb;
}

.gc-releases-list-date {
    font-size: 0.8125rem;
    color: #64748b;
    white-space: nowrap;
}

.gc-releases-list-summary {
    font-size: 0.875rem;
    color: #475569;
    min-width: 0;
}

.gc-releases-list-chevron {
    color: #94a3b8;
    font-size: 0.875rem;
}

.gc-releases-meta {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
}

.gc-releases-content {
    margin-top: 1.5rem;
}

.gc-docs-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.gc-docs-table th,
.gc-docs-table td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.gc-docs-table th {
    background: #f8fafc;
    font-weight: 600;
}

@media (max-width: 640px) {
    .gc-releases-list-link {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }

    .gc-releases-list-tag {
        grid-column: 1;
    }

    .gc-releases-list-date {
        grid-column: 2;
        grid-row: 1;
    }

    .gc-releases-list-summary {
        grid-column: 1 / -1;
    }

    .gc-releases-list-chevron {
        display: none;
    }
}
