/*! GineCSS MIT-License https://ginacss.sippo.work/ */
/*! v0.0.2 beta */

@layer base, special;
@layer base {
    @media (prefers-color-scheme: light) {
        :root {
            color-scheme: light;
            --color-body-bg: #fdfdfd;
            --color-body-fg: #333;
            --color-push-fg: #007095;
        }
    }

    @media (prefers-color-scheme: dark) {
        :root {
            color-scheme: dark;
            --color-body-bg: #111;
            --color-body-fg: #ddd;
            --color-push-fg: #65a8c1;
        }
    }

    * {
        word-break: break-all;
    }

    *, *::before, *::after {
        box-sizing: border-box;
    }

    *:not(pre, code) {
        font-family: sans-serif;
    }

    body {
        background-color: var(--color-body-bg);
        color: var(--color-body-fg);
        width: 95%;
        min-width: 180px;
        max-width: 720px;
        margin: 32px auto 4px auto;
    }

    blockquote,
    hr,
    iframe,
    img,
    ol:not(ol > ol, ul > ol),
    p,
    pre,
    ul:not(ul > ul, ol > ul),
    table,
    textarea,
    video {
        margin: 8px 0 24px 0;
    }

    blockquote {
        padding-left: 4px;
        border-left: solid 6px var(--color-push-fg);
    }
    
    footer {
        margin-top: 48px;
    }

    h1,h2,h3,h4,h5,h6 {
        margin: 24px 0 4px 0;
    }

    h1 {
        font-size: 2rem;
    }

    h1 + h2,
    h2 + h3,
    h3 + h4,
    h4 + h5,
    h5 + h6 {
        margin: 0 0 4px 0;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    h5 {
        font-size: 1.1rem;
    }

    h6 {
        font-size: 1rem;
    }

    hr {
        background-color: var(--color-push-fg);
        width: 100%;
        height: 0;
        margin: 32px 0;
        padding: 1px 0;
        border: none;
        border-radius: 2px;
    }

    iframe,img,video {
        width: 100%;
        border-radius: 4px;
    }

    img {
        object-fit: contain;
    }

    /* list */
    :root {
        --color-list-dot: var(--color-body-fg);
    }

    ul, ol {
        position: relative;
        padding-left: 0px;
        list-style: none;
    }

    ul > ul, ol > ol {
        padding-left: 1.5em;
    }

    ul > li{
        position: relative;
        padding-left: 12px;
    }

    ul > li::before {
        position: absolute;
        content: "";
        top: 0.5lh;
        left: 0;
        background-color: var(--color-list-dot);
        width: 6px;
        height: 6px;
        border-radius: 50%;
        transform: translateY(-3px);
    }

    ol {
        counter-reset: olcount;
    }

    ol > li::before {
        content: counter(olcount) ". ";
        position: relative;
        top: 0;
        left: 0;
        font-size: 1em;
    }

    ol > li{
    position: relative;
    padding-left: 0; /*delete?*/
    counter-increment: olcount;
    }

    li {
        min-height: 1lh;
    }

    li+li {
        margin-top: 4px;
    }
    /* end list */

    nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    nav > a {
        flex-shrink: 1;
        padding: 2px 4px;
        font-size: 1.2rem;
        font-weight: bold;
        text-decoration: none;
    }

    p {
        margin: 4px 0;
    }

    table:not(.table-scroll) {
        width: 100%;
        border-spacing: 0;
        overflow: hidden;
    }

    table.table-scroll {
        display: block;
        border-spacing: 0;
        overflow-x: auto;
    }

    table th,table td {
        border-bottom: dashed 1px var(--color-body-fg);
    }

    table th, table td {
        padding: 4px;
        border-bottom: dashed 1px var(--color-body-fg);
        vertical-align: top;
    }

    table:not(.table-scroll) th, table:not(.table-scroll) td {
        font-size: clamp(12px, 2vw, 1rem);
    }

    table.table-scroll th, table.table-scroll td {
        min-width: 128px;
    }

    textarea {
        width: 100%;
        height: 4lh;
        min-height: 2lh;
        resize: vertical;
    }

    pre {
        padding: 8px;
        font-size: 1rem;
        border: solid 1px var(--color-body-fg);
        border-radius: 4px;
        overflow-x: auto;
    }

    code:not(pre code) {
        margin: 0 1px;
        padding: 1px 2px;
        border: solid 1px var(--color-body-fg);
        border-radius: 4px;
    }

    a {
        color: var(--color-push-fg);
    }

    button,
    input[type="button"],
    input[type="reset"],
    input[type="submit"] {
        background-color: var(--color-push-fg);
        color: var(--color-body-bg);
        margin: 0 4px;
        padding: 2px 8px;
        border: 0;
        border-radius: 4px;
        font-size: 1rem;
        cursor: pointer;
    }

    button:hover,
    input[type="button"]:hover,
    input[type="reset"]:hover,
    input[type="submit"]:hover {
        mix-blend-mode: luminosity;
    }

    button:active,
    input[type="button"]:active,
    input[type="reset"]:active,
    input[type="submit"]:active {
        opacity: 0.6;
    }

    .ct {
        text-align: center;
    }

    .lt {
        text-align: left;
    }
    
    .rt {
        text-align: right;
    }
}

@layer special {
    header > * {
        margin: 4px 0;
    }
}