@charset "UTF-8";

@font-face {
    font-family: 'SatukitanSans';
    src: url('SatukitanSans.woff') format('woff');
}

html {
    width: 100%;
    font-size: 16px;
}

* {
    margin: 0;
    padding: 0;
    line-height: 1.5em;
}

/* 共通スタイル */
body {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--color-article-text);
    background-color: var(--color-global-background);
    font-family: sans-serif;
    font-size: 1rem;

    & > header {
        display: flex;
        flex-direction: row;
        justify-content: right;
        position: sticky;
        top: 0;
        z-index: 1;
        background-color: var(--color-primary-dark);
        color: var(--color-primary-text);

        & > a.back {
            margin: 1px;
            border-radius: 0;
            background-color: var(--color-primary-dark);
            background-image: url("./../images/back.png");
            background-size: 60%;
            background-position: center;
            background-repeat: no-repeat;

            display: block;
            width: 1rem;
            height: 1.75rem;
            text-indent: 200%;
            white-space: nowrap;
            overflow: hidden;

            &:hover {
                background-color: var(--color-primary-light);
            }
        }

        & > h1 {
            margin-right: auto;
            font-size: 1.25rem;
            padding: 0.25rem 0.25rem;
        }
    }

    & > footer {
        margin-top: auto;
        padding: 0.75rem 0.5rem;
        background-color: var(--color-primary-dark);
        color: var(--color-primary-text);
        text-align: center;
        font-size: 0.75rem;
    }
}

h2 {
    margin: 1rem 0;
    padding: 0 1rem;
    font-size: 2.5rem;
    background-color: var(--color-primary);
    color: var(--color-primary-text);
}

h3 {
    color: var(--color-primary-dark);
    border-bottom: 1px solid var(--color-primary);
    padding: 0.25rem 0.5rem;
    font-size: 2rem;
    border-radius: 0.5rem 0.5rem 0 0;
    vertical-align: middle;
    margin-bottom: 0.5rem;
}

h4 {
    color: var(--color-primary-dark);
    font-size: 1.5rem;
}

h5 {
    color: var(--color-primary);
    font-size: 1.2rem;
}

hr {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    padding: 0 !important;
    border-bottom: 1px solid var(--color-primary-light);
}

article {
    margin: 1rem;
    padding: 2px;
    border-radius: 0.5rem;
    background-color: var(--color-article-background);

    & > * {
        margin: 0.8rem;

        h3& {
            margin: 0 0 0.5rem;
        }

        h4& {
            margin-top: 1rem;
        }
    }
}

p {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
}

details {
    & > * {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;

        summary& {
            margin: 0;
            padding-left: 0.5rem;
            border-bottom: 1px solid var(--color-primary);
            color: var(--color-primary-dark);
            font-weight: bold;
        }
    }
}

textarea {
    padding: 4px;
    width: calc(100% - 12px);
}

ul {
    list-style-position: inside;
    padding-left: 0.8rem;
}

ul.link-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: left;
    padding-left: 0;
    column-gap: 0.25rem;
    row-gap: 0.25rem;

    & > li {
        list-style: none;
        display: block;
    }
}

.control-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: left;
    padding-left: 0;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    & > * {
        list-style: none;
        margin: 0;
    }
}

input[type="button"] {
    appearance: none;
    cursor: pointer;
    font-size: 1rem;
    padding-block: 0;
    padding-inline: 0;
}

a[href], input[type="button"] {
    display: inline-block;
    padding: 0.25rem;
    border: none;
    border-radius: 0.25rem;
    background-color: var(--color-primary);
    color: var(--color-primary-text);
    text-decoration: none;
}

a[href]:hover, input[type="button"]:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-text);
}

a[href]:active {
    background-color: var(--color-primary-accent);
    color: var(--color-primary-text);
}

code {
    padding: 2px;
    border-radius: 2px;
    color: var(--color-article-text);
    background-color: var(--color-code-background);
}

img {
    margin: 0 auto;
}

img.icon {
    display: inline-block;
    height: 2.5rem;
    width: 2.5rem;
    vertical-align: text-bottom;
    margin: 0;
}

/* テーブル */
table {
    border-collapse: separate;
    border-width: 0px;
    border-spacing: 0;
    border-color: var(--color-table-header-background);
    border-style: solid;
}

thead tr {
    background-color: var(--color-table-header-background);
    color: var(--color-table-header-text);
}

tbody tr {
    background-color: var(--color-table-background);
    color: var(--color-article-text);
}

tbody tr:nth-child(odd) {
    background-color: var(--color-table-background-alt);
}

th, td {
    padding: 0.2rem 0.5rem;
}

label {
    display: inline-block;
}

/* テーブル: sticky */
table.sticky > thead {
    position: -webkit-sticky;
    position: sticky;
    top: 2.25rem;
}

/* テーブル: チェッカー模様 */
table.cell-alt tbody tr:nth-child(odd) td:nth-child(even),
table.cell-alt tbody tr:nth-child(even) td:nth-child(odd) {
    background-color: var(--color-table-background);
}

table.cell-alt tbody tr:nth-child(odd) td:nth-child(odd),
table.cell-alt tbody tr:nth-child(even) td:nth-child(even) {
    background-color: var(--color-table-background-alt);
}


/* テーブル: 横スクロール有効 */

.vs-table-container {
    overflow-x: auto;
     & td, th {
         text-wrap: nowrap;
     }
}

/* 言語スイッチャー */
.language-switcher {
    display: flex;
    flex-direction: row;
    justify-content: right;
    margin-left: auto;

    & > label {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 0 0.5rem;
        vertical-align: central;
        border: 1px solid var(--color-primary-dark);
        background-color: var(--color-primary);
        color: white;

        &:has(input:checked) {
            background-color: var(--color-primary-light);
        }

        & > input[type="radio"] {
            appearance: none;
            display: none;
        }
    }
}

.satu {
    font-family: 'SatukitanSans';
    font-feature-settings: "liga" 1;
    -webkit-font-feature-settings: "liga" 1;
}

*[data-ls-kt]:lang(kt), *[data-ls-value-kt]:lang(kt) {
    font-family: 'SatukitanSans';
    font-feature-settings: "liga" 1;
    -webkit-font-feature-settings: "liga" 1;
}

/* editor */

.editor-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

.editor-preview {
    flex: 1;
    background-color: white;
    padding: 0;
}

.editor-control {
    flex: 1;
    margin: 0;

    & > * {
        margin: 0.8rem;
    }
}

@media (max-width: 799px) {
    .editor-container {
        flex-direction: column;
    }

    #preview_figure {
        margin: 0.5rem auto;
        max-height: min(90vw, 50vh);
    }

    .editor-preview {
        margin: 0.8rem;
        position: sticky;
        top: 2.5rem;
    }
}

@media (min-width: 800px) {
    .editor-container {
        flex-direction: row;
    }

    #preview_figure {
        position: sticky;
        top: 2.5rem;
        max-height: 80vh;
    }

    .editor-preview {
        margin: 0.8rem;
        min-width: 500px;
        max-width: 80vh;
    }
}

/* 汎用書式指定 */

.large {
    font-size: 2rem;
}

.small {
    font-size: 0.8rem;
}

.thin {
    font-weight: normal;
}

.center {
    text-align: center;
}

.left {
    text-align: left;
}

.nowrap {
    white-space: nowrap;
}

.wrap {
    white-space: wrap;
}

.red {
    color: #DF4121;
}

.blue {
    color: #217BDF;
}

.green {
    color: #339564;
}

.yellow {
    color: #C3B827;
}

.gray {
    color: #A0A0A0;
}