/* LogFileViewer docs — shared stylesheet */
:root {
    --brand: #1a6fc4;
    --brand-dark: #134f8f;
    --brand-light: #e8f1fb;
    --text: #1c1c1e;
    --text-muted: #555;
    --surface: #ffffff;
    --surface-alt: #f6f8fa;
    --border: #d0d7de;
    --code-bg: #f0f2f5;
    --warn-bg: #fffae6;
    --warn-border: #e6b800;
    --note-bg: #e8f4fd;
    --note-border: #2196f3;
    --radius: 6px;
    --max-width: 860px;
    --sidebar-w: 260px;
    --header-h: 56px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: #f4f6f9;
    line-height: 1.7;
}

/* ── Site header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
    padding: 0 32px;
    background: var(--brand-dark);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.site-header .logo {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff;
    text-decoration: none;
}

.site-header .logo span {
    opacity: .65;
    font-weight: 400;
}

.site-header nav {
    margin-left: auto;
    display: flex;
    gap: 24px;
}

.site-header nav a {
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
    font-size: .9rem;
}

.site-header nav a:hover {
    color: #fff;
}

.site-header nav a.active {
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, .7);
}

/* ── Page hero ── */
.page-hero {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    padding: 52px 32px 44px;
    text-align: center;
}

.page-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.page-hero p {
    margin-top: 10px;
    font-size: 1.05rem;
    opacity: .85;
    max-width: 600px;
    margin-inline: auto;
}

.page-hero .meta {
    margin-top: 16px;
    font-size: .82rem;
    opacity: .65;
}

/* ── Layout shells ── */
.doc-shell {
    max-width: calc(var(--max-width) + var(--sidebar-w) + 48px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 0;
    align-items: start;
    padding: 32px 24px;
}

.doc-shell.no-sidebar {
    grid-template-columns: 1fr;
    max-width: var(--max-width);
}

/* ── Sidebar TOC ── */
.toc-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
}

.toc-sidebar h3 {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.toc-sidebar ol, .toc-sidebar ul {
    padding-left: 16px;
}

.toc-sidebar li {
    margin: 4px 0;
    line-height: 1.4;
}

.toc-sidebar li.h2-item {
    font-weight: 600;
    margin-top: 8px;
    list-style: none;
    margin-left: -16px;
}

.toc-sidebar a {
    color: var(--text-muted);
    text-decoration: none;
}

.toc-sidebar a:hover {
    color: var(--brand);
}

.toc-sidebar .sub {
    padding-left: 12px;
}

/* ── Article content ── */
article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 48px;
    min-width: 0;
}

.doc-shell.no-sidebar article {
    margin: 0 auto;
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    scroll-margin-top: calc(var(--header-h) + 16px);
}

h1 {
    font-size: 1.9rem;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.35rem;
    margin: 44px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-light);
    color: var(--brand-dark);
}

h2:first-child {
    margin-top: 0;
}

h3 {
    font-size: 1.1rem;
    margin: 28px 0 10px;
    color: var(--text);
}

h4 {
    font-size: 1rem;
    margin: 20px 0 8px;
    color: var(--text-muted);
}

p {
    margin: 0 0 14px;
}

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

a:hover {
    text-decoration: underline;
}

ul, ol {
    margin: 0 0 14px 24px;
}

li {
    margin: 4px 0;
}

li > ul, li > ol {
    margin-top: 4px;
    margin-bottom: 4px;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* ── Code ── */
code {
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace;
    /* Keep operators literal: these fonts otherwise draw != as a single ≠ ligature (via calt). */
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    font-size: .875em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

pre {
    background: #1e2432;
    color: #cdd3de;
    border-radius: var(--radius);
    padding: 18px 22px;
    overflow-x: auto;
    margin: 16px 0 20px;
    font-size: .875rem;
    line-height: 1.6;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Keyword hints in SQL examples */
pre .kw {
    color: #7ec8e3;
    font-weight: 600;
}

pre .str {
    color: #98c379;
}

pre .cm {
    color: #5c6370;
    font-style: italic;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    margin: 16px 0 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

th {
    background: var(--brand-dark);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tr:nth-child(even) td {
    background: var(--surface-alt);
}

tr:last-child td {
    border-bottom: none;
}

td code {
    font-size: .82em;
}

/* ── Callouts ── */
.note, .tip, .warn {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 16px 0 20px;
    font-size: .92rem;
    line-height: 1.6;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.note {
    background: var(--note-bg);
    border-left: 4px solid var(--note-border);
}

.tip {
    background: #edfaf1;
    border-left: 4px solid #27ae60;
}

.warn {
    background: var(--warn-bg);
    border-left: 4px solid var(--warn-border);
}

.note::before {
    content: "ℹ";
    font-size: 1.1rem;
    color: #2196f3;
    flex-shrink: 0;
}

.tip::before {
    content: "✦";
    font-size: 1rem;
    color: #27ae60;
    flex-shrink: 0;
}

.warn::before {
    content: "⚠";
    font-size: 1.1rem;
    color: var(--warn-border);
    flex-shrink: 0;
}

/* ── Feature card grid ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.feature-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.feature-card .icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.feature-card strong {
    display: block;
    margin-bottom: 4px;
}

.feature-card p {
    font-size: .875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Kbd ── */
kbd {
    display: inline-block;
    font-family: inherit;
    font-size: .8rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-bottom: 2px solid #aaa;
    border-radius: 4px;
    padding: 1px 6px;
    line-height: 1.6;
    white-space: nowrap;
}

/* ── Shortcuts table override ── */
.shortcuts td:first-child {
    white-space: nowrap;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 32px;
    font-size: .82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.site-footer a {
    color: var(--text-muted);
}

.site-footer nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

/* ── Screenshot placeholder ── */
.screenshot {
    background: var(--surface-alt);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    margin: 16px 0 20px;
}

.screenshot::before {
    display: block;
    font-size: 2rem;
    margin-bottom: 6px;
    content: "🖼";
}

/* ── Real screenshot figure ── */
.shot {
    margin: 16px 0 20px;
}

.shot img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.shot figcaption {
    margin-top: 8px;
    font-size: .8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Back-to-top ── */
.back-to-top {
    display: inline-block;
    margin-top: 32px;
    font-size: .8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.back-to-top:hover {
    color: var(--brand);
}

/* ── Legal doc style ── */
.legal-section {
    margin-bottom: 32px;
}

.legal-section h2 {
    font-size: 1.1rem;
    border-bottom: none;
    color: var(--text);
}

.legal-meta {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.legal-disclaimer {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    font-size: .88rem;
    color: var(--text-muted);
    margin: 12px 0;
}

/* ── Landing page (index.html) ── */
.landing-hero {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    padding: 72px 32px 64px;
    text-align: center;
}

.landing-hero h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 14px;
    color: #ff9e33;
    -webkit-text-stroke: 1px #2f3e33;
    paint-order: stroke fill;
}

.landing-hero h1 img {
    height: 1.5em;
    width: auto;
    flex-shrink: 0;
}

.landing-hero p.tagline {
    font-size: 1.15rem;
    opacity: .9;
    max-width: 620px;
    margin: 0 auto 32px;
}

.dl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--brand-dark);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn-download:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .3);
}

.btn-download .arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .5);
    font-size: .95rem;
    font-weight: 600;
    padding: 14px 22px;
    border-radius: var(--radius);
    text-decoration: none;
}

.btn-ghost:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, .12);
}

.dl-platforms {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    font-size: .88rem;
}

.dl-platforms a {
    color: #fff;
    opacity: .85;
}

.dl-platforms a:hover {
    opacity: 1;
}

.dl-meta {
    margin-top: 18px;
    font-size: .82rem;
    opacity: .7;
}

.hero-shot {
    max-width: 940px;
    margin: -36px auto 0;
    padding: 0 24px;
}

.hero-shot img {
    display: block;
    width: 80%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}

.hero-shot video {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}

.landing-body {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 56px 24px 8px;
}

.landing-body h2 {
    text-align: center;
    border-bottom: none;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.landing-body > p {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 14px;
}

.req-note {
    max-width: 620px;
    margin: 28px auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    font-size: .9rem;
    color: var(--text-muted);
    text-align: center;
}

.req-note strong {
    color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 820px) {
    .doc-shell {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .toc-sidebar {
        display: none;
    }

    article {
        padding: 24px 20px;
    }

    .page-hero {
        padding: 36px 20px 32px;
    }

    .page-hero h1 {
        font-size: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-header nav {
        display: none;
    }

    .landing-hero {
        padding: 48px 20px 44px;
    }

    .landing-hero h1 {
        font-size: 1.9rem;
    }

    .hero-shot {
        margin-top: -20px;
        padding: 0 14px;
    }

    .landing-body {
        padding: 40px 16px 8px;
    }
}

@media (max-width: 480px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}
