/* PDFiumVCL Help Documentation Styles */
/* Web-first reference layout with CHM-friendly fallback behavior. */

:root {
    --bg: #f5f7f4;
    --bg-grid: rgba(28, 91, 84, 0.055);
    --surface: #ffffff;
    --surface-soft: #eef5f2;
    --surface-warm: #fff7e8;
    --ink: #161c1b;
    --text: #26312f;
    --muted: #66736f;
    --line: #d8e3df;
    --line-strong: #9db7af;
    --teal: #0f766e;
    --teal-dark: #0b514d;
    --amber: #c97a12;
    --red: #a43d35;
    --blue: #225f88;
    --code-bg: #10201f;
    --code-text: #eff8f4;
    --shadow: 0 18px 42px rgba(22, 28, 27, 0.09);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    max-width: 1120px;
    margin: 0 auto;
    padding: 34px clamp(18px, 3vw, 46px) 56px;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(245, 247, 244, 0.94)),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
        linear-gradient(0deg, var(--bg-grid) 1px, transparent 1px),
        var(--bg);
    background-size: auto, 42px 42px, 42px 42px, auto;
    font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.67;
    letter-spacing: 0;
}

body.landing-page {
    max-width: none;
    padding: 0;
}

body.landing-page main,
body.landing-page .doc-nav,
body.landing-page .doc-footer {
    width: min(1180px, calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

h1,
h2,
h3,
h4 {
    color: var(--ink);
    letter-spacing: 0;
}

h1 {
    margin: 0 0 22px;
    font-size: 2.35rem;
    line-height: 1.14;
    font-weight: 760;
}

h2 {
    margin: 34px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 1.72rem;
    line-height: 1.18;
    font-weight: 730;
}

h3 {
    margin: 28px 0 12px;
    padding-left: 14px;
    border-left: 4px solid var(--teal);
    font-size: 1.25rem;
    line-height: 1.32;
    font-weight: 720;
}

h4 {
    margin: 22px 0 10px;
    color: var(--teal-dark);
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 760;
    text-transform: uppercase;
}

p {
    margin: 0 0 13px;
}

a {
    color: var(--teal-dark);
    text-decoration: underline;
    text-decoration-color: rgba(15, 118, 110, 0.28);
    text-underline-offset: 0.18em;
    transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

a:hover {
    color: var(--amber);
    text-decoration-color: rgba(201, 122, 18, 0.56);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(201, 122, 18, 0.38);
    outline-offset: 3px;
}

ul,
ol {
    margin: 10px 0 18px;
    padding-left: 24px;
}

li {
    margin-bottom: 7px;
}

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

blockquote {
    margin: 12px 0 22px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.74);
    color: var(--text);
    font-style: normal;
    box-shadow: 0 8px 24px rgba(22, 28, 27, 0.045);
}

table {
    width: 100%;
    margin: 16px 0 28px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(22, 28, 27, 0.06);
}

th,
td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

th {
    background: #163431;
    color: #f5fffb;
    font-weight: 720;
}

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

tr:nth-child(even) td {
    background: #f7faf8;
}

tr:hover td {
    background: #eef8f5;
}

code,
.code,
.comment,
.string,
.keyword,
.class,
.preprocessor,
.number {
    font-family: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

code {
    padding: 0.14rem 0.32rem;
    border: 1px solid #d7e1dd;
    border-radius: 5px;
    background: #edf5f2;
    color: #10201f;
    font-size: 0.94em;
    font-weight: 650;
}

pre,
.example-code {
    position: relative;
    margin: 16px 0 26px;
    padding: 20px;
    overflow-x: auto;
    border: 1px solid #203a38;
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0)),
        var(--code-bg);
    color: var(--code-text);
    box-shadow: 0 16px 36px rgba(16, 32, 31, 0.18);
}

pre code,
.example-code code,
.example-code .code {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--code-text);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.58;
    white-space: pre;
}

.example-code p {
    margin-bottom: 0;
}

.comment {
    color: #8bc4a7;
    font-style: italic;
}

.string {
    color: #f0b86c;
}

.keyword {
    color: #7dd3c7;
    font-weight: 700;
}

.class {
    color: #b1d18d;
    font-weight: 650;
}

.preprocessor {
    color: #e8a65e;
}

.number {
    color: #f39c8f;
    font-weight: 700;
}

.centered {
    text-align: center;
}

.bold {
    display: inline-block;
    margin: 22px 0 8px;
    color: var(--ink);
    font-weight: 780;
}

.bold:first-child {
    margin-top: 0;
}

.troubleshooting,
.feature-category,
.api-section {
    margin: 22px 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 32px rgba(22, 28, 27, 0.055);
}

.feature-category {
    border-left: 5px solid var(--teal);
    background: linear-gradient(180deg, #ffffff 0%, #f3faf7 100%);
}

.troubleshooting {
    border-left: 5px solid var(--amber);
    background: linear-gradient(180deg, #fffdf8 0%, var(--surface-warm) 100%);
}

.api-section h2:first-child,
.feature-category h3:first-child,
.troubleshooting h3:first-child {
    margin-top: 0;
}

.component-header {
    margin-bottom: 30px;
    padding: 32px clamp(22px, 4vw, 44px);
    border: 1px solid rgba(15, 118, 110, 0.28);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.94), rgba(20, 59, 56, 0.96)),
        #143b38;
    color: #f6fffc;
    box-shadow: var(--shadow);
}

.component-header h1 {
    margin-bottom: 8px;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3rem);
}

.component-header .description {
    color: #d9f1eb;
    font-size: 1.08rem;
}

.doc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    margin-bottom: 22px;
    padding: 11px 14px;
    border: 1px solid rgba(216, 227, 223, 0.9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(22, 28, 27, 0.055);
}

.doc-brand {
    color: var(--ink);
    font-weight: 820;
    text-decoration: none;
    white-space: nowrap;
}

.doc-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.doc-links a,
.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--teal-dark);
    font-size: 0.91rem;
    font-weight: 720;
    text-decoration: none;
}

.doc-links a:hover,
.button-link:hover {
    border-color: rgba(15, 118, 110, 0.22);
    background: #edf7f4;
    color: var(--teal-dark);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.doc-search {
    position: relative;
    flex: 0 1 260px;
    min-width: 220px;
}

.doc-search input {
    width: 100%;
    min-height: 36px;
    padding: 7px 36px 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 244, 0.96)),
        #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.doc-search::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--teal-dark);
    border-radius: 50%;
    transform: translateY(-58%);
    pointer-events: none;
}

.doc-search::before {
    content: "";
    position: absolute;
    top: 22px;
    right: 10px;
    width: 8px;
    height: 2px;
    border-radius: 999px;
    background: var(--teal-dark);
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 1;
}

.doc-search input:focus {
    border-color: rgba(15, 118, 110, 0.65);
    outline: 3px solid rgba(15, 118, 110, 0.14);
}

.search-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    width: min(390px, calc(100vw - 34px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(22, 28, 27, 0.14);
}

.doc-search.is-open .search-results {
    display: block;
}

.search-result {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.search-result:last-child {
    border-bottom: 0;
}

.search-result strong {
    color: var(--ink);
    font-size: 0.94rem;
}

.search-result span,
.search-empty {
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.45;
}

.search-result:hover,
.search-result.is-active {
    background: #eef8f5;
}

.search-empty {
    padding: 13px 14px;
}

.button-link.primary {
    border-color: #0b514d;
    background: #0b514d;
    color: #ffffff;
}

.button-link.primary:hover {
    background: #083f3c;
    color: #ffffff;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
    gap: clamp(28px, 5vw, 58px);
    align-items: center;
    min-height: 470px;
    padding: 34px 0 44px;
}

.landing-kicker {
    margin-bottom: 14px;
    color: var(--amber);
    font-size: 0.82rem;
    font-weight: 820;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-title {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(2.55rem, 7vw, 5.8rem);
    line-height: 0.95;
}

.landing-copy {
    max-width: 700px;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.hero-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
}

.component-strip {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fbfa;
}

.component-strip img {
    width: 42px;
    height: 42px;
    image-rendering: pixelated;
}

.component-strip h2 {
    margin: 0 0 4px;
    padding: 0;
    border: 0;
    font-size: 1.04rem;
}

.component-strip p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat {
    padding: 12px;
    border-radius: var(--radius);
    background: #163431;
    color: #edf8f5;
}

.stat strong {
    display: block;
    color: #ffffff;
    font-size: 1.22rem;
    line-height: 1;
}

.stat span {
    color: #b8d6cf;
    font-size: 0.78rem;
}

.nav-section {
    margin: 28px 0 46px;
}

.section-intro {
    max-width: 680px;
    color: var(--muted);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.nav-card {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(22, 28, 27, 0.05);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.nav-card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 118, 110, 0.44);
    color: var(--text);
    box-shadow: 0 18px 42px rgba(22, 28, 27, 0.1);
}

.nav-card strong {
    display: block;
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 1.22rem;
    line-height: 1.2;
}

.nav-card span {
    color: var(--muted);
}

.nav-card em {
    margin-top: 18px;
    color: var(--teal-dark);
    font-style: normal;
    font-weight: 780;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag-list span {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

.doc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 44px;
    padding: 28px 0 42px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.doc-footer p {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.doc-footer a {
    color: #0f6974;
    text-decoration: none;
}

.doc-footer a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
}

@media (max-width: 900px) {
    .landing-hero,
    .nav-grid {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: auto;
    }

    .doc-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .doc-links {
        justify-content: flex-start;
    }

    .doc-search {
        flex: 0 1 auto;
        width: 100%;
        min-width: 0;
    }

    .search-results {
        right: auto;
        left: 0;
        width: 100%;
    }

    .doc-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    body {
        padding: 24px 16px 42px;
    }

    body.landing-page main,
    body.landing-page .doc-nav,
    body.landing-page .doc-footer {
        width: min(100% - 28px, 1180px);
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.42rem;
    }

    .component-header,
    .troubleshooting,
    .feature-category,
    .api-section,
    blockquote,
    pre,
    .example-code {
        padding: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        padding: 11px 12px;
    }

    .stat-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        max-width: none;
        padding: 0;
        background: #ffffff;
    }

    .doc-nav,
    .doc-footer,
    .hero-actions {
        display: none;
    }

    .component-header,
    .api-section,
    .feature-category,
    .troubleshooting,
    blockquote,
    pre,
    .example-code {
        box-shadow: none;
    }
}
