/* drawlib Google Editorial Light Theme (google.css)
 * Inspired by https://blog.google/ (The Keyword) & Google Material Design Web
 */
:root {
    --rtd-sidebar-bg: #f8f9fa;
    --rtd-sidebar-header: #ffffff;
    --rtd-sidebar-text: #3c4043;
    --rtd-sidebar-hover: #f1f3f4;
    --rtd-sidebar-active: #e8f0fe;
    --rtd-sidebar-active-text: #1967d2;
    --rtd-brand-color: #1a73e8;
    --rtd-brand-dark: #1557b0;
    --rtd-heading-color: #202124;
    --rtd-text-color: #3c4043;
    --rtd-muted-color: #5f6368;
    --rtd-bg-color: #ffffff;
    --rtd-content-bg: #ffffff;
    --rtd-surface-bg: #f8f9fa;
    --rtd-border-color: #dadce0;
    --rtd-code-bg: #f8f9fa;
    --rtd-inline-code-bg: #f1f3f4;
    --rtd-inline-code-color: #185abc;
    --rtd-note-bg: #f8f9fa;
    --rtd-note-border: #1a73e8;
    --rtd-code-keyword: #1a73e8;
    --rtd-code-string: #1e8e3e;
    --rtd-code-comment: #80868b;
    --rtd-code-number: #f9ab00;
    --rtd-code-function: #d93025;
    --rtd-code-type: #af38c4;
    --rtd-code-operator: #5f6368;
    --rtd-code-builtin: #1a73e8;
    --rtd-font: "Google Sans", "Product Sans", "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
    --rtd-body-font: "Roboto", "Google Sans Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
    --rtd-mono-font: "Roboto Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Noto Sans Mono CJK JP", monospace;
    --sidebar-width: 288px;

  --slide-primary: #1a73e8;
  --slide-secondary: #188038;
  --slide-accent: #ea4335;
  --slide-yellow: #fbbc04;
  --slide-border: #dadce0;
  --slide-card-bg: #f8f9fa;
  --slide-code-bg: #282c34;
  --slide-code-text: #abb2bf;
}


/* drawlib Code Highlighting and Code Blocks */
code {
    font-family: var(--rtd-mono-font);
    font-size: 0.88em;
    background-color: var(--rtd-inline-code-bg);
    color: var(--rtd-inline-code-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

pre {
    background-color: var(--rtd-code-bg);
    border: 1px solid var(--rtd-border-color);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.5;
}

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

/* Pygments syntax highlighting tokens */
pre code .k, pre code .kc, pre code .kd, pre code .kn, pre code .kp, pre code .kr, pre code .kt { color: var(--rtd-code-keyword); font-weight: 600; }
pre code .s, pre code .sa, pre code .sb, pre code .sc, pre code .dl, pre code .sd, pre code .s2, pre code .se, pre code .sh, pre code .si, pre code .sx, pre code .sr, pre code .s1, pre code .ss { color: var(--rtd-code-string); }
pre code .c, pre code .ch, pre code .cm, pre code .cp, pre code .cpf, pre code .c1, pre code .cs { color: var(--rtd-code-comment); font-style: italic; }
pre code .m, pre code .mb, pre code .mf, pre code .mh, pre code .mi, pre code .mo, pre code .il { color: var(--rtd-code-number); }
pre code .nf, pre code .fm { color: var(--rtd-code-function); }
pre code .nc, pre code .ne, pre code .nn, pre code .nt { color: var(--rtd-code-type); font-weight: 600; }
pre code .na, pre code .nd, pre code .py { color: var(--rtd-code-type); font-weight: 600; }
pre code .nb, pre code .bp { color: var(--rtd-code-builtin); }
pre code .o, pre code .ow { color: var(--rtd-code-operator); }
pre code .err { color: #ef4444; }


/* drawlib Markdown Typography and Content Elements */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--rtd-font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--rtd-text-color);
    background-color: var(--rtd-bg-color);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--rtd-font);
    color: var(--rtd-heading-color);
    margin-top: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.25rem;
    margin-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--rtd-border-color);
}

h2 {
    font-size: 1.65rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--rtd-border-color);
}

h3 {
    font-size: 1.35rem;
}

h4 {
    font-size: 1.15rem;
}

p {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

a {
    color: var(--rtd-brand-color);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    color: var(--rtd-brand-dark);
    text-decoration: underline;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.4rem;
}

li > ul, li > ol {
    margin-top: 0.4rem;
    margin-bottom: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--rtd-border-color);
    margin: 2rem 0;
}

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background-color: var(--rtd-note-bg);
    border-left: 4px solid var(--rtd-note-border);
    color: var(--rtd-text-color);
    border-radius: 0 8px 8px 0;
}

blockquote p {
    margin: 0;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border: 1px solid var(--rtd-border-color);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    border-bottom: 1px solid var(--rtd-border-color);
    padding: 0.75rem 1rem;
    text-align: left;
}

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

th {
    font-family: var(--rtd-font);
    background-color: var(--rtd-surface-bg);
    color: var(--rtd-heading-color);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.drawlib-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    padding: 1.25rem;
    background-color: #ffffff;
    border: 1px solid var(--rtd-border-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.drawlib-image img, .drawlib-image svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.drawlib-caption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--rtd-muted-color, #64748b);
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
}

details.drawlib-code-details {
    margin: 1rem 0 2rem 0;
    border: 1px solid var(--rtd-border-color);
    border-radius: 8px;
    background-color: var(--rtd-code-bg);
    overflow: hidden;
}

.drawlib-image + details.drawlib-code-details {
    margin-top: -1rem;
}

details.drawlib-code-details summary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--rtd-muted-color);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

details.drawlib-code-details summary:hover {
    color: var(--rtd-heading-color);
    background-color: var(--rtd-surface-bg);
}

details.drawlib-code-details[open] summary {
    border-bottom: 1px solid var(--rtd-border-color);
}

details.drawlib-code-details pre {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Admonition / Callout boxes */
.admonition {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--rtd-brand-color);
    background-color: var(--rtd-note-bg);
    border-radius: 0 8px 8px 0;
}

.admonition-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--rtd-heading-color);
}


/* drawlib Linear Document Clean View (targets/doc.css) */
body {
    background-color: var(--rtd-bg-color);
}

.main-container {
    max-width: 900px;
    margin: 2.5rem auto;
    background-color: var(--rtd-content-bg);
    border: 1px solid var(--rtd-border-color);
    border-radius: 12px;
    padding: 3rem 3.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.doc-chapter + .doc-chapter,
.doc-toc + .doc-chapter,
.doc-chapter + .doc-toc {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--rtd-border-color);
}

.doc-toc,
.pdf-toc {
    padding: 0.5rem 0;
}

.doc-toc h2,
.pdf-toc h2 {
    font-size: 1.5rem;
    color: var(--rtd-heading-color);
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: none;
}

.doc-toc ul,
.pdf-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-toc li,
.pdf-toc li {
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--rtd-border-color);
    font-size: 1rem;
}

.doc-toc li:last-child,
.pdf-toc li:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .main-container {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 8px;
    }
}

@media print {
    @page {
        size: A4;
        margin: 18mm 16mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html, body {
        background-color: #ffffff;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .main-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background-color: transparent !important;
    }

    .doc-chapter + .doc-chapter,
    .doc-toc + .doc-chapter,
    .doc-chapter + .doc-toc {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        page-break-before: always;
        break-before: page;
    }

    .page-break {
        page-break-after: always;
        break-after: page;
    }

    .chapter-separator {
        page-break-before: always;
        break-before: page;
    }

    code {
        font-size: 0.84em;
        padding: 0.12rem 0.32rem;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    pre {
        padding: 0.85rem 1rem;
    }

    pre, pre code {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow: visible !important;
        overflow-x: visible !important;
        font-size: 0.75rem !important;
        line-height: 1.45 !important;
    }

    table {
        width: 100%;
        max-width: 100%;
        font-size: 0.76rem;
        line-height: 1.45;
        overflow: visible;
        break-inside: auto;
        page-break-inside: auto;
    }

    thead {
        display: table-header-group;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    th, td {
        padding: 0.42rem 0.55rem;
        vertical-align: top;
        overflow-wrap: break-word;
    }

    th code, td code {
        font-size: 0.82em;
        padding: 0.08rem 0.22rem;
        overflow-wrap: normal;
        word-break: normal;
    }

    pre, .drawlib-image, blockquote {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .sidebar, .top-bar, .footer, .drawlib-code-details summary {
        display: none !important;
    }
}


