/* Segmented, member-only book reader. */
.reader-site.is-reading-book .page-grid{grid-template-columns:minmax(0,1fr);max-width:1120px}
.reader-site.is-reading-book .page-grid>.aside{display:none}
.reading-book-heading{margin-bottom:1rem}
.reading-book-heading h1{font-size:clamp(1.4rem,3vw,2rem);overflow-wrap:anywhere}
.reading-book-heading .badge{margin-inline-start:.65rem}
.reading-book-toolbar,.reading-book-bottom{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;padding:1rem;background:var(--paper);border:1px solid var(--line);border-radius:14px}
.reading-book-toolbar button,.reading-book-bottom button{min-height:44px;white-space:normal}
.reading-book-jump{display:flex;align-items:center;justify-content:center;gap:.5rem;flex-wrap:wrap;margin:0}
.reading-book-jump input{width:5rem!important;min-width:0;text-align:center;margin:0;min-height:44px}
.reading-book-jump label,.reading-book-jump span{margin:0;white-space:nowrap}
.reading-book-status{margin:1rem .2rem;overflow-wrap:anywhere;min-height:2em}
.reading-book-toc{padding:1rem 1.25rem}
.reading-book-toc summary{cursor:pointer;font-weight:700;min-height:44px;display:list-item;padding:.4rem .2rem}
.reading-book-toc input{margin-top:.75rem}
.reading-book-toc ol{list-style:none;padding:0;margin:.75rem 0;max-height:28rem;overflow:auto;overscroll-behavior:contain}
.reading-book-toc li{margin:0;border-bottom:1px solid var(--line)}
.reading-book-toc a{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:44px;padding:.55rem .3rem;text-decoration:none;overflow-wrap:anywhere}
.reading-book-toc a:hover{background:var(--green-soft)}
.reading-book-toc a small{flex-shrink:0;color:var(--muted)}
.reading-book-toc-level-2 a{padding-inline-start:1.15rem}
.reading-book-toc-level-3 a{padding-inline-start:2rem}
.reading-book-error{padding:1rem;background:var(--paper);border:1px solid var(--line);border-radius:12px;margin-bottom:1rem}
.reading-book-error[hidden]{display:none}
.reading-book-content{font-family:'Qaim Reading',Tahoma,Arial,serif;font-size:calc(1.16rem * var(--font-scale,1));line-height:2.1;padding:clamp(1rem,4vw,3.5rem);margin:1rem 0;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:16px;min-height:12rem;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.reading-book-content:focus{outline:none}
.reader-site .reading-book-content[data-copy-allowed="false"],.reader-site .reading-book-content[data-copy-allowed="false"] *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
.reading-book-content [id]{scroll-margin-top:2rem}
.reading-book-content p{margin:0 0 1.1em}
.reading-book-content h1,.reading-book-content h2,.reading-book-content h3,.reading-book-content h4,.reading-book-content h5,.reading-book-content h6{line-height:1.8;margin:1.35em 0 .75em;color:var(--green-dark);font-family:inherit;overflow-wrap:anywhere}
.reading-book-content h1{font-size:1.65em}.reading-book-content h2{font-size:1.45em}.reading-book-content h3{font-size:1.25em}
.reading-book-content a{color:var(--green-dark);text-decoration:underline;text-underline-offset:.2em;overflow-wrap:anywhere}
.reading-book-content a:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.reading-book-content img{max-width:100%;height:auto;display:block;object-fit:contain;margin:1rem auto;border-radius:4px;-webkit-user-drag:none}
.reading-book-content table{border-collapse:collapse;width:100%;max-width:100%;table-layout:fixed;margin:1rem 0;font-size:.9em}
.reading-book-content td,.reading-book-content th{border:1px solid var(--line);padding:.55rem;vertical-align:top;overflow-wrap:anywhere}
.reading-book-content [aria-disabled=true],.reading-book-content .book-link-disabled{color:var(--muted);text-decoration:underline dotted;text-underline-offset:.25em;cursor:default}
.reading-book-content [dir=ltr]{unicode-bidi:plaintext}
/* Word may split one Arabic word across identically formatted runs. Isolating
   each RTL span interrupts contextual letter shaping at those run boundaries. */
.reading-book-content span[dir=rtl]:not(.book-textbox-paragraph){unicode-bidi:normal}
.reader-site.reading-mark-adjusting .reading-book-content{cursor:crosshair}
.reader-site.dark .reading-book-content [style*="color"]{color:inherit!important;background-color:transparent!important}
.reading-book-content .book-list-marker{display:inline-block;direction:inherit;unicode-bidi:isolate;white-space:nowrap;padding-inline-end:.4em}
.reading-book-content .book-list-marker [dir]{direction:inherit;unicode-bidi:normal}
.reading-book-content .book-anchor{display:inline;scroll-margin-top:2rem}
/* Word's printed TOC tab becomes a flexible title and a separate page column. */
.reading-book-content .book-toc-ready{direction:rtl!important;text-align:right!important;margin:0!important;padding-block:.2em;border-block-end:1px solid var(--line,#d8d3c0)}
.reading-book-content .book-toc-ready[dir=ltr]{direction:ltr!important;text-align:left!important}
.reading-book-content .book-toc-ready.book-toc-layout,.reading-book-content .book-toc-ready>.book-toc-layout{position:relative;display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:start;gap:.65em;min-width:0;max-width:100%;min-height:44px;box-sizing:border-box;padding:.45em .25em}
.reading-book-content .book-toc-ready .book-toc-title{grid-column:1;min-width:0;white-space:normal;overflow-wrap:anywhere;word-break:normal;text-align:inherit;unicode-bidi:isolate;line-height:1.8}
.reading-book-content .book-toc-ready .book-toc-page{grid-column:2;min-width:2ch;white-space:nowrap;overflow-wrap:normal;word-break:normal;direction:ltr;unicode-bidi:isolate;text-align:left;line-height:1.8}
.reading-book-content .book-toc-ready .book-toc-separator{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:pre}
.reading-book-content .book-toc-ready a,.reading-book-content .book-toc-ready :is(u,span,em,strong){color:inherit!important;text-decoration:none!important}
.reading-book-content .book-toc-ready .book-link-disabled{color:var(--muted,#4b685a)!important;cursor:default}
.reading-book-content .book-toc-link{border-radius:.4rem}
.reading-book-content .book-toc-link:hover{background:var(--green-soft,#e5eee4)}
.reading-book-content .book-toc-link:focus-visible{outline:2px solid var(--green,#154f46);outline-offset:2px}
.reading-book-bottom{margin-top:1rem}
@media(max-width:600px){
 .reading-book-toolbar{display:grid;grid-template-columns:1fr 1fr;padding:.75rem;gap:.6rem}
 .reading-book-toolbar .reading-book-jump{grid-column:1/-1;grid-row:2}
 .reading-book-content{padding:1rem .85rem;font-size:calc(1.08rem * var(--font-scale,1));border-radius:12px;line-height:2.05}
 .reading-book-content table{font-size:.75em}.reading-book-content td,.reading-book-content th{padding:.3rem}
 .reading-book-content .book-table-scroll{max-inline-size:100%;min-inline-size:0;overflow-x:auto;overscroll-behavior-inline:contain}
 .reading-book-content .book-table-scroll table{table-layout:auto;max-inline-size:none}
 .reading-book-content .book-table-scroll :is(td,th){min-inline-size:4.5rem;overflow-wrap:normal;word-break:normal}
 .reading-book-content .book-table-scroll[data-table-overflow]::before{content:"مرّر الجدول أفقيًا لعرض بقية الأعمدة";display:block;position:sticky;inset-inline-start:0;inline-size:max-content;max-inline-size:100%;padding-block:.25rem .45rem;font:400 .8rem/1.5 "Qaim UI",Tahoma,Arial,sans-serif;color:var(--muted)}
 .reading-book-toc{padding:.7rem}.reading-book-toc a{gap:.6rem}.reading-book-toc a small{font-size:.7rem}
 .reading-book-bottom{gap:.5rem;padding:.65rem}.reading-book-bottom [data-book-position]{order:3;flex-basis:100%;text-align:center}
}
@media print{.reader-site.is-reading-book .page-grid{display:none!important}.reader-site.is-reading-book:after{content:'هذا الكتاب متاح للقراءة داخل الموقع فقط.';display:block;text-align:center;font:20px Tahoma,sans-serif}}
@media print{.reader-site .reading-book-content[data-copy-allowed="false"]{display:none!important}}
