/* عارض الكتاب / المستند — نافذة منبثقة */

body.jia-book-viewer-open {
    overflow: hidden;
}

.jia-book-viewer {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: stretch;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 1.25rem);
}

.jia-book-viewer.is-open {
    display: flex;
}

.jia-book-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 36, 54, 0.55);
    border: 0;
    padding: 0;
    cursor: pointer;
}

.jia-book-viewer__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 960px);
    max-height: min(94vh, 900px);
    margin: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(10, 77, 110, 0.12);
    box-shadow: 0 24px 64px rgba(6, 36, 54, 0.22);
    overflow: hidden;
}

.jia-book-viewer__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(10, 77, 110, 0.1);
    background: #f8fbfd;
}

.jia-book-viewer__title {
    flex: 1 1 auto;
    margin: 0;
    font-size: clamp(0.92rem, 2vw, 1.05rem);
    font-weight: 700;
    color: var(--jia-pub-ink, #163247);
    text-align: right;
    line-height: 1.4;
}

.jia-book-viewer__close {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 10px;
    background: rgba(10, 77, 110, 0.08);
    color: var(--jia-pub-brand, #0a4d6e);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jia-book-viewer__close:hover,
.jia-book-viewer__close:focus-visible {
    background: rgba(10, 77, 110, 0.14);
}

.jia-book-viewer__body {
    flex: 1 1 auto;
    min-height: 0;
    background: #e8eef2;
}

.jia-book-viewer__frame {
    display: block;
    width: 100%;
    height: min(78vh, 720px);
    border: 0;
    background: #fff;
}

.jia-book-viewer__loading {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    font-size: 0.95rem;
    color: var(--jia-pub-muted, #5f7383);
}

.jia-book-viewer.is-loading .jia-book-viewer__loading {
    display: flex;
}

.jia-book-viewer.is-loading .jia-book-viewer__frame {
    display: none;
}