:root {
    /* colors */
    --black: #18181b;
    --gray: #58585f;
    --light: #f6f9fc;
    --light-light: #dce6e9;
    --code-background: var(--light);
    --code-border: var(--light-light);
    --toc-border: rgba(0, 0, 0, .14);

    /* fonts */
    --sans: -apple-system, BlinkMacSystemFont, Inter, Segoe UI, Helvetica Neue, sans-serif;
    --serif: Tiempos, serif;
    --mono: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    --basic-font-size: 16px;
    --basic-line-height: 25px;

    /* layout sizes */
    --width-left-sidebar: 250px;
    --width-right-sidebar: 120px; /* 右側のサイドバーは存在しない。余白になっているだけ */
    --height-header: 72px;
}

/* ADHOC */
.documentwrapper {
    #api {
        .toctree-wrapper {
            display: none;
        }
    }
}

/* GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: inherit;
    word-wrap: break-word;
}

body {
    font-size: var(--basic-font-size);
    color: var(--text);
    font-family: var(--sans);
}

a {
    text-decoration: none;
}

a:link,
a:visited {
    color: var(--text);
}

ol,
ul,
li {
    list-style: none;
}

h1,
h2,
h3 {
    color: black;
}

/* BASIC LAYOUT */
.document {
    display: flex;
    justify-content: space-between;
}

/* HEADER */
.header {
    height: var(--height-header);
    position: fixed;
    width: 100%;
    background-color: white;
    z-index: 10;

    padding: 0 2rem 0 2.5rem;
    border-bottom: 1px solid var(--black);

    #header_nav_container {
        height: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;

        #header_leftside {
            display: flex;
            align-items: center;

            #xg-title-logo {
                height: 2rem;
                display: inline-block;
                margin-right: 0.5rem;
            }

            h1 {
                font-size: 2.2rem;
                display: inline-block;
            }
        }

        #header_rightside {
            display: flex;
            justify-content: space-between;
            align-items: center;

            li {
                display: inline-block;
                margin-right: 2rem;
                font-size: 15px;
            }

            #searchbox>p {
                display: none;
            }
        }
    }
}

#document-footer-layout-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100vh);
}

/* MAIN */
.document {
    position: relative;
    top: var(--height-header)
}

/* LEFT SIDE BAR */
#leftsidebarwrapper {
    position: fixed;

    width: var(--width-left-sidebar);
    min-width: var(--width-left-sidebar);
    padding: 1rem 0 1rem 2rem;
    top: var(--height-header);
    overflow-y: auto;
    height: calc(100vh - var(--height-header));
    border-right: 1px solid var(--toc-border);
    background-color: white;
    z-index: 1000;

    .toctree-l1.current {
        a {
            border-bottom: 1px solid var(--black);
        }
    }

    [class^="toctree-l"] {
        .reference.internal[href$=".html"]::before,
        .current.reference.internal[href="#"]::before {
            content: "■ ";
        }
    }

    .current.reference.internal{
        font-weight: bold;
    }

    .toctree-l1 {
        font-size: 14px;
        margin-bottom: 0.6rem;

        a:hover {
            border-bottom: 1px solid var(--gray);
            color: var(--gray);
        }

        [class^="toctree-l"] {
            font-size: 12px;
            margin-left: 1rem;
            margin-bottom: 0.4rem;

            a {
                border-bottom: none;
            }
        }

        [class^="toctree-l"]:first-child {
            margin-top: 0.4rem;
        }

        [class^="toctree-l"]:last-child {
            margin-bottom: 0.6rem;
        }
    }
}

#documentwrapper {
    position: relative;
    left: var(--width-left-sidebar);

    flex: 1;
    padding: 2rem 2rem calc(2rem + var(--height-header)) 2rem;
    width: calc(100% - var(--width-left-sidebar) - var(--width-right-sidebar));
    max-width: calc(100% - var(--width-left-sidebar) - var(--width-right-sidebar));
    --code-background: #f6f9fc;
    --code-border: #dce6e9;
    overflow-wrap: break-word;

    /* header */
    h1 {
        font-size: 38px;
        padding-bottom: 12px;

        a {
            display: none;
        }
    }

    h2 {
        margin-top: 40px;
        padding-bottom: 12px;
    }

    h3 {
        margin-top: 32px;
        padding-bottom: 12px;
    }

    /* headerlink */
    .headerlink:link,
    .headerlink:visited {
        font-size: 0.8em;
        border: none;
        color: #FFF;
        margin-left: 0.5rem;
    }

    .headerlink:hover {
        color: #b0cdff
    }

    /* header link position */
    .body {
        section {
            margin-top: calc(var(--height-header) * -1);
            padding-top: var(--height-header);
        }
    }

    /* paragraph */
    p {
        margin-bottom: 12px;
        font-size: var(--basic-font-size);
        line-height: var(--basic-line-height);
    }

    /* line block */
    .line-block {
        margin-bottom: 12px;
        font-size: var(--basic-font-size);
        line-height: var(--basic-line-height);
    }

    /* link */
    a:link,
    a:visited {
        --color: #181818;
        color: var(--color);
        border-bottom: 1px solid var(--color);
    }

    a:hover {
        color: var(--gray);
        border-bottom: 1px solid var(--gray);
    }

    /* inline code */
    code {
        padding: 1px 2px;
        border-radius: 0.15rem;
        background-color: var(--code-background);
        border: 1px solid var(--code-border);
        font-weight: 500;
        letter-spacing: 1.5px;
    }

    /* admonition */
    .admonition {
        box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.10);
        margin: 1rem 0;
        overflow: hidden;
        border-radius: 0.2rem;

        p {
            margin: 0;
        }

        /* 「注意」など、admonitionの上部のスタイル */
        >p:first-child {
            padding: 0.2rem 1rem;
            font-size: 0.8rem;
            font-weight: bolder;
            letter-spacing: 0.01rem;
        }

        /* admonitionの下部のスタイル */
        >*:nth-child(n+2) {
            padding: 0.3rem 1rem;
        }

        p,
        li,
        .line {
            font-size: 0.9rem;
        }

        ul,
        ol {
            margin: 0 0 0 1rem;
        }

        li {
            margin-bottom: 0;
        }

        li:nth-child(n + 2) {
            margin-top: 0.3rem;
        }

        .line-block {
            margin-bottom: 0;
        }

        /* admonitionの中身がリストの場合 */

    }

    /* adminotion続き。省エネ（）のため３パターンのみを用意。時間に余裕がればアイコンも追加したい。 */
    .admonition.attention,
    .admonition.caution,
    .admonition.warning {
        border-left: 3px solid #ff9100;

        >p:first-child {
            background-color: rgba(255, 145, 0, .2);
        }
    }

    .admonition.danger,
    .admonition.error {
        border-left: 3px solid #ff5252;

        >p:first-child {
            background-color: rgba(255, 82, 82, .2);
        }
    }

    .admonition.hint,
    .admonition.important,
    .admonition.note,
    .admonition.seealso,
    .admonition.tip {
        border-left: 3px solid #00b0ff;

        >p:first-child {
            background-color: rgba(0, 176, 255, .2);
        }
    }

    /* code-block */

    /* キャプション付きのコードブロック */
    .literal-block-wrapper.container {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        background-color: var(--code-background);
        border: 1px solid var(--code-border);
        border-radius: 0.5rem;

        max-width: 100%;

        .code-block-caption {
            width: fit-content;
            font-family: var(--mono);
            font-size: 13px;
            line-height: 22px;
            padding: 0.3rem 0.5rem;
            border-radius: 0.2rem;
            background-color: rgb(215, 222, 230);
            color: rgb(60, 78, 97);
        }

        .highlight {
            padding: 1rem;
            margin: 0;
            border: none;
        }
    }

    /* キャプションなしのコードブロック */
    .highlight {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        background-color: var(--code-background);
        border: 1px solid var(--code-border);
        border-radius: 0.3rem;
        padding: 1rem;
        max-width: 100%;

        pre {
            font-family: var(--mono);
            font-size: 12px;
            line-height: 22px;
        }
    }

    div:has(>pre) {
        overflow-x: auto;
        white-space: nowrap;
    }

    /* list */
    ul,
    ol {
        padding-left: 1.3rem;
        margin: 0.8rem 0.5rem;

        p {
            margin-bottom: inherit;
        }

        li {
            list-style: initial;
            margin-bottom: 0.45rem;

            a:visited,
            a:link {
                color: #0073BB;
                border: none;
            }

            a:hover {
                --li-link-color-hover: #0a4a74;
                color: var(--li-link-color-hover);
                border-bottom: 1px solid var(--li-link-color-hover);
            }
        }
    }

    /* table */
    table {
        margin-top: 3rem;
        margin-bottom: 3rem;
        border-collapse: collapse;

        .line-block {
            margin-bottom: 0;
        }

        th,
        td {
            font-size: var(--basic-font-size);
            line-height: var(--basic-line-height);
            font-family: var(--sans);
            padding: 0.5rem 1rem;

            .simple,
            p,
            div,
            a {
                margin-bottom: 0;
                font-size: 0.9rem;
            }
        }

        thead {
            tr {
                th {
                    font-weight: 700;
                    text-align: left;
                }
            }
        }

        tbody {
            tr {
                border-bottom: 1px solid var(--code-border);
                border-left: 1px solid var(--code-border);
                border-right: 1px solid var(--code-border);

                td {
                    text-align: left;
                }
            }

            tr:first-child {
                border-top: 1px solid var(--code-border);
            }
        }
    }

    /* blocks */
    blockquote {
        border-left: 5px solid var(--light-light);
        padding: 0.5rem 0 0.5rem 1rem;

        p {
            margin-bottom: 0;
            font-size: 0.95rem;
        }

        margin-bottom: 1rem;
        font-style: italic;
        color: var(--gray);
        letter-spacing: 1px;
    }

    /* plantuml */
    .plantuml {
        margin: 2rem 0;
        overflow-x: auto;
        padding: 1rem;
        border: 1px solid var(--code-border);
        border-radius: 0.3rem;
    }
}

/* FOOTER */
/* RELATED NAV */
.related-container {
    height: 3rem;
    position: relative;
    left: var(--width-left-sidebar);
    width: calc(100% - var(--width-left-sidebar) - var(--width-right-sidebar));
    min-width: var(--width-left-sidebar);
    margin: 2rem 1rem 1rem 1rem;
    justify-content: space-between;

    #related-previous {
        position: absolute;
        left: 0;
    }

    #related-next {
        position: absolute;
        right: 0;

        .related-label {
            text-align: right;
        }
    }

    .related-label {
        font-size: var(--font-size-2);
        color: gray;
        margin-bottom: 0.2rem;
    }

    .related-link {
        font-size: 0.9rem;
        color: #0073BB;
    }

    /* furoのような > の表示はまた今度 */
}

/* COPY RIGHT */
.footer {
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--light-light);
    color: var(var(--light-light));
    font-size: var(--font-size-2);
}

.arabic{
    li::marker {
        content: counter(list-item) ". ";
    }
}

.xg-limitation-table th.head:nth-child(3) {
    background-color:rgb(45, 141, 89);
}
.xg-limitation-table th.head:nth-child(4) {
    background-color: rgb(179, 179, 102);
}
.xg-limitation-table th.head:nth-child(5) {
    background-color: cadetblue;
}
.xg-limitation-table tr td:nth-of-type(3)  {
    background-color:rgb(207, 239, 222);
    text-align: center;
}
.xg-limitation-table tr td:nth-of-type(4)  {
    background-color: rgb(255, 252, 227);
    text-align: center;
}
.xg-limitation-table tr td:nth-of-type(5)  {
    background-color: rgb(220, 233, 250);
    text-align: center;
}

.img-border {
    border: 1px solid lightgray;
    padding: 2px;
}