/* Nayu modified style */

@font-face {
    font-family: "Mona Sans";
    font-weight: 200 900;
    font-stretch: 80% 125%;
    src:
        url("/assets/fonts/Mona-Sans.woff2") format("woff2 supports variations"),
        url("/assets/fonts/Mona-Sans.woff2") format("woff2-variations");
}

/* Nayu Edit */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .gh-toc {
        animation: none;
    }

    .gh-toc-link,
    .gh-toc-link::before {
        transition: none;
    }
}

/* End Nayu Edit */

.has-light-text .gh-list-item-inner {
    border-color: rgba(255, 255, 255, 0.3);
}

.has-light-text .gh-content table:not(.gist table) th {
    background-color: var(--color-dark-gray);
}

.has-light-text .gh-content table:not(.gist table) td {
    background-image: none;
    background-repeat: no-repeat;
    background-size: 20px 100%;
}

.gh-content table:not(.gist table) {
    text-wrap-mode: wrap
}

/* Table of contents - Nayu */

.gh-article-layout {
    position: relative;
    display: block;
    align-items: start;
    margin-top: 48px;
}

.gh-article-content {
    min-width: 0;
}

.gh-article-content :is(p) {
    text-align: justify;
}

.gh-article-content :is(h1, h2, h3) {
    scroll-margin-top: 120px;
}

.gh-toc {
    position: fixed;
    top: var(--toc-top, 96px);
    max-height: calc(100vh - 128px);
    right: clamp(1.6rem, 2.8vw, 3.6rem);
    width: min(280px, calc(100vw - 3.2rem));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    animation: ghTocIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: top 0.2s ease;
    z-index: 2;
}

.gh-toc-inner {
    padding: 20px 20px 18px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 18px;
    background: color-mix(in srgb, var(--color-white) 84%, transparent);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.12),
        0 8px 18px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(14px);
}

:is(.dark-mode, .theme-dark, .has-light-text) .gh-toc-inner {
    border-color: rgba(255, 255, 255, 0.14);
    background: color-mix(in srgb, var(--color-black) 72%, transparent);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.32),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

.gh-toc-label {
    margin: 0 0 14px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
}

.gh-toc-nav {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.gh-toc-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gh-toc-item {
    --toc-indent: 0rem;
    --toc-size: 1.5rem;

    margin-left: var(--toc-indent);
}

.gh-toc-item-level-2 {
    --toc-indent: 1rem;
    --toc-size: 1.35rem;
}

.gh-toc-item-level-3 {
    --toc-indent: 2rem;
    --toc-size: 1.2rem;
}

.gh-toc-link {
    position: relative;
    display: block;
    padding: 0.4rem 0.8rem 0.4rem 1rem;
    font-size: var(--toc-size);
    line-height: 1.45;
    color: inherit;
    text-decoration: none;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 999px 999px 0;
    overflow-wrap: anywhere;
    transition:
        transform 0.3s ease,
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

:is(.dark-mode, .theme-dark, .has-light-text) .gh-toc-link {
    border-left-color: rgba(255, 255, 255, 0.16);
}

.gh-toc-link:hover,
.gh-toc-link:focus-visible,
.gh-toc-link.is-active {
    color: var(--ghost-accent-color);
    background-color: color-mix(in srgb, var(--ghost-accent-color) 12%, transparent);
    border-left-color: var(--ghost-accent-color);
    transform: translateX(4px);
}

.gh-toc-link::before {
    position: absolute;
    top: 50%;
    left: -7px;
    width: 8px;
    height: 8px;
    content: "";
    background: currentColor;
    border-radius: 50%;
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.gh-toc-link:hover::before,
.gh-toc-link:focus-visible::before,
.gh-toc-link.is-active::before {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.gh-toc-link:focus-visible {
    outline: none;
}

@keyframes ghTocIn {
    from {
        opacity: 0;
        transform: translate3d(16px, 10px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@media (max-width: 1279px) {
    .gh-article-layout {
        display: block;
    }

    .gh-toc {
        position: relative;
        top: 0;
        max-height: none;
        width: 90%;
        margin: 0 auto 24px;
        right: auto;
    }

    .gh-toc-inner {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .gh-toc-inner {
        padding: 18px 16px 16px;
        border-radius: 14px;
    }

    .gh-article-layout {
        margin-top: 32px;
    }

    .gh-toc {
        top: 0;
        right: auto;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .gh-toc-link {
        padding-left: 0.9rem;
    }
}