/* Keep the typographic cover visible until a usable image finishes loading. */
.book-cover-image {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--cover);
    visibility: hidden;
}
.book-cover-image.is-loaded { visibility: visible; }
.cover-figure { min-width: 0; margin: 0; }
.cover-credit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .55rem;
    color: var(--muted);
    font-size: .78rem;
    margin: .55rem 0 0;
}
[data-book-cover-credit]:not(.is-loaded) { display: none; }
.cover-credit a { color: inherit; overflow-wrap: anywhere; }
.cover-credit img { flex: none; width: auto; max-width: 100%; }

.cover-editor {
    display: grid;
    grid-template-columns: minmax(5rem, 7.5rem) minmax(0, 1fr);
    align-items: center;
    gap: .8rem clamp(.75rem, 3vw, 1.6rem);
    border-color: var(--line);
    min-width: 0;
}
.cover-editor legend { color: var(--green-deep); }
.cover-edit-fields { display: grid; min-width: 0; gap: .7rem; }
.cover-edit-fields small { font-weight: 400; overflow-wrap: anywhere; }
.cover-edit-fields [hidden], .cover-editor-preview [hidden] { display: none; }
.cover-editor-preview { margin: 0; min-width: 0; }
.cover-preview-frame {
    display: grid;
    place-items: center;
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: .3rem;
    background: #eaf1ea;
    border: 1px solid var(--line);
    text-align: center;
}
.cover-preview-frame > span { color: var(--green-deep); font: italic 1.1rem/1.2 var(--serif); padding: .4rem; }
.cover-preview-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.cover-editor-status { font-size: .86rem; min-height: 1.35em; overflow-wrap: anywhere; }
.cover-lookup-button { justify-self: start; }

@media (max-width: 480px) {
    .cover-editor { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .cover-editor-preview { display: grid; grid-template-columns: minmax(4rem, 5rem) minmax(0, 1fr); align-items: end; gap: .7rem; }
}
