/* Loaded after the legacy responsive styles, only on encyclopedia listings. */
.kk-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 12px;
    clear: both;
    box-sizing: border-box;
    max-width: 100%;
    margin: 12px 0 20px;
    padding: 10px 0;
    color: #794a47;
    font-size: 14px;
}

.kk-pagination__status {
    flex: 1 1 140px;
    font-size: 13px;
    line-height: 1.5;
}

.kk-pagination__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.kk-pagination__links > a,
.kk-pagination__links > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    min-width: 36px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #ccb098;
    border-radius: 8px;
    background: #faeddf;
    color: #663333;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
}

.kk-pagination__links > a:hover {
    border-color: #996633;
    background: #fff7ef;
    color: #663333;
}

.kk-pagination__links > a:focus {
    outline: none;
}

.kk-pagination__links > a:focus-visible {
    outline: 2px solid #794a47;
    outline-offset: 2px;
}

.kk-pagination__links > .kk-pagination__current {
    border-color: #794a47;
    background: #794a47;
    color: #fff;
    font-weight: bold;
}

.kk-pagination__links > .kk-pagination__disabled {
    border-color: #dbc7b5;
    background: transparent;
    color: #887566;
}

.kk-pagination__links > .kk-pagination__ellipsis {
    min-width: 20px;
    padding-right: 2px;
    padding-left: 2px;
    border-color: transparent;
    background: transparent;
}

.kk-pagination__all {
    flex: 0 0 100%;
    box-sizing: border-box;
    min-width: 0;
}

.kk-pagination__all > summary {
    width: fit-content;
    max-width: 100%;
    padding: 5px 0;
    color: #794a47;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}

.kk-pagination__all > summary:focus {
    outline: none;
}

.kk-pagination__all > summary:focus-visible {
    outline: 2px solid #794a47;
    outline-offset: 2px;
}

.kk-pagination__all-links {
    justify-content: flex-start;
    margin-top: 6px;
    padding: 8px 0;
}

/* Allow alphabet and sort options to wrap instead of clipping a 697px row. */
#ecyclopediagroupmenu {
    box-sizing: border-box;
    width: 100%;
    overflow: visible;
    border-radius: 10px;
}

#ecyclopediagroupmenu .ecyclopediagroupmenustring,
#ecyclopediagroupmenu .ecyclopediagroupmenustringtag {
    display: flex;
    align-items: flex-start;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 22px;
    overflow: visible;
}

#ecyclopediagroupmenu .ecyclopediagroupmenustringtitle {
    flex: 0 0 105px;
    box-sizing: border-box;
    width: auto;
    float: none;
    line-height: 24px;
}

#ecyclopediagroupmenu .ecyclopediagroupmenustringwork {
    flex: 1 1 0;
    min-width: 0;
    overflow: visible;
    line-height: 26px;
}

#ecyclopediagroupmenu .ecyclopediagroupmenustringwork > span {
    display: inline-block;
    margin: 0 3px 4px 0;
    line-height: 18px;
    vertical-align: top;
    white-space: nowrap;
}

#ecyclopediagroupmenu .ecyclopediagroupmenustringwork > .encyclopediagrouplettertag {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Do not skip underlines around Cyrillic descenders (U+0414). */
#ecyclopediagroupmenu .encyclopediagroupletter > a {
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
}

.encyclopedialistitem {
    display: flow-root;
}

.encyclopedialistitemright {
    min-width: 0;
    overflow-wrap: break-word;
}

.encyclopedialistitemright .encyclopediagrouppicscontainer {
    box-sizing: border-box;
    max-width: 100%;
}

@media screen and (max-width: 619px) {
    .kk-pagination {
        justify-content: flex-start;
        padding-right: 3px;
        padding-left: 3px;
    }

    .kk-pagination__status {
        flex-basis: 100%;
    }

    .kk-pagination__links {
        justify-content: flex-start;
    }

    .kk-pagination__links > a,
    .kk-pagination__links > span {
        min-height: 40px;
    }

    #ecyclopediagroupmenu .ecyclopediagroupmenustring,
    #ecyclopediagroupmenu .ecyclopediagroupmenustringtag {
        flex-direction: column;
    }

    #ecyclopediagroupmenu .ecyclopediagroupmenustringtitle {
        flex-basis: auto;
    }

    #ecyclopediagroupmenu .ecyclopediagroupmenustringwork {
        flex-basis: auto;
        width: 100%;
        padding-right: 5px;
        padding-left: 5px;
        box-sizing: border-box;
    }
}
