/* ============================================================
   Laika Docs — Public Stylesheet
   Font: Sora (UI + headings), JetBrains Mono (code)
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-w: 280px;
    --header-h: 60px;

    /* Palette */
    --bg: #ffffff;
    --bg-sidebar: #f8fafc;
    --bg-code: #0f172a;
    --border: #e2e8f0;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;

    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --accent-bg: #eef2ff;

    /* Typography */
    --font-ui: 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --ease: cubic-bezier(.4, 0, .2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────────── */

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 0 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-mark {
    width: 32px;
    height: 32px;
    /* background: var(--accent); */
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.5px;
}

.logo-mark img {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.4px;
}

.logo-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--border);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: .2px;
}

/* Search */
.header-search-wrap {
    flex: 1;
    max-width: 480px;
    position: relative;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    height: 38px;
    padding: 0 40px 0 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-sidebar);
    outline: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
    background: var(--bg);
}

.search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    pointer-events: none;
}

/* Search dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
    overflow: hidden;
    z-index: 200;
}

.search-result-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--accent-bg);
}

.sri-meta {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 2px;
}

.sri-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.sri-snippet {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-no-results {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Header links */
.header-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s, background .15s;
}

.header-link:hover {
    color: var(--text);
    background: var(--bg-sidebar);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: .2s;
}

/* ── Layout ──────────────────────────────────────────────── */

.docs-layout {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.docs-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.sidebar-nav {
    padding: 24px 0 40px;
}

/* Category */
.nav-category {
    margin-bottom: 28px;
}

.nav-category-title {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 20px 8px;
}

/* Section toggle */
.nav-section {
    margin-left: 10px;
}

.nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 7px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: left;
    transition: color .15s;
}

.nav-section-toggle:hover {
    color: var(--text);
}

.nav-section-toggle.is-open {
    color: var(--text);
}

.nav-section-toggle .chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform .2s var(--ease);
    color: var(--text-light);
}

.nav-section-toggle.is-open .chevron {
    transform: rotate(0deg);
}

.nav-section-toggle:not(.is-open) .chevron {
    transform: rotate(-90deg);
}

/* Pages list */
.nav-pages {
    list-style: none;
    overflow: hidden;
    transition: max-height .25s var(--ease);
}

.nav-pages:not(.is-visible) {
    max-height: 0;
}

.nav-pages.is-visible {
    max-height: 1000px;
}

.nav-page-link {
    display: block;
    padding: 6px 20px 6px 30px;
    font-size: 13.5px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: 18px;
    transition: color .12s, border-color .12s, background .12s;
}

.nav-page-link:hover {
    color: var(--text);
}

.nav-page-link.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-bg);
    font-weight: 500;
}

/* ── Main Content ────────────────────────────────────────── */

.docs-main {
    flex: 1;
    min-width: 0;
    padding: 0 30px;
    /* max-width:      860px; */
}

/* Breadcrumb */
.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
}

.docs-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.docs-breadcrumb a:hover {
    text-decoration: none;
}

.bc-sep {
    color: var(--text-light);
}

/* ── Doc Content Typography ───────────────────────────────── */
.docs-content {
    padding-top: 15px;
}
.docs-content h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.6px;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 16px;
}

.docs-content h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.3px;
    color: var(--text);
    margin-top: 48px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.docs-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 8px;
}

.docs-content h4 {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 6px;
}

.docs-content p {
    color: #334155;
    /* margin-bottom: 16px; */
    font-size: 15px;
    line-height: 1.75;
}

.docs-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, .3);
    transition: border-color .12s;
}

.docs-content a:hover {
    border-bottom-color: var(--accent);
}

.docs-content ul,
.docs-content ol {
    padding-left: 22px;
    margin-bottom: 16px;
}

.docs-content li {
    color: #334155;
    margin-bottom: 6px;
    line-height: 1.7;
}

/* Inline code */
.docs-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Code blocks (Quill sets <pre> for code blocks) */
.docs-content pre {
    background: var(--bg-code);
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.65;
    padding: 20px 24px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid #1e293b;
}

.docs-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* Blockquotes */
.docs-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    background: var(--accent-bg);
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
}

.docs-content blockquote p {
    margin-bottom: 0;
    color: var(--text);
}

/* Tables */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}

.docs-content th {
    background: var(--bg-sidebar);
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.docs-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    color: #334155;
    vertical-align: top;
}

.docs-content tr:nth-child(even) td {
    background: #fafbfc;
}

/* Callout / info boxes */
.docs-content .callout {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.docs-content .callout-info {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.docs-content .callout-warning {
    background: #fffbeb;
    border-color: #f59e0b;
}

.docs-content .callout-danger {
    background: #fef2f2;
    border-color: #ef4444;
}

/* Home page */
.docs-home h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -.7px;
    margin-bottom: 12px;
}

.docs-home .lead {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 560px;
    line-height: 1.6;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.home-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.home-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .1);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.home-card strong {
    font-size: 15px;
    font-weight: 600;
}

.home-card span {
    font-size: 13.5px;
    color: var(--text-muted);
}

/* ── Pager ───────────────────────────────────────────────── */

.docs-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 240px;
    transition: border-color .15s, box-shadow .15s;
}

.pager-link:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(99, 102, 241, .1);
}

.pager-next {
    margin-left: auto;
    text-align: right;
}

.pager-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
}

.pager-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* ── Overlay ─────────────────────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 90;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .docs-sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        height: calc(100vh - var(--header-h));
        transform: translateX(-100%);
        transition: transform .25s var(--ease);
        z-index: 95;
    }

    .docs-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay.is-active {
        display: block;
    }

    .docs-main {
        padding: 32px 24px 60px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .search-shortcut {
        display: none;
    }
}

@media (max-width: 600px) {
    .docs-main {
        padding: 24px 16px 48px;
    }

    .docs-content h1 {
        font-size: 26px;
    }

    .docs-content h2 {
        font-size: 20px;
    }

    .home-cards {
        grid-template-columns: 1fr;
    }

    .docs-pager {
        flex-direction: column;
    }

    .pager-next {
        margin-left: 0;
        text-align: left;
    }
}

/* ── Footer ──────────────────────────────────────────────── */

.docs-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
    margin-left: var(--sidebar-w);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 64px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-inner a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}

.footer-inner a:hover {
    color: var(--accent);
}

.footer-links {
    display: flex;
    gap: 20px;
}

@media (max-width: 900px) {
    .docs-footer {
        margin-left: 0;
    }

    .footer-inner {
        padding: 16px 24px;
    }
}

@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
}