.overlay {
    background-color: rgba(0, 0, 0, 0.3);
    left: 0;
    height: 100%;
    opacity: 0;
    position: fixed;
    top: 0;
    transition: opacity ease 0.2s;
    width: 100%;
    z-index: -1;
}

.close {
    display: flex;
    height: 24px;
    padding: 4px;
    width: 24px;
}

.close img {
    height: 20px;
    margin-left: calc(var(--space-quarter) / 2);
    width: 20px;
}

.wrapper {
    position: relative;
}

.guide {
    background-color: var(--color-lightblue);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* mobile viewport bug fix */
    max-height: -webkit-fill-available;
    margin-right: calc(var(--guide-width) * -1);
    overflow-y: auto;
    transition: margin-right 0.2s ease, transform 0.2s ease;
    width: var(--guide-width);
    will-change: margin-right, transform;
}

:global(.os-linux) .guide::-webkit-scrollbar-thumb,
:global(.os-windows) .guide::-webkit-scrollbar-thumb {
    /* the guide is always blue regardless of darkmode so we can hardcode the scroll-thumb to white */
    background-color: white;
}

.header {
    background-color: var(--color-blue);
    flex-shrink: 0;
    padding: 23px var(--space-default);
    padding-top: calc(23px + env(safe-area-inset-top, 0));
}

.header h2 {
    font-size: var(--header-default-font-size);
    font-weight: 400;
    margin: 0;
}

.header a {
    cursor: pointer;
    font-size: 20px;
}

.content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 0 var(--space-default);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.content h1 {
    font-size: 1.5em;
    margin-top: 0px;
}

.content h2 {
    font-size: 1.1em;
    font-weight: 400;
    line-height: 1.2em;
    margin: 0px;
}

.guide p {
    font-size: var(--size-default);
    margin: 0.4em 0;
}

.show {
    margin-right: 0;
}

.entry {
    margin-top: var(--space-default);
}

.appendix {
    padding-top: var(--space-half);
    margin-top: auto;
}

.entryTitle {
    align-items: flex-start;
    cursor: default;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

.entryTitle .entryToggle {
    align-items: center;
    display: flex;
    flex-direction: row;
    font-weight: bold;
    justify-content: flex-start;
    line-height: 1.2em;
    width: 16px;
}

.entryTitle .entryTitleText {
    flex: 1;
}

.entryContent {
    align-items: flex-start;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding-left: 16px;
}

.expanded {
    flex-basis: 0;
}

.link {
    color: inherit;
    text-decoration: underline;
}

.link:focus {
    outline-color: inherit;
}

@media (max-width: 1348px) {
    .guideWrapper {
        width: calc( (((100% - var(--sidebar-width-large)) - var(--content-width)) / 2) + 18px + var(--space-default) );
    }
}

@media screen and (max-width: 1601px) {
    .overlay.show {
        opacity: 1;
    }

    .guide {
        margin-right: 0;
        max-width: 460px;
        opacity: 0;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateX(100%);
        transition-delay: 0.2s;
        width: 100%;
        z-index: -10;
    }

    .show {
        opacity: 1;
        z-index: 4002;
    }

    .guide.show {
        transform: translateX(0%);
    }
}

@media (max-width: 768px) {
    .guideWrapper {
        position: fixed;
        right: 0;
        top: 0;
        width: calc(var(--space-half) + 18px);
    }

    .header,
    .content {
        padding-left: var(--space-half);
        padding-right: var(--space-half);
    }
}

@media screen and (max-width: 640px) {
    .guide h2 {
        font-size: 1.05em;
    }
}
