html {
    height: -webkit-fill-available;
}

body {
    margin: 0;
    overflow: hidden;
    height: 100vh;

    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
        "Helvetica Neue", "Noto Color Emoji", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.phonemos_root {
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;

    display: flex;
    gap: 20px;

    width: 100vw;
}

.phonemos_navigation {
    width: 200px;
    min-width: 200px;
    margin: 20px 10px 20px 20px;
    flex-grow: 0;

    .phonemos_search {
        margin-left: -5px;
        margin-bottom: 8px;
    }

    & .phonemos_powered {
        display: block;
        font-size: 0.5em;
        margin-top: 20px;
        width: 100%;
        text-align: left;
    }

    .phonemos_objectTree ul {
        position: relative;
        padding-left: 5px !important;
        list-style: none;

        &::before {
            content: "";
            position: absolute;
            top: 0;
            bottom: calc(0.5em - 1px);
            left: -5px;
            background: #aaa;
            width: 1px;
        }

        & li {
            &::before {
                margin-left: -10px;
                color: #aaa;
                content: "-";
            }
            & a {
                margin-left: 1px;
                &:hover {
                    text-decoration: underline;
                }
            }

            & svg {
                display: none;
            }
        }
    }
}

.phonemos_content {
    position: relative;
    flex-grow: 1;
    flex-shrink: 1;
    margin: 0 15px 10px 0;

    & article {
        width: 100%;
        margin-right: 50px;
    }
}

.phonemos_titleImage {
    img {
        width: 100%;
    }
}

.phonemos_root .phonemos_wikipage {
    .fabric-editor-block-mark[data-mode="full-width"] {
        /* adjust for other layouts */
        width: calc(100vw - 280px);
    }

    .pm-table-container[data-layout="full-width"] {
        /* adjust in your layouts */
        width: calc(100vw - 280px);
    }
}

.phonemos_root .phonemos_announcements_channel {
    width: 100%;
    ul {
        list-style: none;
        padding-left: 0;

        article {
            margin: 5px 0;
            padding: 1px 0;

            .phonemos_announcement_image {
                float: left;
                margin-right: 16px;
                margin-bottom: 8px;
                width: 120px;
                height: 120px;
                overflow: hidden;
                border-radius: 4px;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
        }
    }

    .phonemos_announcements_channel_feeds {
        display: flex;
        gap: 8px;
        margin: 8px 0;
        flex-wrap: wrap;

        .phonemos_announcements_channel_feed {
            display: inline-flex;
            align-items: center;
            gap: 4px;

            color: inherit;
            text-decoration: none;

            padding: 4px 8px;
            border: 1px solid #ccc;
            font-size: 0.85em;

            .phonemos_announcements_channel_feed_icon {
                font-size: 0.8em;
            }
            .phonemos_announcements_channel_feed_label {
                font-size: 0.85em;
            }
        }
    }
}

.phonemos_search {
    position: relative;

    .phonemos_search_query {
        & input {
            width: calc(100% - 25px);
            background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAkklEQVR4nOWUwQ7AIAhDqdn//7I7uGxYkeHwNo5SHhhIUWuVHVG2UETkcHIAxsfZD2AmTISPM0CaQlkvNZM6SzA1HagpgnskcaHEatxVvP74WZGyZMbRtd1Eq1eu9dsu+y+g1d1p/QXKuFKr5a8FhwJAygcUH8r0AOMgx24h+mc/4vYZh9TGZINe+48aDxSMxjoBQkBdHrlrx9EAAAAASUVORK5CYII=")
                no-repeat left 3px center;
            background-size: 11px 11px;
            padding-left: 18px;
        }
    }
    .phonemos_search_loading_spinner {
        position: absolute;
        z-index: 6001;
        right: 5px;
        top: 3px;
        font-size: 0.8rem;
    }
    .phonemos_search_result {
        display: none;
    }
    .phonemos_search_result.phonemos_search_result_active {
        /* popover style */
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 95vw;
        max-width: 600px;
        background-color: white;
        border: 1px solid #ccc;
        box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
        z-index: 6000;

        padding: 0 7px;

        & ul {
            padding: 0;
            margin: 0;
            list-style-type: none;
            & li {
                cursor: pointer !important;
                padding: 10px 0;
                border-bottom: 1px solid #eee;
                &:hover {
                    background-color: #eee;
                }
                &:last-child {
                    border-bottom: none;
                }

                & p.phonemos_search_extract {
                    margin: 3px 0;
                }
            }
        }
    }
}

.phonemos_toc_section {
    position: absolute;
    right: 30px;
    top: 0;
    width: 350px;
    height: fit-content;
    border: 1px solid #ccc;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5000;
    background-color: white;
}

.phonemos_toc_trigger {
    position: absolute;
    display: block;
    right: 8px;
    top: 35px;
    cursor: pointer;

    & input {
        display: none;
    }

    & input + span::before {
        display: inline-block;
        text-align: center;
        content: "📖";
        width: 20px;
    }
    & input:checked + span::before {
        content: "↑";
    }
    & input ~ .phonemos_toc_section {
        display: none;
    }
    & input:checked ~ .phonemos_toc_section {
        display: block;
    }
}

.phonemos_title_container {
    position: relative;
}
.phonemos_title_container {
    .phonemos_content_title {
        position: absolute;
        bottom: 0px;
        left: 0px;
        z-index: 10;
        padding: 20px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        position: absolute;
        bottom: 0px;
        left: 0px;
        background-color: rgba(0, 0, 0, 0.6);
        padding: 10px 20px;
        width: calc(100% - 40px);
        color: white;
        margin: 0px;
    }
}

.phonemos_title_container_square {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;

    .phonemos_titleImage {
        order: 1;
        img {
            width: 120px;
            height: 120px;
            margin-bottom: -3px;
        }
    }
    .phonemos_content_title {
        order: 2;
        margin-left: 20px;
    }
}
