/* ─────────────────────────────────────────────────
   Skava Wiki — Docs Stil (angelehnt an Airtable Docs)
   Drei Spalten: Sidebar | Content | Auf dieser Seite
   ───────────────────────────────────────────────── */

:root {
    --w-bg: #ffffff;
    --w-bg-soft: #fafbfc;
    --w-sidebar: #f7f8fa;
    --w-text: #1f2329;
    --w-text-soft: #4b5565;
    --w-text-muted: #8a94a6;
    --w-brand: #2a63df;
    --w-brand-soft: #eaf1ff;
    --w-border: #e5e7eb;
    --w-border-soft: #eef0f3;
    --w-code-bg: #f4f5f7;
    --w-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --w-radius: 8px;
    --w-radius-sm: 6px;
    --w-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", "Roboto Mono",
        Consolas, monospace;
    --w-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.wiki {
    margin: 0;
    background: var(--w-bg);
    color: var(--w-text);
    font-family: var(--w-sans);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--w-brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

::selection {
    background: var(--w-brand-soft);
}

/* ── Top bar ───────────────────────────────── */
.w-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--w-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 18px;
}

.w-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--w-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.w-topbar-brand:hover {
    text-decoration: none;
}

.w-topbar-brand img {
    height: 28px;
    width: auto;
}

.w-topbar-brand-divider {
    color: var(--w-text-muted);
    margin: 0 2px;
    font-weight: 400;
}

.w-topbar-brand-section {
    color: var(--w-text-soft);
    font-weight: 500;
}

.w-topbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.w-topbar-search input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--w-border);
    border-radius: 8px;
    padding: 0 12px 0 36px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--w-bg-soft);
    color: var(--w-text);
    transition: border-color 0.15s, background 0.15s;
}

.w-topbar-search input:focus {
    outline: none;
    border-color: var(--w-brand);
    background: #fff;
    box-shadow: 0 0 0 3px var(--w-brand-soft);
}

.w-topbar-search::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
    background-size: 16px 16px;
    background-repeat: no-repeat;
}

.w-topbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.w-topbar-links a {
    color: var(--w-text-soft);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.w-topbar-links a:hover {
    background: var(--w-bg-soft);
    color: var(--w-text);
    text-decoration: none;
}

.w-topbar-cta {
    background: var(--w-brand) !important;
    color: #fff !important;
    padding: 7px 14px !important;
}

.w-topbar-cta:hover {
    background: #1d46bd !important;
}

.w-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--w-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ── Layout ────────────────────────────────── */
.w-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 240px;
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    align-items: start;
}

.w-sidebar {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 24px 16px 40px 24px;
    border-right: 1px solid var(--w-border);
    background: var(--w-bg);
}

.w-sidebar-section {
    margin-bottom: 18px;
}

.w-sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--w-text-muted);
    padding: 4px 10px;
    margin: 6px 0;
}

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

.w-sidebar-nav li {
    margin: 0;
}

.w-sidebar-nav a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--w-text-soft);
    font-size: 0.875rem;
    font-weight: 450;
    line-height: 1.4;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: background 0.12s, color 0.12s;
}

.w-sidebar-nav a:hover {
    background: var(--w-bg-soft);
    color: var(--w-text);
    text-decoration: none;
}

.w-sidebar-nav a[aria-current="page"] {
    background: var(--w-brand-soft);
    color: var(--w-brand);
    font-weight: 600;
    border-left-color: var(--w-brand);
    border-radius: 0 6px 6px 0;
}

/* ── Main content ──────────────────────────── */
.w-main {
    padding: 40px 56px 80px;
    min-width: 0;
}

.w-breadcrumbs {
    font-size: 0.8125rem;
    color: var(--w-text-muted);
    margin-bottom: 18px;
}

.w-breadcrumbs a {
    color: var(--w-text-muted);
}

.w-breadcrumbs a:hover {
    color: var(--w-brand);
}

.w-breadcrumbs span.sep {
    margin: 0 6px;
}

.w-content {
    max-width: 760px;
}

.w-content h1 {
    font-size: 2.125rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.w-content .lede {
    font-size: 1.0625rem;
    color: var(--w-text-soft);
    line-height: 1.6;
    margin: 0 0 32px;
}

.w-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 48px 0 12px;
    padding-top: 8px;
    letter-spacing: -0.01em;
    scroll-margin-top: 80px;
}

.w-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 28px 0 8px;
    scroll-margin-top: 80px;
}

.w-content p {
    margin: 0 0 14px;
    color: var(--w-text);
}

.w-content ul,
.w-content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.w-content li {
    margin-bottom: 6px;
}

.w-content code {
    font-family: var(--w-mono);
    font-size: 0.85em;
    background: var(--w-code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: #1f2329;
}

.w-content pre {
    background: var(--w-code-bg);
    padding: 14px 16px;
    border-radius: var(--w-radius);
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 14px 0 22px;
    border: 1px solid var(--w-border-soft);
}

.w-content pre code {
    background: transparent;
    padding: 0;
}

.w-content blockquote {
    border-left: 3px solid var(--w-brand);
    background: var(--w-brand-soft);
    padding: 10px 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    color: var(--w-text);
}

.w-content blockquote p:last-child {
    margin-bottom: 0;
}

.w-content hr {
    border: none;
    border-top: 1px solid var(--w-border);
    margin: 40px 0;
}

/* Table */
.w-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 22px;
    font-size: 0.9rem;
}

.w-content th,
.w-content td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--w-border-soft);
}

.w-content th {
    font-weight: 600;
    color: var(--w-text);
    background: var(--w-bg-soft);
}

/* Tabs (Webapp / Mobile) */
.w-tabs {
    margin: 16px 0 22px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    overflow: hidden;
    background: #fff;
}

.w-tabs-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--w-border);
    background: var(--w-bg-soft);
    padding: 0 6px;
}

.w-tab {
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--w-text-soft);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
}

.w-tab[aria-selected="true"] {
    color: var(--w-brand);
    border-bottom-color: var(--w-brand);
    font-weight: 600;
}

.w-tab-panel {
    padding: 18px 20px;
}

.w-tab-panel[hidden] {
    display: none;
}

.w-tab-panel p:first-child,
.w-tab-panel ul:first-child {
    margin-top: 0;
}

.w-tab-panel p:last-child,
.w-tab-panel ul:last-child {
    margin-bottom: 0;
}

/* Callout */
.w-callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--w-radius);
    background: var(--w-bg-soft);
    border: 1px solid var(--w-border-soft);
    margin: 18px 0;
}

.w-callout-icon {
    flex-shrink: 0;
    color: var(--w-brand);
    font-weight: 700;
}

.w-callout-body {
    font-size: 0.925rem;
    color: var(--w-text);
}

.w-callout-body p:last-child {
    margin-bottom: 0;
}

.w-callout.tip {
    background: var(--w-brand-soft);
    border-color: rgba(42, 99, 223, 0.18);
}

.w-callout.warn {
    background: #fff7e6;
    border-color: #f5d99a;
}

.w-callout.warn .w-callout-icon {
    color: #b76e00;
}

/* Article footer (prev/next) */
.w-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--w-border);
}

.w-pager a {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    color: var(--w-text);
    transition: border-color 0.15s, background 0.15s;
}

.w-pager a:hover {
    border-color: var(--w-brand);
    background: var(--w-bg-soft);
    text-decoration: none;
}

.w-pager .label {
    display: block;
    font-size: 0.75rem;
    color: var(--w-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.w-pager .title {
    font-weight: 600;
    color: var(--w-text);
}

.w-pager .next {
    text-align: right;
}

/* Feedback row */
.w-feedback {
    margin-top: 32px;
    padding: 16px 18px;
    background: var(--w-bg-soft);
    border-radius: var(--w-radius);
    font-size: 0.875rem;
    color: var(--w-text-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.w-feedback a {
    font-weight: 500;
}

/* ── Right TOC ────────────────────────────── */
.w-toc {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 40px 24px 40px 16px;
    font-size: 0.8125rem;
}

.w-toc-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--w-text-muted);
    margin: 0 0 10px;
}

.w-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--w-border);
}

.w-toc li {
    margin: 0;
}

.w-toc a {
    display: block;
    padding: 5px 12px;
    color: var(--w-text-soft);
    line-height: 1.4;
    margin-left: -1px;
    border-left: 1px solid transparent;
}

.w-toc a:hover {
    color: var(--w-text);
    text-decoration: none;
}

.w-toc a.active {
    color: var(--w-brand);
    border-left-color: var(--w-brand);
    font-weight: 600;
}

.w-toc li.depth-3 a {
    padding-left: 24px;
    font-size: 0.78rem;
}

/* ── Wiki home (introduction) ──────────────── */
.w-home-hero {
    margin-bottom: 40px;
}

.w-home-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.025em;
}

.w-home-hero p {
    font-size: 1.125rem;
    color: var(--w-text-soft);
    max-width: 640px;
}

.w-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 24px 0 32px;
}

.w-home-card {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    background: #fff;
    color: var(--w-text);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.w-home-card:hover {
    border-color: var(--w-brand);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--w-shadow-sm);
}

.w-home-card .icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--w-brand-soft);
    color: var(--w-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.w-home-card strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.w-home-card span {
    font-size: 0.875rem;
    color: var(--w-text-soft);
    line-height: 1.45;
}

/* ── Mobile / responsive ─────────────────── */
@media (max-width: 1100px) {
    .w-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .w-toc {
        display: none;
    }

    .w-main {
        padding: 32px 36px 80px;
    }
}

@media (max-width: 760px) {
    .w-shell {
        grid-template-columns: 1fr;
    }

    .w-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: 280px;
        max-width: 80vw;
        z-index: 40;
        border-right: 1px solid var(--w-border);
        transform: translateX(-100%);
        transition: transform 0.2s ease-out;
        box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
    }

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

    .w-main {
        padding: 24px 18px 60px;
    }

    .w-content h1 {
        font-size: 1.75rem;
    }

    .w-content h2 {
        font-size: 1.2rem;
        margin: 36px 0 10px;
    }

    .w-menu-toggle {
        display: inline-flex;
    }

    .w-topbar-search {
        display: none;
    }

    .w-topbar-links a:not(.w-topbar-cta) {
        display: none;
    }

    .w-pager {
        grid-template-columns: 1fr;
    }
}

/* ── Footer ──────────────────────────────── */
.w-footer {
    border-top: 1px solid var(--w-border);
    padding: 24px 24px;
    background: var(--w-bg-soft);
    color: var(--w-text-muted);
    font-size: 0.8125rem;
}

.w-footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.w-footer a {
    color: var(--w-text-soft);
    margin-left: 14px;
}

.w-footer a:first-child {
    margin-left: 0;
}

/* Cookie banner inherits from style.css; if loaded standalone, ensure nothing breaks */
