
/* =============================================================
   DocBook XSL HTML stylesheet — modern responsive design
   Targets HTML generated by docbook-xsl htmlhelp/html stylesheets
   ============================================================= */

/* --- Reset & box model ------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Base typography -------------------------------------- */
html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
                 Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1f2328;
    background-color: #ffffff;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* --- Links ------------------------------------------------ */
a {
    color: #0969da;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- Headings --------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1f2328;
}
h1 { font-size: 2rem;    border-bottom: 1px solid #d0d7de; padding-bottom: 0.3em; }
h2 { font-size: 1.5rem;  border-bottom: 1px solid #d0d7de; padding-bottom: 0.3em; font-style: normal; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.875rem; }
h6 { font-size: 0.85rem; color: #57606a; }

/* Suppress borders on headings inside navigation/titlepage */
.navheader h1, .navheader h2, .navheader h3,
.navfooter h1, .navfooter h2, .navfooter h3,
.titlepage h1, .titlepage h2, .titlepage h3,
.titlepage h4 {
    border-bottom: none;
    padding-bottom: 0;
}

/* --- Paragraphs ------------------------------------------- */
p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* --- Navigation header / footer --------------------------- */
.navheader,
.navfooter {
    font-size: 0.875rem;
    color: #57606a;
    padding: 0.4rem 0;
}
.navheader table,
.navfooter table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}
.navheader td, .navheader th,
.navfooter td, .navfooter th {
    border: none;
    padding: 0.2rem 0.4rem;
    font-weight: normal;
    color: #57606a;
}
.navheader hr,
.navfooter hr {
    border: none;
    border-top: 1px solid #d0d7de;
    margin: 0.4rem 0;
}

/* --- Titlepage -------------------------------------------- */
.titlepage {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #d0d7de;
}
.titlepage .abstract {
    margin: 0 0 1.5rem 0 !important;
    font-style: italic;
    color: #57606a;
    border-left: 4px solid #d0d7de;
    padding-left: 1rem;
}
.titlepage .inlinemediaobject {
    position: static;
    display: block;
    margin-bottom: 1rem;
}
.titlepage .inlinemediaobject img {
    max-width: 160px;
    height: auto;
}
.authorgroup {
    margin-bottom: 0.5rem;
}
.author {
    font-style: italic;
    color: #57606a;
}
h3.author {
    font-size: 1rem;
    font-weight: normal;
    font-style: italic;
    margin: 0.2rem 0;
    border-bottom: none;
    padding-bottom: 0;
}
p.copyright {
    font-size: 0.875rem;
    color: #57606a;
}
.releaseinfo {
    font-size: 0.875rem;
    color: #57606a;
    margin-bottom: 0.25rem;
}

/* --- Table of contents ------------------------------------ */
.toc,
.list-of-tables,
.list-of-figures,
.list-of-examples {
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}
.toc p b,
.list-of-tables p b,
.list-of-figures p b,
.list-of-examples p b {
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}
.toc dl, .toc dd,
.list-of-tables dl, .list-of-tables dd,
.list-of-figures dl, .list-of-figures dd,
.list-of-examples dl, .list-of-examples dd {
    margin: 0;
    padding: 0;
}
.toc dt {
    margin: 0.2rem 0;
}
.toc dd {
    margin-left: 1.5rem;
}

/* --- Code and pre-formatted text -------------------------- */
code, kbd, samp,
.literal, .envar, .parameter, .filename,
.function, .varname, .option, .command,
.type, .constant, .token, .replaceable {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.875em;
    background-color: #f6f8fa;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    border: 1px solid #d0d7de;
    white-space: nowrap;
}

pre,
.programlisting,
.screen,
.synopsis,
.literallayout {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    white-space: pre;
}

/* Inline code inside block code elements: no double-styling */
pre code, .programlisting code, .screen code, .synopsis code,
.literallayout code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    white-space: pre;
    border-radius: 0;
}

/* --- Function synopsis (refentry pages) ------------------- */
.funcsynopsis {
    margin: 1rem 0;
}
table.funcprototype-table {
    border: none;
    border-collapse: collapse;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.875rem;
    background-color: #f6f8fa;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    width: auto;
}
table.funcprototype-table td {
    padding: 0.1rem 0;
    border: none;
    vertical-align: baseline;
}
.paramdef-list {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.875rem;
    padding-left: 2rem;
    margin: 0.25rem 0 1rem;
}
var.pdparam {
    font-style: italic;
}

/* --- Tables ----------------------------------------------- */
.informaltable,
.table {
    overflow-x: auto;
    display: block;
    margin: 1.5rem 0;
}
.table > b,
.figure > b,
.example > b,
.table .title,
.figure .title,
.example .title {
    display: block;
    font-weight: 600;
    font-style: normal;
    margin-bottom: 0.5rem;
    color: #57606a;
    font-size: 0.9375rem;
}
.table table,
.informaltable table {
    border-collapse: collapse;
    border: 1px solid #d0d7de;
    width: 100%;
    margin: 0;
    font-size: 0.9375rem;
}
.table th,
.informaltable th {
    background-color: #f6f8fa;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d7de;
    text-align: left;
}
.table td,
.informaltable td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d7de;
    text-align: left;
    vertical-align: top;
}
.table tr:nth-child(even) td,
.informaltable tr:nth-child(even) td {
    background-color: #f6f8fa;
}

/* --- Admonitions (Note, Tip, Warning, Caution, Important) - */
.note,
.tip,
.warning,
.caution,
.important {
    margin: 1.5rem 0 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
    border-left: 4px solid;
}
.note    { background-color: #ddf4ff; border-left-color: #0969da; }
.tip     { background-color: #dafbe1; border-left-color: #1a7f37; }
.warning { background-color: #fff8c5; border-left-color: #d4a72c; }
.caution { background-color: #fff8c5; border-left-color: #d4a72c; }
.important { background-color: #ffebe9; border-left-color: #cf222e; }

.note h3.title     { color: #0550ae; }
.tip h3.title      { color: #1a7f37; }
.warning h3.title  { color: #9a6700; }
.caution h3.title  { color: #9a6700; }
.important h3.title { color: #a40e26; }

.note h3.title,
.tip h3.title,
.warning h3.title,
.caution h3.title,
.important h3.title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.4rem 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* --- Lists ------------------------------------------------ */
ul, ol {
    padding-left: 2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}
li {
    margin-bottom: 0.25rem;
}

.variablelist dl {
    margin: 0 0 1rem 0;
}
.variablelist dt,
.variablelist .term {
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}
.variablelist dd {
    margin-left: 2rem;
    margin-bottom: 0.25rem;
}

/* --- Reference entry pages -------------------------------- */
.refentry {
    margin-bottom: 2rem;
}
.refnamediv {
    margin-bottom: 1rem;
}
.refnamediv h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #57606a;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 0.3em;
    margin-bottom: 0.5rem;
}
.refnamediv p {
    margin: 0;
}
.refpurpose::before {
    content: " \2014 ";
}
.refsect1 {
    margin-bottom: 1.5rem;
}
.refsect1 > h2,
.refsynopsisdiv > h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #57606a;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 0.25em;
}

/* --- Figures and examples --------------------------------- */
.figure,
.example {
    margin: 1.5rem 0;
}
.figure img,
.mediaobject img {
    max-width: 100%;
    height: auto;
}

/* --- Inline semantic elements ----------------------------- */
em, .emphasis {
    font-style: italic;
}
strong {
    font-weight: 600;
}
.citetitle,
.citation {
    font-style: italic;
}
.acronym {
    font-variant: small-caps;
    letter-spacing: 0.04em;
}

/* --- partintro / preamble --------------------------------- */
.partintro {
    border-left: 4px solid #d0d7de;
    padding-left: 1rem;
    color: #57606a;
    margin-bottom: 1.5rem;
}

/* --- Responsive adjustments ------------------------------- */
@media (max-width: 640px) {
    body {
        padding: 0 1rem 2rem;
        font-size: 0.9375rem;
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    .navheader,
    .navfooter {
        overflow-x: auto;
        display: block;
    }
    .navheader table,
    .navfooter table {
        min-width: 320px;
    }
    .toc,
    .list-of-tables,
    .list-of-figures,
    .list-of-examples {
        padding: 0.75rem 1rem;
    }
    .titlepage .abstract {
        margin-right: 0 !important;
    }
}
