/* Canonical TOC component for pages migrated with body.toc-canonical. */

.toc-canonical .article-toc-mobile {
    display: none;
}

.toc-canonical .article-toc-mobile[hidden] {
    display: none !important;
}

.toc-canonical .toc-desktop {
    position: fixed;
    top: 16%;
    width: 14%;
    margin: 2% auto;
    padding: 1% 1% 1% 3%;
    border-right: 1px solid silver;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.toc-canonical .toc-desktop.visible {
    opacity: 1;
}

.toc-canonical .toc-desktop .content-index,
.toc-canonical .toc-desktop .content-index__list {
    width: 100%;
    margin: 0;
    padding: 0;
}

.toc-canonical .toc-desktop .content-index__link {
    color: #a5a5a5;
    letter-spacing: 0.02em;
    transition: color 0.4s ease;
}

.toc-canonical .toc-desktop .content-index__link:hover {
    color: #333;
}

.toc-canonical .toc-desktop .content-index__link.is-hover {
    color: #494848;
}

.toc-canonical .toc-desktop .content-index__item {
    margin: 0 0 20%;
    padding: 6%;
    border-left: 4px solid transparent;
    border-radius: 4px;
    font-size: clamp(0.875rem, 0.78rem + 0.22vw, 1rem);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.6px;
    transition: all 0.25s ease;
}

.toc-canonical .toc-desktop .content-index__item.is-hover {
    border-left-color: #8e976f;
    background: rgba(142, 151, 116, 0.16);
    font-weight: 600;
}

.toc-canonical .toc-desktop .content-index__sub-item {
    display: flex;
    align-items: center;
    margin: 6% auto;
    font-weight: 100;
    letter-spacing: normal;
}

.toc-canonical .toc-fab,
.toc-canonical .toc-sheet {
    display: none;
}

@media (min-width: 900px) and (max-width: 1199px) {
    .toc-canonical .toc-desktop {
        box-sizing: border-box;
        left: 24px;
        width: 176px;
        height: fit-content;
        margin: 0;
        padding: 10px 10px 10px 14px;
    }

    .toc-canonical .toc-desktop .content-index__item {
        margin: 0 0 12px;
        padding: 7px 6px 7px 8px;
        font-size: 0.875rem;
        line-height: 1.45;
    }

    .toc-canonical .toc-desktop .content-index__link {
        font-size: inherit;
        line-height: inherit;
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .toc-canonical .toc-desktop {
        box-sizing: border-box;
        left: 3vw;
        width: 184px;
        height: fit-content;
        margin: 0;
        padding: 10px 10px 10px 14px;
    }

    .toc-canonical .toc-desktop .content-index__item {
        margin: 0 0 14px;
        padding: 8px 7px 8px 10px;
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .toc-canonical .toc-desktop .content-index__link {
        font-size: inherit;
        line-height: inherit;
    }
}

@media (min-width: 1440px) and (max-width: 1599px) {
    .toc-canonical .toc-desktop {
        box-sizing: border-box;
        left: 3vw;
        width: 196px;
        height: fit-content;
        margin: 0;
        padding: 11px 11px 11px 15px;
    }

    .toc-canonical .toc-desktop .content-index__item {
        margin: 0 0 15px;
        padding: 8px 8px 8px 10px;
        font-size: 0.9375rem;
        line-height: 1.5;
    }

    .toc-canonical .toc-desktop .content-index__link {
        font-size: inherit;
        line-height: inherit;
    }
}

@media (min-width: 1600px) and (max-width: 1799px) {
    .toc-canonical .toc-desktop {
        box-sizing: border-box;
        left: 3vw;
        width: 212px;
        height: fit-content;
        margin: 0;
        padding: 12px 12px 12px 16px;
    }

    .toc-canonical .toc-desktop .content-index__item {
        margin: 0 0 16px;
        padding: 9px 8px 9px 11px;
        font-size: 0.96875rem;
        line-height: 1.5;
    }

    .toc-canonical .toc-desktop .content-index__link {
        font-size: inherit;
        line-height: inherit;
    }
}

@media (min-width: 1800px) {
    .toc-canonical .toc-desktop {
        box-sizing: border-box;
        left: 3vw;
        width: 240px;
        height: fit-content;
        margin: 0;
        padding: 14px 14px 14px 18px;
    }

    .toc-canonical .toc-desktop .content-index__item {
        margin: 0 0 18px;
        padding: 10px 9px 10px 12px;
        font-size: 1rem;
        line-height: 1.5;
    }

    .toc-canonical .toc-desktop .content-index__link {
        font-size: inherit;
        line-height: inherit;
    }
}

@media (max-width: 899px) {
    .toc-canonical .toc-desktop {
        display: none;
    }
}

@media (max-width: 768px) {
    .toc-canonical .toc-fab {
        position: fixed;
        left: 12px;
        right: auto;
        bottom: max(18px, env(safe-area-inset-bottom));
        z-index: 850;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 96px;
        min-height: 48px;
        padding: 0.7rem 1rem;
        border: 0;
        border-radius: 999px;
        background: #2ea043;
        color: #fff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
        font: inherit;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
    }

    .toc-canonical .toc-sheet {
        position: fixed;
        inset: 0;
        z-index: 800;
        display: block;
        pointer-events: none;
    }

    .toc-canonical .toc-sheet[hidden] {
        display: none !important;
    }

    .toc-canonical .toc-sheet.is-open {
        pointer-events: auto;
    }

    .toc-canonical .toc-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.18);
    }

    .toc-canonical .toc-sheet__panel {
        position: absolute;
        left: 18px;
        right: auto;
        bottom: calc(78px + env(safe-area-inset-bottom));
        box-sizing: border-box;
        width: min(360px, calc(100vw - 120px));
        max-height: 60vh;
        overflow-y: auto;
        padding: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
        overscroll-behavior: contain;
    }

    .toc-canonical .toc-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.75rem;
    }

    .toc-canonical .toc-sheet__title {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 700;
    }

    .toc-canonical .toc-sheet__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #f1f1f1;
        color: #333;
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
    }

    .toc-canonical .toc-sheet__list {
        margin: 0;
        padding-left: 1.4rem;
    }

    .toc-canonical .toc-sheet__list li + li {
        margin-top: 0.75rem;
    }

    .toc-canonical .toc-sheet__list a {
        color: #333;
        font-size: 1rem;
        line-height: 1.55;
        text-decoration: none;
    }
}

@media (min-width: 769px) {
    .toc-canonical .toc-fab,
    .toc-canonical .toc-sheet {
        display: none !important;
    }
}
