/* Reading comes first: the outline stays in the page's normal scroll flow. */
.reading-aside {
    position: static;
    align-self: start;
    min-width: 0;
}

.contents-card {
    max-height: none;
    overflow: visible;
}

.contents-card a {
    overflow-wrap: anywhere;
    text-align: start;
}

.guide-anchor,
#complete-guide {
    scroll-margin-top: 112px;
}

.guide-anchor {
    display: block;
}

.program-complete-guide {
    padding-top: 36px;
}

.program-complete-guide .prose > h2:first-child {
    margin-top: 0;
}

.guide-mobile-contents {
    display: none;
}

.guide-inline-visual {
    margin: 42px 0 34px;
    overflow: hidden;
    background: #fafaf5;
    border: 1px solid #d9e5d9;
    border-radius: 20px;
    break-inside: avoid;
}

.prose .guide-inline-visual img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.guide-inline-visual figcaption {
    padding: 18px 24px;
    border-top: 1px solid #e1e8dc;
    color: #49615b;
    font-size: 13px;
    line-height: 1.95;
    text-align: start;
}

@media (max-width: 800px) {
    .reading-aside .guide-desktop-contents,
    .program-guide-aside {
        display: none;
    }

    .guide-mobile-contents {
        display: block;
        position: static;
        max-height: none;
        overflow: visible;
        margin: 28px 0 34px;
        border: 1px solid #cbdcc9;
        border-radius: 16px;
        background: #f3f7ee;
    }

    .guide-mobile-contents > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 18px 20px;
        list-style: none;
        color: #17594e;
        font-size: 15px;
        font-weight: 800;
        cursor: pointer;
    }

    .guide-mobile-contents > summary::-webkit-details-marker {
        display: none;
    }

    .guide-mobile-contents > summary span {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        border-radius: 50%;
        background: #e1ebd7;
        font: 22px/1 Arial, sans-serif;
    }

    .guide-mobile-contents[open] > summary span {
        transform: rotate(45deg);
    }

    .guide-mobile-contents > summary:focus-visible,
    .guide-mobile-contents a:focus-visible {
        outline: 3px solid #397a63;
        outline-offset: -4px;
        border-radius: 10px;
    }

    .guide-mobile-contents .guide-inline-contents {
        display: grid;
        position: static;
        max-height: none;
        overflow: visible;
        margin: 0;
        padding: 0 20px 15px;
        border: 0;
        border-radius: 0 0 16px 16px;
        background: transparent;
    }

    .guide-mobile-contents .contents-card a {
        padding: 11px 0;
        color: #385b4f;
        font-size: 13px;
        line-height: 1.9;
        border-color: #dce7d8;
    }

    .guide-inline-visual {
        margin: 30px 0;
        border-radius: 16px;
    }

    .guide-inline-visual figcaption {
        padding: 15px 18px;
        font-size: 12px;
    }
}

@media print {
    .guide-mobile-contents {
        display: none !important;
    }

    .guide-inline-visual {
        max-width: 120mm;
        margin: 18px auto;
        box-shadow: none;
    }
}
