.book-card {
    overflow: visible;
}

.book-cover-frame {
    z-index: 0;
    transition: transform .3s ease, box-shadow .3s ease;
}

.book-card:hover .book-cover-frame,
.book-card:focus-within .book-cover-frame {
    z-index: 2;
    transform: translateY(-18px);
    box-shadow: 0 .75rem 1.5rem rgba(25, 55, 35, .2);
}

.book-cover-frame {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(145deg, #e6f0e9, #c3d9c9);
    container-type: inline-size;
}

.book-cover-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}

.book-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(.75rem, 7cqw, 1.5rem);
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(150deg, rgba(14, 75, 39, .94), rgba(40, 130, 69, .82)),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,.08) 18px 20px);
    text-align: left;
}

.book-cover-fallback:not(.d-none) {
    display: flex;
}

.catalog-search-wrap {
    position: relative;
}

.catalog-search-wrap .form-control {
    padding-left: 2.75rem;
}

.catalog-search-icon {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: .9rem;
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: #198754;
    stroke-linecap: round;
    stroke-width: 2;
    transform: translateY(-50%);
    pointer-events: none;
}

.book-cover-text-overlay {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.cover-overlay-title,
.cover-overlay-author {
    position: absolute;
    right: clamp(.5rem, 5cqw, 1rem);
    left: clamp(.5rem, 5cqw, 1rem);
    display: -webkit-box;
    overflow: hidden;
    text-align: center;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
}

.cover-overlay-title {
    top: calc(.75rem + 1.25rem + 10px);
    font-size: clamp(.7rem, 7cqw, 1.1rem);
    font-weight: 700;
    line-height: 1.2;
    -webkit-line-clamp: 3;
}

.cover-overlay-author {
    top: 75%;
    font-size: clamp(.6rem, 5cqw, .85rem);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.2;
    -webkit-line-clamp: 2;
}

.cover-fallback-kicker {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.cover-fallback-title {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-family: Georgia, serif;
    font-size: clamp(.85rem, 8cqw, 1.2rem);
    font-weight: 700;
    line-height: 1.2;
}

.cover-fallback-author {
    transform: translateY(-.35rem);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .85rem;
    opacity: .9;
}

.book-overlay {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
}

.book-card:hover .book-overlay,
.book-card:focus-within .book-overlay {
    opacity: 1;
}

.book-feature-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 1;
}

.book-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: clamp(.76rem, 8cqi, .98rem);
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.book-card-info {
    container-type: inline-size;
}

.book-card-badges {
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    column-gap: min(25cqi, 2rem);
    padding-inline: .25rem;
}

.book-material,
.book-loan-type,
.book-status {
    font-size: clamp(.58rem, 6.5cqi, .72rem);
}

.book-loan-type {
    min-width: 0;
    overflow-wrap: anywhere;
}

.book-status {
    flex-shrink: 0;
    white-space: nowrap;
}

.book-detail-cover {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: .75rem;
    background: linear-gradient(145deg, #e6f0e9, #c3d9c9);
    margin-inline: auto;
}

.book-detail-cover > img,
.detail-cover-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-cover-fallback {
    position: absolute;
    inset: 0;
}

.book-detail-copy,
.book-detail-metadata strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.book-detail-metadata {
    font-size: clamp(.8rem, 1vw, .95rem);
}

@media (max-width: 575.98px) {
    .book-detail-cover {
        width: min(100%, 280px);
        aspect-ratio: 4 / 5;
    }

    #detailTitle {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }
}

@media (hover: none) {
    .book-overlay {
        opacity: 1;
        align-items: end;
        justify-content: end;
        padding: .75rem;
        background: linear-gradient(transparent 45%, rgba(14, 35, 22, .55));
    }

    .book-overlay .btn {
        padding: .375rem .65rem !important;
        font-size: .8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .book-cover-frame,
    .book-cover-image,
    .book-cover-fallback,
    .book-cover-text-overlay,
    .book-overlay {
        transition: none;
    }

    .book-card:hover .book-cover-frame,
    .book-card:focus-within .book-cover-frame {
        transform: none;
    }
}
