.library-name > a {
    position: relative;
    --logo-width: 50px;
    margin-left: calc(var(--logo-width) + 10px);
    margin-right: 40px;
}

.library-name a span {
    display: none
}
.library-name a::before {
    content: '';
    background: url("../images/logo.png") center no-repeat;
    background-size: contain;
    position: absolute;
    width: var(--logo-width);
    height: 50px;
    top: -18px;
    left: calc(-1 * var(--logo-width) - 5px);
}

/* since dokka 1.9.10 navigation-wrapper has no longer the class navigation-wrapper but padding changed
   hence this fix
 */
#navigation-wrapper:not(.navigation-wrapper) .library-name a::before {
    top: -36px;
}


/* adopted from https://blog.logrocket.com/making-dropdown-menus-css/ */

.library-name {
    margin-top: 5px;
    margin-right: 12px;
}
#versions + div:not(.pull-right) {
    /* hide default version from dokka */
    display: none;
}

#versions  {
    transform: initial;
    transition: transform ease 0.2s;
    position: relative;
}

#versions * {
    margin: 0;
    box-sizing: border-box;
}

#versions .dropdown,
#versions button {
    width: 7rem;
    font-family: var(--default-font-family);
}
#versions .dropdown {
    position: absolute;
    box-shadow: 0 10px 15px -3px rgba(46, 41, 51, 0.08),
    0 4px 6px -2px rgba(71, 63, 79, 0.16);
    z-index: 99;
    padding: 0;
    background-color: var(--color-dark);
    border-radius: 0 0 0.5rem 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    transition: height ease 0.2s;
    left: auto;
    right: 0;
    display: none;
}
#versions.showList .dropdown {
    max-height: 300px;
    display:block;
}

#versions ul li {
    position: relative;
    list-style: none;
    font-size: var(--default-font-size);
}
:root {
    --scrollbar-width: calc(100vw - (100vw - 100%));
}

#versions button {
    font-size: inherit;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}
#versions ul li a, #versions button {
    padding: 0.4rem 1rem;
    text-align: center;
    font-size: var(--default-font-size);
}
#versions ul li a {
   display: block;
   color: inherit;
   text-decoration: none;
   width: 100%;
}

#versions ul li:hover,
#versions ul li a:focus {
    color: var(--color-dark);
}
#versions ul li:hover a,
#versions ul li a:focus,
#versions ul li button:hover {
    background-color: #f2f2f2;
}

#versions .arrow {
    width: 0.5em;
    height: 0.5em;
    display: inline-block;
    vertical-align: middle;
    border-left: 0.15em solid currentColor;
    border-bottom: 0.15em solid currentColor;
    transform: rotate(-45deg);
    position: absolute;
    margin-top: 0.25em;
    right: 0.75em;
    transition: transform 100ms ease-in-out;
}

#versions.showList > button > .arrow {
     transform: rotate(-225deg);
     margin-top: 0.5em;
}

/* TODO fix for dokka, wrong colors in dark-mode -- shall be fixed with Dokka 1.9.0, check and adopt if necesary */
@media screen and (max-width: 759px) {
    .library-name > a {
        margin-right:0;
    }
    :root.theme-dark #container #leftColumn {
        background: var(--background-color);
    }
    :root.theme-dark #leftToggler {
        color: var(--default-font-color);
    }
}

@media screen and (max-width: 759px) {

    #navigation-wrapper:not(.not-small) {
        .library-name > a {
            --logo-width: 50px;
        }

        .library-name a::before {
            background: url("../images/logo-icon.svg") center no-repeat;
            background-size: 50px 50px;
        }
        #versions .dropdown,
        #versions button {
            width: 5.5rem;
            font-size: 13px;
        }
        #versions ul li,
        #versions ul li a, #versions button {
            font-size: 13px;
        }
    }


    /* We want to show the dark mode button also if media is small */
    #theme-toggle-button {
        display: block;
    }

    .library-name a::before {
        /* dokka 1.9.10 started to hide the logo on smaller screens, I don't see why, there is enough space for the small icon*/
        display: inherit;
    }

    /* dokka only sets this if 760px or bigger but without the alignment of the search and theme icon are displaced */
    .navigation-controls {
        align-items: center;
    }

}

/* fix navigation height */
#navigation-wrapper {
    height: calc(var(--top-navigation-height) - 19px - 18px);
}
/* since dokka 1.9.10 navigation-wrapper is only an id and no longer a id + class */
#navigation-wrapper:not(.navigation-wrapper) {
    /* dokka now uses 10px but that looks a bit squeezed, but cannot use 19px top 18px bottom as before
     as the height changed from 36px to 40px, thus adjusting the padding and height a bit */
    padding: 19px var(--horizontal-spacing-for-content) 18px;
}

/* custom classes */
.external-indicator {
    padding-left: 0.5em;
}
.external-indicator::before {
    content: url("../images/footer-go-to-link.svg");
}

.github::before {
    content: '';
    mask: url("../images/github-mark.svg") no-repeat 50% 50%;
    -webkit-mask: url("../images/github-mark.svg") no-repeat 50% 50%;

    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--footer-font-color);
    vertical-align: bottom;
}

ul li {
    padding-top: 0.1em;
    padding-bottom: 0.1em;
}

