/* Law Library — book grid + reader */

.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 32px 0 64px;
}

/* Tablet: two per row */
@media (max-width: 992px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Phone: one per row, full width */
@media (max-width: 600px) {
    .book-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.book-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
}

.book-cover {
    position: relative;
    height: 320px;
    background: #f3f5f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Show the whole cover (no cropping), like the Loan cards */
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

@media (max-width: 600px) {
    .book-cover {
        height: 260px;
    }
}

.book-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1f891b; /* brand green */
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.book-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.book-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
}

.book-author {
    font-size: 13px;
    color: #777;
    margin: 0;
}

.book-date {
    font-size: 13px;
    color: #555;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.book-date i {
    color: #1f891b;
}

.book-read-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1f891b;
    font-weight: 600;
    font-size: 14px;
    padding-top: 8px;
}

/* ---------- Reader ---------- */

.reader-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: #1f891b;
    color: #fff;
}

.reader-topbar h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.reader-back {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reader-back:hover { color: #eaffea; text-decoration: none; }

.reader-note {
    font-size: 13px;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reader-viewport {
    background: #525659;
    padding: 24px 12px 48px;
    min-height: 70vh;
    /* Block the accidental "save image / print" affordances on the canvases */
    user-select: none;
    -webkit-user-select: none;
}

.reader-page-canvas {
    display: block;
    margin: 0 auto 18px;
    max-width: 96%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    background: #fff;
    pointer-events: none;
}

.reader-loading,
.reader-error {
    color: #fff;
    text-align: center;
    padding: 40px 12px;
    font-size: 15px;
}

.reader-error { color: #ffd4d4; }
