.book_grid {
    margin-right: -1em;
    position: relative;
}
.book_grid li {
    display: inline-block;
    width: 12em;
    margin: 0.5em 1em 0.5em 0;
    text-align: center;
    position: relative;
}

.book_grid table {
    position: absolute;
    left: 0;
    width: 100%;
    background: aliceblue;
    border: 1px solid #ccc;
    box-shadow: 0 0 8px #B2B2B2;
    z-index: 10;
    display: none;
    border-radius: 8px;
    padding-top: 10px;
}

.arrow-pointer {
    position: absolute;
    top: -10px;
}

.arrow-pointer::before {
    background-color: aliceblue;
    z-index: 3;
    box-shadow: -2px -2px 2px 0 rgba(178, 178, 178, .4);
    content: "\00a0";
    display: block;
    height: 20px;
    width: 20px;
    transform: rotate(45deg);
}

@media (max-width: 650px) {
    .book_grid li {
        width: calc(50% - 1.1em)
    }
}
.book_grid li a {
    display: block;
}
.book_grid li img {
    width: 150px;
    height: 150px;
    object-fit: contain;
}
.book_grid li img:not([src*="no-book-cover"]) {
    filter: drop-shadow(0 0 0.5em #CCCCCC);
}
.book_grid li .year_label, .year_label {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    background-color: rgba(128, 128, 128, 0.7);
    color: white;
    font-size: 0.9em;
    padding: 0 0.4em;
    border-radius: 0.5em;
}
.book_grid li .legend {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.4em * 3);
    text-overflow: ellipsis;
}

.reference_catalogue  {
    border-collapse: collapse;
}
.reference_catalogue th {
    text-align: left;
    vertical-align: top;
    padding-right: 0.5em;
    white-space: nowrap;
}
.reference_catalogue a.catalogue_download {
    display: block;
    max-width: 30em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
@media (max-width: 680px) {
    .reference_catalogue, .reference_catalogue tbody, .reference_catalogue tr, .reference_catalogue th, .reference_catalogue td {
        display: block;
    }
    .reference_catalogue th {
        font-weight: bold;
        padding: 0;
        white-space: normal;
    }
    .reference_catalogue td {
        padding: 0 0 0.3em 0;
    }
}
@media (max-width: 480px) {
    .reference_catalogue_picture {
        float: none;
        margin: 0;
        text-align: center;
    }
}

.related_works li {
    margin-bottom: 0.5em;
}

/* Literature search-specific styles  */
.catalogue_search.literature_search, #my_coins_search.bookshelf_search {
    background: #e7f2fc url(literature-background.jpg) center top;
}
.year_help {
    z-index: 100000;
    display:none;
    position:absolute;
    width:20em;
    margin:-4em 0 0 4em;
    padding:0.3em;
    background:#fbeddf;
    border:1px solid #CCCCCC;
    -webkit-box-shadow: 1px 1px 3px #AAAAAA;
    -moz-box-shadow: 1px 1px 3px #AAAAAA;
    box-shadow: 1px 1px 3px #AAAAAA;
}
.year_help h3 {
    margin:0;
    padding: 0;
}

.photo_book_search {
    width: 5.5em;
    height: 135px;
    margin: 0 1em 0 0;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .photo_book_search {
        max-width: 49%;
        height: auto;
    }
}

.volume_group_photo {
    position: relative;
    display: inline-block;
    width: 5.5em;
    height: 6em;
    filter: drop-shadow(0 0 0.5em #CCCCCC);
}

.volume_group_photo img {
    position: absolute;
    width: 4.5em;
    top: 0;
    left: 0;
}

.volume_group_photo img:nth-child(2) {
    transform: translate(0.4em, 0.2em);
}

.volume_group_photo img:nth-child(3) {
    transform: translate(0.8em, 0.4em);
}

.result_books {
    flex-wrap: unset !important;
}

@media (min-width: 601px) {
    .catalogue_search .extended_box {
        grid-template-columns: minmax(auto, 47em) fit-content(10em) !important;
    }
}

.search_box .catalogue_search_input_wrapper.extended_wrapper {
    max-width: unset;
    margin: unset;
}

/* Volume creation and modification form */
#description_list > div {
    padding-bottom: 1em;
    border-bottom: 1px solid #CCCCCC;
    margin-bottom: 1em;
}
#description_list .ck-editor {
    margin-bottom: 0.5em;
}

/* Author activity charts */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 1em;
}

.bar {
    width: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    position: relative;
}

.segment {
    width: 100%;
    position: relative;
}

.segment.articles       { background-color: #66c2a5; }
.segment.edited_books   { background-color: #fc8d62; }
.segment.authored_books { background-color: #8da0cb; }
.segment.translations { background-color: #e78ac3; }

.segment span {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #fff;
    white-space: nowrap;
}

.graph_year_label {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 10px;
    transform: rotate(-45deg);
    white-space: nowrap;
}

.graph_legend {
    display: flex;
    gap: 20px;
    padding: 1em;
    font-size: smaller;
}

.graph_legend_item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.graph_legend_color {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 2px;
}

.graph_legend_color.articles       { background-color: #66c2a5; }
.graph_legend_color.edited_books   { background-color: #fc8d62; }
.graph_legend_color.authored_books { background-color: #8da0cb; }
.graph_legend_color.translations { background-color: #e78ac3; }