/* =====================================================================
   نور القرآن — media.css
   Lessons · Ibtihalat · Khutbahs · Books · Book reader (+ detail pages)
   ===================================================================== */

/* ---------- shared: layout helpers ---------- */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.m-grid.books { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 28px 22px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-family: var(--font-head); font-weight: 700; font-size: .85rem; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: all .25s var(--ease); }
.seg button.is-active { background: var(--primary); color: var(--on-primary); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.active-filters .chip i { font-size: .8rem; }
.result-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.m-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.m-section-title h2 { font-size: 1.45rem; margin: 0; }
.m-section-title .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
[dir="rtl"] .m-section-title .line { background: linear-gradient(-90deg, var(--border-strong), transparent); }
.m-empty { grid-column: 1 / -1; }

/* ---------- media shell (no file yet) ---------- */
.media-shell { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--nq-green-950); aspect-ratio: 16/9; box-shadow: var(--shadow-lg); isolation: isolate; color: #f2e9d2; }
.media-shell.is-audio { aspect-ratio: auto; min-height: 260px; }
.media-shell > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: saturate(.9); transform: scale(1.03); }
.media-shell::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 45%, rgba(4,26,20,.62), rgba(4,26,20,.9) 75%); }
.ms-overlay { position: absolute; inset: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; gap: 8px; }
.media-shell.is-audio .ms-overlay { position: relative; inset: auto; padding: 36px 20px 20px; }
.ms-icon { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; color: var(--nq-gold-300); background: rgba(4,26,20,.55); border: 1.5px solid rgba(230,207,156,.45); backdrop-filter: blur(8px); position: relative; }
.ms-icon::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px dashed rgba(230,207,156,.35); animation: nq-spin 24s linear infinite; }
.ms-overlay h2, .ms-overlay h3 { color: #fff3d6; font-size: clamp(1.1rem, 2.4vw, 1.45rem); margin: 10px 0 0; }
.ms-overlay p { color: rgba(242,233,210,.78); margin: 0; max-width: 460px; font-size: .95rem; }
.ms-bar { position: absolute; inset-inline: 0; bottom: 0; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: linear-gradient(180deg, transparent, rgba(4,26,20,.92)); }
.media-shell.is-audio .ms-bar { position: relative; background: rgba(4,26,20,.6); }
.ms-bar button { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(230,207,156,.18); color: rgba(242,233,210,.55); cursor: not-allowed; font-size: 1.2rem; }
.ms-track { flex: 1; height: 4px; border-radius: 4px; background: rgba(230,207,156,.18); }
.ms-time { font-size: .82rem; color: rgba(242,233,210,.65); direction: ltr; font-feature-settings: "tnum"; }
.ms-wave { display: flex; align-items: center; gap: 3px; height: 54px; justify-content: center; opacity: .55; }
.ms-wave span { width: 4px; border-radius: 3px; background: var(--nq-gold-400); }

/* ---------- detail pages ---------- */
.detail-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 12px; }
.meta-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: .93rem; margin-bottom: 18px; }
.meta-strip span, .meta-strip a { display: inline-flex; align-items: center; gap: 7px; }
.meta-strip i { color: var(--accent-strong); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 0; border-block: 1px solid var(--border); margin-bottom: 26px; }
.action-bar .fav-btn { width: 42px; height: 42px; }
.share-mini { display: inline-flex; gap: 6px; margin-inline-start: auto; }
.share-mini a, .share-mini button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); transition: all .25s var(--ease); cursor: pointer; }
.share-mini a:hover, .share-mini button:hover { background: var(--accent); color: var(--nq-green-950); border-color: var(--accent); }
.points-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: pt; }
.points-list li { counter-increment: pt; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: border-color .25s, transform .25s var(--ease); }
.points-list li:hover { border-color: var(--accent); transform: translateX(-3px); }
[dir="ltr"] .points-list li:hover { transform: translateX(3px); }
.points-list li::before { content: counter(pt); width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--font-head); font-weight: 800; font-size: .9rem; }
.side-card { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.side-card h3 { font-size: 1.05rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.side-card h3 i { color: var(--accent-strong); }
.info-table { width: 100%; font-size: .93rem; }
.info-table th { font-weight: 600; color: var(--muted); padding: 8px 0; font-family: var(--font-head); width: 42%; text-align: start; }
.info-table td { padding: 8px 0; color: var(--heading); font-weight: 600; }
.info-table tr + tr { border-top: 1px dashed var(--border-strong); }
.person-card { display: flex; gap: 14px; align-items: center; }
.person-card .avatar-ini { width: 62px; height: 62px; }
.mini-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border-strong); position: relative; color: var(--text); }
.mini-row:last-child { border-bottom: 0; }
.mini-row img { width: 74px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.mini-row b { display: block; font-family: var(--font-head); font-size: .92rem; color: var(--heading); line-height: 1.5; }
.mini-row small { color: var(--muted); font-size: .8rem; }
.mini-row a::after { content: ""; position: absolute; inset: 0; }
.mini-row:hover b { color: var(--accent-strong); }
.not-found-box { text-align: center; padding: 60px 20px; }
.not-found-box i { font-size: 3rem; color: var(--accent); }

/* ---------- lessons: spotlight ---------- */
.spotlight { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-top: -70px; position: relative; z-index: 3; }
@media (max-width: 991.98px) { .spotlight { grid-template-columns: minmax(0, 1fr); margin-top: -50px; } }
.spot-main { position: relative; min-height: 380px; border-radius: var(--radius-lg); overflow: hidden; color: #fff; isolation: isolate; box-shadow: var(--shadow-lg); display: flex; align-items: flex-end; }
.spot-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: opacity .6s var(--ease), transform 6s linear; }
.spot-main.is-changing img { opacity: .2; }
.spot-main:hover img { transform: scale(1.04); }
.spot-main::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(4,26,20,.05) 15%, rgba(4,26,20,.93) 100%); }
.spot-body { padding: clamp(22px, 3vw, 34px); width: 100%; transition: opacity .4s, transform .4s var(--ease); }
.spot-main.is-changing .spot-body { opacity: 0; transform: translateY(10px); }
.spot-body h2 { color: #fff6dc; font-size: clamp(1.4rem, 2.8vw, 2rem); margin: 10px 0 8px; }
.spot-body h2 a { color: inherit; }
.spot-body p { color: rgba(244,234,210,.82); max-width: 600px; margin-bottom: 16px; }
.spot-body .card-meta { color: rgba(244,234,210,.75); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; }
.spot-body .card-meta i { color: var(--nq-gold-300); margin-inline-end: 4px; }
.spot-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.spot-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; border: 0; background: none; text-align: start; width: 100%; cursor: pointer; color: var(--text); position: relative; transition: background .25s; }
.spot-item:hover { background: var(--surface-2); }
.spot-item.is-active { background: var(--accent-soft); }
.spot-item img { width: 86px; height: 60px; border-radius: 10px; object-fit: cover; flex: none; }
.spot-item b { font-family: var(--font-head); font-size: .93rem; color: var(--heading); display: block; line-height: 1.5; }
.spot-item small { color: var(--muted); font-size: .8rem; }
.spot-item .sp-bar { position: absolute; inset-inline: 10px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; opacity: 0; }
.spot-item.is-active .sp-bar { opacity: 1; }
.spot-item.is-active .sp-bar span { display: block; height: 100%; width: 0; background: var(--accent); animation: dotFill 6s linear forwards; }
.spotlight.is-paused .spot-item.is-active .sp-bar span { animation-play-state: paused; }

/* ---------- nasheed library ---------- */
.np-hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); padding: clamp(22px, 3vw, 36px); margin-top: -70px; position: relative; z-index: 3; }
@media (max-width: 991.98px) { .np-hero { grid-template-columns: minmax(0, 1fr); margin-top: -50px; } }
.np-cover { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-cover .np-stack { position: absolute; inset: auto 12px 12px; display: flex; gap: 6px; }
.np-track { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; transition: background .2s; position: relative; }
.np-track:hover { background: rgba(255,255,255,.06); }
.np-track .np-n { width: 26px; text-align: center; color: rgba(237,228,204,.55); font-family: var(--font-head); font-weight: 700; font-size: .9rem; }
.np-track img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }
.np-track .np-t { min-width: 0; flex: 1; }
.np-track .np-t a { color: #fbf0d4; font-family: var(--font-head); font-weight: 700; font-size: .96rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-track .np-t small { color: rgba(237,228,204,.6); }
.np-track .np-d { color: rgba(237,228,204,.6); font-size: .85rem; direction: ltr; }
.np-track .nr-play { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(230,207,156,.35); background: none; color: var(--nq-gold-300); display: grid; place-items: center; cursor: pointer; flex: none; transition: all .25s; }
.np-track .nr-play:hover { background: var(--nq-gold-400); color: var(--nq-green-950); }
.playlist-card { position: relative; display: block; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: all .35s var(--ease); height: 100%; }
.playlist-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent); color: var(--text); }
.pl-stack { position: relative; aspect-ratio: 1.3; margin-bottom: 14px; }
.pl-stack img { position: absolute; width: 70%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow); border: 3px solid var(--surface); transition: transform .45s var(--ease); }
.pl-stack img:nth-child(1) { inset-inline-start: 0; top: 10%; transform: rotate(-6deg); }
.pl-stack img:nth-child(2) { inset-inline-start: 15%; top: 5%; transform: rotate(0deg); z-index: 1; }
.pl-stack img:nth-child(3) { inset-inline-start: 30%; top: 0; transform: rotate(6deg); z-index: 2; }
.playlist-card:hover .pl-stack img:nth-child(1) { transform: rotate(-10deg) translateX(6px); }
.playlist-card:hover .pl-stack img:nth-child(3) { transform: rotate(10deg) translateX(-6px); }
.playlist-card h3 { font-size: 1.05rem; margin: 0 0 4px; }
.playlist-card small { color: var(--muted); }
.rank-list .rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px dashed var(--border-strong); position: relative; }
.rank-list .rank-row:last-child { border-bottom: 0; }
.rank-row .rk { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; width: 34px; text-align: center; color: transparent; -webkit-text-stroke: 1.4px var(--accent); }
.rank-row img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.rank-row .rk-t { flex: 1; min-width: 0; }
.rank-row .rk-t a { font-family: var(--font-head); font-weight: 700; color: var(--heading); }
.rank-row .rk-t small { display: block; color: var(--muted); }
.rank-row .rk-bar { width: 90px; }
@media (max-width: 1399.98px) { .rank-row .rk-bar { display: none; } }

/* ---------- ibtihal details ---------- */
.vinyl-wrap { position: relative; max-width: 420px; margin-inline: auto; }
.vinyl-wrap .vw-cover { position: relative; z-index: 2; aspect-ratio: 1; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 70px -25px rgba(0,0,0,.6); }
.vinyl-wrap .vw-cover img { width: 100%; height: 100%; object-fit: cover; }
.vinyl-wrap .vw-disc { position: absolute; top: 6%; inset-inline-end: -18%; width: 88%; aspect-ratio: 1; border-radius: 50%; z-index: 1; background: repeating-radial-gradient(circle, #10221b 0 2px, #0b1813 2px 4px); box-shadow: 0 20px 40px -14px rgba(0,0,0,.6); animation: nq-spin 12s linear infinite; }
.vinyl-wrap .vw-disc::after { content: ""; position: absolute; inset: 36%; border-radius: 50%; background: radial-gradient(circle, #0b1813 0 12%, var(--nq-gold-400) 13% 100%); }
@media (max-width: 575.98px) { .vinyl-wrap { max-width: 250px; } .vinyl-wrap .vw-disc { inset-inline-end: -8%; } }
.notes-box { padding: 24px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }

/* ---------- khutbah library ---------- */
.kh-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 991.98px) { .kh-layout { grid-template-columns: minmax(0, 1fr); } }
.kh-layout > * { min-width: 0; }
.kh-side { position: sticky; top: calc(var(--header-h-compact) + 20px); }
@media (max-width: 991.98px) { .kh-side { position: static; } }
.cat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.cat-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 0; background: none; text-align: start; color: var(--text-2); font-family: var(--font-head); font-weight: 600; font-size: .93rem; cursor: pointer; transition: all .2s; }
.cat-list button i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.cat-list button .cnt { margin-inline-start: auto; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.cat-list button:hover { background: var(--surface-2); color: var(--heading); }
.cat-list button.is-active { background: var(--primary); color: var(--on-primary); }
.cat-list button.is-active i { background: rgba(255,255,255,.15); color: var(--nq-gold-300); }
.cat-list button.is-active .cnt { background: rgba(255,255,255,.18); color: var(--on-primary); }
@media (max-width: 991.98px) { .cat-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 6px; } .cat-list button { white-space: nowrap; } }
.kh-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); position: relative; transition: all .3s var(--ease); }
.kh-row:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }
.kh-row .kr-img { position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; }
.kh-row .kr-img img { width: 100%; height: 100%; object-fit: cover; }
.kh-row h3 { font-size: 1.08rem; margin: 6px 0; }
.kh-row h3 a { color: var(--heading); }
.kh-row h3 a::after { content: ""; position: absolute; inset: 0; }
.kh-row .card-actions, .kh-row .fav-btn { position: relative; z-index: 2; }
.kh-date { text-align: center; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-head); min-width: 76px; }
.kh-date b { display: block; font-size: 1.5rem; color: var(--accent-strong); line-height: 1.1; }
.kh-date small { color: var(--muted); font-size: .75rem; }
@media (max-width: 767.98px) { .kh-row { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px; } .kh-row h3 { font-size: .98rem; } .kh-row .kh-date { display: none; } }
.outline-tl { list-style: none; padding: 0; margin: 0; position: relative; }
.outline-tl::before { content: ""; position: absolute; top: 10px; bottom: 10px; inset-inline-start: 19px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--border)); }
.outline-tl li { position: relative; padding-inline-start: 56px; padding-block: 10px 18px; }
.outline-tl li span.n { position: absolute; inset-inline-start: 0; top: 6px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--accent); color: var(--accent-strong); font-family: var(--font-head); font-weight: 800; }
.outline-tl li h3 { font-size: 1.08rem; margin: 6px 0 0; }

/* ---------- books ---------- */
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 170px); gap: 26px; overflow-x: auto; padding: 8px 6px 26px; scrollbar-width: thin; align-items: end; }
.shelf-row .book-card .book-info { display: none; }
.shelf-row .book-card { gap: 0; }
.shelf-sec { margin-bottom: 44px; }
.cat-pill-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-size: 1.2rem; flex: none; }
.top-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.top-book { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); position: relative; transition: all .3s var(--ease); }
.top-book:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.top-book .book-cover { width: 74px; flex: none; padding: 10% 8%; gap: 4px; }
.top-book .book-cover .bc-title { font-size: .68rem; }
.top-book .book-cover .bc-author, .top-book .book-cover .bc-orn { display: none; }
.top-book .rk { font-family: var(--font-head); font-weight: 800; font-size: 1.8rem; color: transparent; -webkit-text-stroke: 1.4px var(--accent); }
.top-book h3 { font-size: 1rem; margin: 0 0 3px; }
.top-book h3 a { color: var(--heading); }
.top-book h3 a::after { content: ""; position: absolute; inset: 0; }
.top-book small { color: var(--muted); }
.book-hero { padding: clamp(24px, 4vw, 48px); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); margin-top: -80px; position: relative; z-index: 3; }
.book-hero .bh-cover { max-width: 300px; margin-inline: auto; perspective: 1000px; }
.book-hero .bh-cover .book-cover { transform: rotateY(-12deg); box-shadow: inset -3px 0 6px rgba(0,0,0,.25), 24px 26px 40px -16px rgba(0,0,0,.5); animation: bookFloat 6s ease-in-out infinite; }
[dir="ltr"] .book-hero .bh-cover .book-cover { transform: rotateY(12deg); }
@keyframes bookFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.dl-note { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; color: var(--muted); margin-top: 10px; }
.btn-nq[disabled], .btn-nq.is-disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- book reader ---------- */
.reader-page { padding-top: calc(var(--header-h) + 24px); }
.reader-wrap { min-width: 0; --r-bg: #fffdf8; --r-text: #1e2b26; --r-muted: #6c7a72; --r-border: rgba(120,96,50,.18); --r-accent: #a8823a; --r-size: 1.25rem;
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.reader-wrap[data-rtheme="sepia"] { --r-bg: #f4ead3; --r-text: #3b2c17; --r-muted: #7a6748; --r-border: rgba(110,80,30,.22); --r-accent: #8f6c2c; }
.reader-wrap[data-rtheme="dark"] { --r-bg: #0d1a15; --r-text: #e9e1cd; --r-muted: #93a39a; --r-border: rgba(214,184,120,.14); --r-accent: #d6b878; }
[data-theme="dark"] .reader-wrap[data-rtheme="light"] { --r-bg: #13241d; --r-text: #ece5d5; --r-muted: #93a39a; --r-border: rgba(214,184,120,.14); --r-accent: #d6b878; }
@media (max-width: 991.98px) { .reader-wrap { grid-template-columns: minmax(0, 1fr); } .reader-toc { display: none; } }
.reader-toc { position: sticky; top: calc(var(--header-h-compact) + 20px); }
.toc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.toc-list button { width: 100%; text-align: start; border: 0; background: none; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-family: var(--font-head); font-weight: 600; font-size: .92rem; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.toc-list button:hover { background: var(--surface-2); }
.toc-list button.is-active { background: var(--accent-soft); color: var(--heading); }
.toc-list button .tn { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; flex: none; }
.reader-bar { position: sticky; top: calc(var(--header-h-compact) + 8px); z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
@media (max-width: 1199.98px) { .reader-bar { top: 80px; } }
.reader-bar .rb-title { font-family: var(--font-head); font-weight: 700; color: var(--heading); font-size: .95rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar .rb-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rtheme { display: inline-flex; gap: 4px; }
.rtheme button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; }
.rtheme button.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.reader-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 1100; background: transparent; }
.reader-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--nq-gold-500), var(--nq-gold-300)); }
.reader-paper { background: var(--r-bg); color: var(--r-text); border: 1px solid var(--r-border); border-radius: var(--radius-lg); padding: clamp(26px, 5vw, 64px); box-shadow: var(--shadow); font-size: var(--r-size); line-height: 2.1; transition: background-color .4s, color .4s; }
html[lang="en"] .reader-paper { line-height: 1.9; }
.reader-paper h2 { color: var(--r-text); font-size: 1.5em; margin: 0 0 .6em; }
.reader-paper .r-chapter { padding-bottom: 2em; margin-bottom: 2em; border-bottom: 1px solid var(--r-border); scroll-margin-top: calc(var(--header-h-compact) + 90px); }
.reader-paper .r-chapter:last-child { border-bottom: 0; margin-bottom: 0; }
.reader-paper .r-eyebrow { color: var(--r-accent); font-family: var(--font-head); font-weight: 700; font-size: .7em; letter-spacing: .04em; }
.reader-paper .r-hadith { font-family: var(--font-display); font-size: 1.22em; line-height: 2.2; text-align: center; padding: 1em 1.2em; margin: .6em 0 1em; border-radius: 16px; background: color-mix(in srgb, var(--r-bg) 85%, var(--r-accent)); border-inline-start: 4px solid var(--r-accent); direction: rtl; color: var(--r-text); }
.reader-paper .r-src { display: block; text-align: center; color: var(--r-accent); font-family: var(--font-head); font-weight: 700; font-size: .72em; margin-top: -.4em; margin-bottom: 1.2em; }
.reader-paper .r-note { font-size: .86em; color: var(--r-text); padding: 1em 1.2em; border-radius: 14px; border: 1px dashed var(--r-border); }
.reader-paper .r-note b { color: var(--r-accent); font-family: var(--font-head); display: block; font-size: .85em; margin-bottom: .3em; }
.reader-paper .r-muted { color: var(--r-muted); }
.reader-wrap.is-fs { position: fixed; inset: 0; z-index: 3000; background: var(--bg); overflow-y: auto; padding: 20px; display: block; }
.reader-wrap.is-fs .reader-toc { display: none; }
.reader-wrap.is-fs .reader-bar { top: 0; }
.reader-wrap.is-fs .reader-main { max-width: 860px; margin-inline: auto; }
.soon-state { text-align: center; padding: 2em 1em; border-radius: 18px; border: 1.5px dashed var(--r-border); margin-top: 1.5em; }
.soon-state i { font-size: 2.2em; color: var(--r-accent); }

/* ---------- print (khutbah / lesson notes) ---------- */
@media print {
  .site-header, .site-footer, .mini-player, .to-top, .toast-stack, .nq-loader, .action-bar, .media-shell, .no-print, .page-hero .ph-ornament, .offcanvas, .search-overlay { display: none !important; }
  .page-hero { padding: 20px 0 !important; background: none !important; color: #000 !important; }
  .page-hero h1, .page-hero .ph-sub, .breadcrumb-nq li, .breadcrumb-nq a { color: #000 !important; }
  .page-hero::after { display: none; }
  body { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .col-lg-4.aside-col { display: none !important; }
  .col-lg-8 { width: 100% !important; }
}

.min-w-0 { min-width: 0; }
.flex-none { flex: none; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); gap: 12px 48px; }
.shelf-grid .shelf-sec { margin-bottom: 26px; }
.shelf-grid .shelf-row { grid-auto-columns: minmax(118px, 136px); gap: 20px; padding-bottom: 20px; }
.shelf-grid .m-section-title { margin-bottom: 12px; }
.book-hero { margin-top: -36px; }
@media (max-width: 767.98px) { .book-hero .bh-cover { max-width: 210px; } .book-hero { padding: 22px 18px; } }
