@font-face {
    font-family: 'Moralerspace Neon';
    font-weight: normal;
    font-style: normal;
    src: url(/general/fonts/MoralerspaceNeon-Regular.ttf);
}

@font-face {
    font-family: 'Moralerspace Neon';
    font-weight: bold;
    font-style: normal;
    src: url(/general/fonts/MoralerspaceNeon-Bold.ttf);
}

@font-face {
    font-family: 'Moralerspace Neon';
    font-weight: normal;
    font-style: italic;
    src: url(/general/fonts/MoralerspaceNeon-Italic.ttf);
}

@font-face {
    font-family: 'Moralerspace Neon';
    font-weight: bold;
    font-style: italic;
    src: url(/general/fonts/MoralerspaceNeon-BoldItalic.ttf);
}

/* Variables */
:root {
    --text-color: #2A2A2A;
    --body-bg-color: #C8C8C8;
    --main-bg-color: #F0F0F0;
    --header-bg-color: #A0A0B0;
    --footer-text-color: #E0E0E0;
    --footer-bg-color: #404040;
    --sidebar-bg-color: #E8E8E8;
}

/* Common throughout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    position: relative;
    background-color: var(--body-bg-color);
    font-family: 'Moralerspace Neon', serif;
}

/* Basic structure */
header,
footer,
main,
aside {
    /* Ensuring independence */
    contain: layout style paint;
    position: relative;
}

header {
    width: 100%;
    padding: 12px 16px;
    color: var(--text-color);
    background-color: var(--header-bg-color);
    border-bottom: 1px solid #B0B0B0;
}

footer {
    width: 100%;
    padding: 16px 24px 32px 24px;
    color: var(--footer-text-color);
    background-color: var(--footer-bg-color);
    border-top: 1px solid #606060;
}

#container {
    display: flex;
    flex-wrap: nowrap;
    padding: 16px;
    gap: 16px;
}

main {
    flex: 0 0 75%;
    min-width: 0;
    padding: 8px 24px 16px 24px;
    color: var(--text-color);
    background-color: var(--main-bg-color);
    border-radius: 8px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
}

aside {
    flex: 0 0 25%;
    min-width: 0;
    padding: 16px;
    color: var(--text-color);
    background-color: var(--sidebar-bg-color);
    /*border-radius: 8px;*/
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.05);
    border-right: 5px solid #C0B0A0;
}

/* Various styles */
a {
    color: #4080A0;
    text-decoration: none;
}

a:hover {
    color: #2E4A70;
    text-decoration: underline;
}

a:visited {
    color: #5050A0;
}

.icon {
    position: relative;
    top: 4px;
    height: 20px;
}

@keyframes tightenSpacing {
    from {
        letter-spacing: 0.5em;
    }

    to {
        letter-spacing: 0.05em;
    }
}

header {
    a {
        color: #FAFAFA;
        text-decoration: none;
    }

    a:hover {
        color: #00E0E0;
        text-decoration: underline;
    }

    a:visited {
        color: #FAFAFA;
    }

    .site-title {
        font-family: "Georgia", "Times New Roman", serif;
        font-size: 1.8rem;
        font-weight: normal;
        color: #FAFAFA;
        margin: 0;
        letter-spacing: 0.05em;
        animation: tightenSpacing 2.5s cubic-bezier(0, 0, 0.2, 1);
    }

    .site-title::first-letter {
        color: #A0B0C0;
    }
}

main {
    .page-info {
        color: #808080;
        font-size: 0.9em;
        margin-bottom: 20px;
        display: flex;
        flex-wrap: wrap;
        column-gap: 20px;
        row-gap: 5px;

        /*.info-category {}*/

        /*.info-tags {}*/

        /*.info-date {}*/
    }

    /* Making <wbr> work in Japanese contents*/
    p,
    .use-wbr {
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    span.no-wrap {
        white-space: nowrap;
    }

    h1 {
        font-size: 2.5em;
        border-bottom: 2px dashed #B0B0B0;
        padding-bottom: 6px;
    }

    h2 {
        font-size: 2em;
        border-bottom: 2px dotted #C0C0C0;
        padding-bottom: 6px;
    }

    h3 {
        font-size: 1.5em;
        border-bottom: 1px solid #D0D0D0;
        padding-bottom: 6px;
    }

    h4 {
        font-size: 1.25em;
    }

    h5 {
        font-size: 1.1em;
    }

    h6 {
        font-size: 0.8em;
    }

    p {
        margin-top: 1rem;
        margin-bottom: 2rem;
        line-height: 1.5em;
    }

    p.small-p {
        margin-top: 0.6rem;
        margin-bottom: 1.2rem;
        line-height: 1.1em;
        font-size: smaller;
        opacity: 0.9;
    }

    dt {
        font-size: 1.1em;
        margin-top: 0.5em;
        text-decoration: underline;
        text-decoration-color: #C0C0C0;
        text-decoration-style: dashed;
        text-underline-offset: 0.05em;
    }

    dl.ordered-dl {
        counter-reset: n 0;
    }

    dl.ordered-dl > dt::before {
        counter-increment: n 1;
        content: counter(n) ". ";
        pointer-events: none;
    }

    span.code {
        white-space: pre-wrap;
        background-color: #C0C0C0;
        font-family: 'Moralerspace Neon', monospace;
        display: inline-block;
        margin: 0 0;
        padding: 2px 4px;
        border-radius: 4px;
    }

    .big {
        font-size: larger;
    }

    .small {
        font-size: smaller;
    }

    .attention {
        color: #E00000;
        font-weight: bold;
    }

    .attention::before {
        content: "[attention]";
        clip-path: inset(100%);
        height: 1px;
        overflow: hidden;
        position: absolute;
        white-space: nowrap;
        width: 1px;
    }

    .wide-img {
        width: 100%;
    }

    .blank-line {
        visibility: hidden;
        width: 100%;
        height: 40px;
    }

    :where(button) {
        cursor: pointer;
    }

    :where(button, input, select, textarea) {
        font-family: inherit;
        font-size: inherit;
    }

    :where(audio, iframe, img, svg, video) {
        max-block-size: 100%;
        max-inline-size: 100%;
    }

    dfn[title] {
        position: relative;
        display: inline-block;
        cursor: help;
        text-decoration: underline;
        text-decoration-style: dotted;
        text-decoration-color: #A0A0A0;
        text-underline-offset: 0.1em;
    }

    abbr[title] {
        position: relative;
        display: inline-block;
        cursor: help;
        text-decoration: underline;
        text-decoration-style: dotted;
        text-underline-offset: 0.1em;
    }

    kbd {
        display: inline-block;
        font-size: 0.9em;
        font-family: 'Moralerspace Neon', monospace;
        padding: 1px 6px;
        margin: 0 3px 5px 3px;

        color: #000000;
        background-color: #D0D0D0;

        border-radius: 4px;
        border: 1px solid #909090;
        box-shadow: inset 0 -2px 0 #B0B0B0,
            0 2px 2px rgba(0, 0, 0, 0.2);
        transform: perspective(4px) rotateX(1deg);
    }

    /* Footnote */
    .footnotes {
        list-style-type: none;
        padding-inline-start: 0;

        .anchor-to-referent {
            margin-right: 0.5em;
        }

        .footnote-text {
            font-size: 0.9em;
        }
    }

    /* TOC */
    .toc-box {
        width: 90%;
        margin: 20px auto;
        padding: 15px;

        background-color: #D8D8D8;

        border: 2px solid #B0B0B0;
        border-radius: 16px;

        .toc-title {
            width: 100%;
            font-size: 1.3em;
            font-weight: bold;
            padding-bottom: 4px;
            border-bottom: 1px dashed #808080;
        }

        .toc-list {
            list-style-type: none;
            padding-inline-start: 0;

            li {
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;

            }

            .toc-content-h1 {
                font-size: 1em;
                margin-top: 0;
                margin-top: 14px;

                a {
                    color: #202020;
                }
            }

            .toc-content-h2 {
                padding-inline-start: 1em;
                font-size: 0.9em;
                margin-top: 9px;

                a {
                    color: #383838;
                }
            }

            .toc-content-h3 {
                padding-inline-start: 2em;
                font-size: 0.8em;
                margin-top: 5px;

                a {
                    color: #505050;
                }
            }

            .toc-content-h4 {
                padding-inline-start: 3.5em;
                font-size: 0.6em;
                margin-top: 2px;

                a {
                    color: #686868;
                }
            }

            .toc-content-h5 {
                padding-inline-start: 5.5em;
                font-size: 0.5em;
                margin-top: 0;

                a {
                    color: #808080;
                }
            }

            .toc-content-h6 {
                padding-inline-start: 8em;
                font-size: 0.4em;
                margin-top: 0;

                a {
                    color: #989898;
                }
            }
        }
    }

    span[id^="h-index"] {
        visibility: hidden;
    }

    del.h {
        text-decoration: none;
    }

    del.h-strike {
        text-decoration: line-through;
    }
}

footer {
    p {
        text-align: center;
        width: max-content;
        margin: 5px auto;
        padding: 10px 20px 5px 20px;
        border-bottom: 1px solid #303030;
    }

    a {
        color: #00C0FF;
    }

    a:hover {
        color: #00A0C0;
        text-decoration: underline;
    }

    a:visited {
        color: #9090FF;
    }

    .oignon-icon {
        height: 45px;
    }

    .powered {
        position: relative;
        margin-top: 20px;
        width: 60%;
        font-size: 0.9em;
    }
}

aside {
    h2 {
        font-size: 1.4em;
        border-bottom: 2px dotted #C0C0C0;
        padding-bottom: 6px;
        margin-top: 0;
    }

    h3 {
        font-size: 1.2em;
        border-bottom: 1px solid #D0D0D0;
        padding-bottom: 6px;
        margin: 1.5em 0 0.5em;
    }

    ul {
        padding-inline-start: 10px;
    }

    ul > li {
        margin: 10px 0;
    }

    .sidebar-wholelist {
        padding-left: 16px;
    }

    #sidebar-recent {
        .sidebar-datelist {
            .sidebar-datetext {
                color: #808080;
                text-decoration: underline;
                display: inline-block;
                margin-top: 5px;
                margin-bottom: 10px;
            }

            ul > li {
                margin-top: 5px;
                margin-bottom: 5px;
            }
        }
    }
}

/* Tooltip for mobile */
.tooltip {
    display: inline-block;
    width: fit-content;
    position: absolute;
    background: #333;
    color: #fff;
    opacity: 0.8;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    max-width: 200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: keep-all;
    z-index: 100;
    pointer-events: none;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Responsive */
@media (max-width: 800px) {
    #container {
        flex-direction: column;
    }

    main,
    aside {
        flex: 0 0 100%;
    }

    aside {
        border-right: none;
    }
}

/* Prism.js override */
code[class*="language-"],
pre[class*="language-"] {
    font-family: 'Moralerspace Neon', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
}

pre[class*="language-"] {
    max-width: 100%;
}
