/* site/css/docs_style.css */
:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --sidebar-bg: #ffffff;
    --header-bg: #1a1d20;
    --header-text: #ffffff;
    --border-color: #dee2e6;
    --accent-color: #0d6efd;
    --code-bg: #f1f3f5;
    --code-text: #d63384;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

body.docs-body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: 1.0625rem;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.docs-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.docs-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.docs-logo a {
    color: var(--header-text);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.docs-search-stub input {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #495057;
    background-color: #343a40;
    color: #fff;
    width: 300px;
}

/* Layout */
.docs-layout {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar */
.docs-sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    overflow-y: auto;
}

.docs-nav ul {
    list-style: none;
    padding-left: 0;
}

.docs-nav li {
    margin-bottom: 0.5rem;
}

.docs-nav a {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.975rem;
    line-height: 1.5;
}

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

.docs-nav .nav-item--nested {
    position: relative;
    padding-left: 1.5rem;
}

.docs-nav .nav-item--nested > .nav-link {
    font-size: 0.9em;
    color: rgba(73, 80, 87, 0.82);
}

.docs-nav .nav-item--nested > .nav-link::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: rgba(73, 80, 87, 0.7);
}

/* Main Content */
.docs-main-content {
    flex: 1;
    padding: 2rem 3rem;
    background-color: var(--sidebar-bg);
    min-width: 0;
}

/* Typography & Markdown-like styling */
.docs-page-content h1 {
    font-size: 2.85rem;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.docs-page-content h2 {
    font-size: 2rem;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
}

.docs-page-content h3 {
    font-size: 1.45rem;
    line-height: 1.35;
    margin-top: 1.5rem;
}

.docs-page-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Code Blocks */
.docs-page-content pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    font-size: 0.96rem;
    line-height: 1.65;
}

.docs-page-content code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--code-text);
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.docs-page-content pre code {
    color: inherit;
    background-color: transparent;
    padding: 0;
}

.docs-page-content table {
    width: 100%;
    font-size: 0.98rem;
    line-height: 1.6;
    border-collapse: collapse;
}

.docs-page-content th,
.docs-page-content td {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

/* Lists */
.docs-page-content ul, .docs-page-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

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

/* Breadcrumbs */
.docs-breadcrumbs {
    margin-bottom: 1.25rem;
}

.breadcrumbs {
    position: relative;
}

.breadcrumbs__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.breadcrumbs__link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.2;
}

.breadcrumbs__link:hover {
    color: #495057;
    text-decoration: underline;
}

.breadcrumbs__item.is-current .breadcrumbs__link {
    color: #343a40;
    font-weight: 600;
    text-decoration: none;
}

.breadcrumbs__separator {
    color: #adb5bd;
    font-size: 0.8rem;
}

/* Shared footer shell for docs */
.site-frame {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.site-inner {
    width: 100%;
}

.footer-stack {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.footer-menu-wrap {
    display: block;
    width: 100%;
    padding: 0 0 1.25rem;
}

.footer-nav {
    width: 100%;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: max-content;
}

.footer-column--brand {
    gap: 1rem;
    max-width: 320px;
    white-space: normal;
}

.footer-column__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.footer-column__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.footer-column__item {
    margin: 0;
}

.footer-column__link,
.footer-contact-link {
    color: #495057;
    text-decoration: none;
}

.footer-column__link:hover,
.footer-contact-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.footer-brand__logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex: 0 0 56px;
}

.footer-brand__copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.footer-brand__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.footer-brand__subtitle {
    color: #6c757d;
    line-height: 1.45;
}

.footer-contact-block {
    display: grid;
    gap: 0.5rem;
}

.footer-meta-wrap {
    display: block;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
}

.footer-meta {
    width: 100%;
}

.footer-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.footer-meta-bar__copy,
.footer-meta-bar__links {
    color: #6c757d;
}

.footer-meta-bar__links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-meta-bar__link {
    color: #495057;
    text-decoration: none;
    font-weight: 600;
}

.footer-meta-bar__link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Footer */
.docs-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
    padding: 1.5rem 0 0;
}

@media (max-width: 900px) {
    .docs-main-content {
        padding: 1.5rem;
    }

    .site-frame {
        width: min(1200px, calc(100% - 24px));
    }

    .footer-columns,
    .footer-meta-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-column {
        min-width: 100%;
    }
}

@media (max-width: 767px) {
    body.docs-body {
        font-size: 1rem;
        line-height: 1.6;
    }

    .docs-header {
        padding: 0.75rem 1rem;
    }

    .docs-header-inner {
        gap: 0.75rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .docs-search-stub {
        width: 100%;
    }

    .docs-search-stub input {
        width: 100%;
        max-width: 100%;
    }

    .docs-layout {
        display: block;
    }

    .docs-sidebar {
        display: none;
    }

    .docs-main-content {
        width: 100%;
        max-width: 100%;
        padding: 1rem 0.75rem;
    }

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

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

    .docs-page-content h3 {
        font-size: 1.1rem;
    }

    .docs-page-content p,
    .docs-page-content li,
    .docs-page-content td,
    .docs-page-content th {
        font-size: 1rem;
    }

    .docs-page-content ul,
    .docs-page-content ol {
        padding-left: 1.25rem;
    }

    .docs-page-content pre {
        padding: 0.85rem;
        font-size: 0.9rem;
        line-height: 1.55;
    }

    .docs-page-content code {
        font-size: 0.9em;
    }

    .docs-page-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .docs-page-content th,
    .docs-page-content td {
        padding: 0.6rem 0.7rem;
    }

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

    .breadcrumbs__list {
        gap: 0.35rem;
    }

    .breadcrumbs__link {
        font-size: 0.85rem;
    }

    .site-frame {
        width: min(1200px, calc(100% - 16px));
    }

    .docs-footer {
        padding-top: 1.25rem;
    }
}

/* Mobile header / drawer navigation */
.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: var(--header-text);
    text-decoration: none;
}

.docs-brand:hover {
    color: var(--header-text);
    text-decoration: none;
}

.docs-brand__logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex: 0 0 36px;
}

.docs-brand__text {
    display: block;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.docs-burger {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.docs-burger:hover {
    background: rgba(255, 255, 255, 0.14);
}

.docs-burger__line,
.docs-burger__line::before,
.docs-burger__line::after {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
    transform: translateX(-50%);
    transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
    content: "";
}

.docs-burger__line {
    top: 50%;
    margin-top: -1px;
}

.docs-burger__line::before {
    top: -6px;
}

.docs-burger__line::after {
    top: 6px;
}

.docs-burger.is-active .docs-burger__line {
    background: transparent;
}

.docs-burger.is-active .docs-burger__line::before {
    top: 0;
    transform: translateX(-50%) rotate(45deg);
}

.docs-burger.is-active .docs-burger__line::after {
    top: 0;
    transform: translateX(-50%) rotate(-45deg);
}

.docs-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 18, 0.58);
    backdrop-filter: blur(3px);
    z-index: 1090;
}

.docs-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 360px);
    max-width: 100%;
    height: 100vh;
    padding: 1rem 1rem 1.5rem;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    z-index: 1100;
    overflow-y: auto;
}

.docs-mobile-drawer.is-open {
    transform: translateX(0);
}

.docs-mobile-drawer__header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-brand--drawer {
    color: var(--text-color);
}

.docs-brand--drawer:hover {
    color: var(--text-color);
}

.docs-nav--mobile ul {
    display: grid;
    gap: 0.2rem;
}

.docs-nav--mobile a {
    display: inline-flex;
    padding: 0.45rem 0;
}

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

@media (max-width: 767px) {
    body.docs-body {
        padding-top: 56px;
        font-size: 1rem;
        line-height: 1.6;
    }

    .docs-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0;
        transform: translateY(0);
        transition: transform 0.25s ease;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    }

    .docs-header.is-hidden {
        transform: translateY(-100%);
    }

    .docs-header.is-drawer-open {
        transform: translateY(0);
    }

    .docs-header-inner {
        height: 100%;
        padding: 0 0.9rem;
        gap: 0.75rem;
        align-items: center;
        flex-direction: row;
    }

    .docs-brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .docs-brand__logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .docs-brand__text {
        font-size: 0.92rem;
        max-width: 220px;
    }

    .docs-burger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
    }

    .docs-search-stub,
    .docs-top-menu,
    .docs-sidebar {
        display: none !important;
    }

    .docs-layout {
        display: block;
    }

    .docs-main-content {
        width: 100%;
        max-width: 100%;
        padding: 1rem 0.85rem 1.25rem;
        margin-left: 0;
    }

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

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

    .docs-page-content h3 {
        font-size: 1.1rem;
    }

    .docs-page-content p,
    .docs-page-content li,
    .docs-page-content td,
    .docs-page-content th {
        font-size: 1rem;
    }

    .docs-page-content ul,
    .docs-page-content ol {
        padding-left: 1.25rem;
    }

    .docs-page-content pre {
        padding: 0.85rem;
        font-size: 0.9rem;
        line-height: 1.55;
    }

    .docs-page-content code {
        font-size: 0.9em;
    }

    .docs-page-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .docs-page-content th,
    .docs-page-content td {
        padding: 0.6rem 0.7rem;
    }

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

    .breadcrumbs__list {
        gap: 0.35rem;
    }

    .breadcrumbs__link {
        font-size: 0.85rem;
    }

    .site-frame {
        width: min(1200px, calc(100% - 16px));
    }

    .docs-footer {
        padding-top: 1.25rem;
    }
}
