/* image */
figure.imgbox {
    width: 50%;
    margin: 5px auto 15px auto;
    padding: 5px;
    border: solid 2px;
    border-radius: 4px;
}

figure.imgbox img {
    max-width: 100%;
    max-height: 400px;
    margin: 0 auto 5px;
    padding: 0;
    display: block;
}

figure.imgbox figcaption {
    border-top: dotted 2px #ccc;
    font-size: .8rem;
}

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

/* character */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

figure.gallery {
    margin: 5px auto 15px auto;
}

figure.gallery .imgwrap {
    height: 380px;
}

figure.gallery img {
    margin: 0;
    padding: 0;
    display: block;
}

figure.gallery figcaption {
    border-top: dotted 2px #ccc;
}

@media screen and (max-width: 640px) {
    .gallery-container {
        grid-template-columns: repeat(1, 1fr);
    }

    figure.gallery .imgwrap {
        height: auto;
    }

    figure.gallery:last-child .imgwrap {
        margin-top: 0;
        height: auto;
    }
}

/* index */
.toc {
    margin: .8rem 0 0;
    box-shadow: 1px 1px 4px #ddd;
    position: relative;
}

.toc>input {
    display: none;
}

.toc>label {
    background: #fff !important;
    color: #49bf9d !important;
    display: flex !important;
    margin: 0 !important;
    padding: 0 0 0 1rem !important;
    font-size: .9rem !important;
    line-height: 2.4rem !important;
    cursor: pointer !important;
    user-select: none !important;
    border-left: solid 6px #49bf9d !important;
    border-bottom: dashed 2px #49bf9d !important;
}

.toc>label::before {
    display: none !important;
}

.toc>label::after {
    content: '\f106';
    font-family: FontAwesome;
    display: block;
    padding: 0 1rem 0 0;
    position: absolute;
    right: 0;
}

.toc-chapter {
    height: auto;
    padding: .5rem 0 1rem 1.5rem;
    margin: 0;
    font-size: .9rem;
    visibility: visible;
    overflow: hidden;
}

.toc>input:checked~label::after {
    content: '\f107';
}

.toc>input:checked~.toc-chapter {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    visibility: hidden;
}

#TableOfContents ul {
    margin: 0;
    display: block;
    text-align: left;
}

#TableOfContents>ul {
    list-style-type: disc;
}

#TableOfContents>ul>li>ul {
    list-style-type: circle;
}

/* reverse toggle for small screen device */
@media screen and (max-width: 980px) {
    .toc>label::after {
        content: '\f107';
    }

    .toc>.toc-chapter {
        height: 0;
        padding-top: 0;
        padding-bottom: 0;
        visibility: visible;
    }

    .toc>input:checked~label::after {
        content: '\f106';
    }

    .toc>input:checked~.toc-chapter {
        height: auto;
        padding-top: .5rem;
        padding-bottom: 1rem;
        visibility: visible;
    }
}

/* sidebar */
#sidebar ul li a,
#sidebar ul li a:visited {
    color: rgba(255, 255, 255, 0.8);
}
