 
.library-rtl {
    direction: rtl;
    text-align: right;
}

.library-rtl [dir="ltr"] {
    text-align: left;
}

.library-search-card {
    box-shadow: 0 24px 60px rgba(0, 77, 61, 0.08);
}

.library-books-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .library-books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .library-books-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .library-books-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.library-book-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: right;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-radius: 1.35rem;
    background: linear-gradient(165deg, #ffffff 0%, #f9fafb 55%, #f3f4f6 100%);
    border: 1px solid rgba(0, 77, 61, 0.1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 18px 40px -12px rgba(0, 77, 61, 0.12);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

    .library-book-card::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 5px;
        background: linear-gradient(90deg, #004D3D 0%, #0d6b55 35%, #c5a059 65%, #e8d4a6 100%);
        opacity: 0.95;
    }

    .library-book-card:hover {
        transform: translateY(-6px);
        border-color: rgba(197, 160, 89, 0.55);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 28px 50px -14px rgba(0, 77, 61, 0.18), 0 0 0 1px rgba(197, 160, 89, 0.2);
    }

a.library-book-card--pdf {
    cursor: pointer;
}

    a.library-book-card--pdf:hover {
        border-color: rgba(197, 160, 89, 0.65);
    }

    a.library-book-card--pdf:focus-visible {
        outline: 3px solid rgba(197, 160, 89, 0.85);
        outline-offset: 3px;
    }

a.library-book-card--nopdf {
    cursor: default;
}

.library-book-inner {
    position: relative;
    padding: 1.25rem 1.2rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

.library-book-title {
    font-size: 1.0625rem;
    line-height: 1.45;
    font-weight: 900;
    color: #004D3D;
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(0, 77, 61, 0.1);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-book-fields {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

    .library-book-fields > div {
        display: grid;
        grid-template-columns: 5.5rem 1fr;
        gap: 0.5rem 0.75rem;
        align-items: baseline;
        text-align: right;
    }

    .library-book-fields dt {
        margin: 0;
        font-size: 0.72rem;
        font-weight: 800;
        color: #c5a059;
        letter-spacing: 0.02em;
    }

    .library-book-fields dd {
        margin: 0;
        font-size: 0.8125rem;
        font-weight: 700;
        color: #374151;
        line-height: 1.45;
        word-break: break-word;
    }

.library-book-cover-wrap {
    width: 100%;
    max-width: 9.5rem;
    margin: 0 auto 0.9rem;
    aspect-ratio: 2 / 3;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(197, 160, 89, 0.45);
    background: linear-gradient(160deg, #004D3D 0%, #0a5c4a 45%, #003329 100%);
    box-shadow: 0 10px 28px rgba(0, 77, 61, 0.2);
    flex-shrink: 0;
}

    .library-book-cover-wrap img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.library-book-cover-placeholder {
    width: 100%;
    height: 100%;
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(232, 212, 166, 0.85);
}

    .library-book-cover-placeholder svg,
    .library-book-cover-placeholder i {
        width: 2.75rem;
        height: 2.75rem;
    }

.library-input-wrap {
    position: relative;
}

.library-input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #c5a059;
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.95;
}

.library-input-wrap textarea ~ .library-input-icon,
.library-input-wrap .library-input-icon--textarea {
    top: 1rem;
    transform: none;
}

.library-input-wrap .library-input-control {
    padding-right: 3rem !important;
}

.library-input-control::placeholder {
    color: #9ca3af;
    font-weight: 700;
}

.mag-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    padding: 20px;
}

    .mag-modal.is-open {
        display: flex;
    }

.mag-modal-dialog {
    width: min(1200px, 100%);
    height: min(88vh, 920px);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
    display: grid;
    grid-template-rows: 56px 1fr;
}

.mag-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #004d3d;
    color: #fff;
}

.mag-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.mag-modal-close {
    border: 0;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 800;
    background: #c5a059;
    color: #1f2937;
    cursor: pointer;
}

.mag-modal-body {
    position: relative;
    background: #f8fafc;
}

#flipbookContainer {
    width: 100%;
    height: 100%;
}

 
