@font-face { font-family: 'Naskh'; src: url('/fonts/NotoNaskhArabic-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Naskh'; src: url('/fonts/NotoNaskhArabic-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Kufi'; src: url('/fonts/NotoKufiArabic-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
:root { --ink: #0f172a; --ink2: #475569; --line: #e2e8f0; --bg: #f4f6fb; --sand: #e8ecf5; --brand: #4f46e5; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Naskh', 'Noto Naskh Arabic', 'Geeza Pro', serif; font-size: 17px; line-height: 1.9; }
h1, h2, p, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
.top { border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; justify-content: center; min-height: 52px; font-family: 'Kufi', 'Naskh', serif; font-weight: 700; font-size: 20px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px 24px; }
.foot { text-align: center; color: var(--ink2); font-size: 15px; padding: 18px 20px 32px; border-top: 1px solid var(--line); }
.hero { padding: 26px 0 14px; text-align: center; }
.name { font-family: 'Kufi', 'Naskh', serif; font-weight: 700; font-size: 40px; line-height: 1.5; }
.line { color: var(--ink2); max-width: 30em; margin: 0 auto; font-size: 16px; }
.tools { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 4px; }
.search { width: 100%; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.search:focus-visible, .btn:focus-visible, .chip:focus-visible, .jumpsel:focus-visible, .pagebtn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.count { color: var(--ink2); font-size: 14px; }
.shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 16px; padding: 14px 0 24px; }
.tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile[hidden] { display: none; }
.cover { display: block; width: 100%; height: auto; aspect-ratio: 595 / 842; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 18px rgba(15,23,42,.28); background: var(--accent, #444); margin-bottom: 8px; }
.cover-big { max-width: 300px; margin: 6px auto 18px; }
.tile-title { font-family: 'Kufi', 'Naskh', serif; font-weight: 700; font-size: 15px; line-height: 1.7; }
.tile-meta { color: var(--ink2); font-size: 14px; line-height: 1.6; }
.tile-genre { color: var(--accent); font-size: 13px; font-weight: 700; line-height: 1.6; }
.tile-stats { display: block; font-size: 12px; color: var(--ink2); margin-top: 2px; min-height: 14px; }
.tile-stats:empty { visibility: hidden; }
.hk-stats { display: block; font-size: 13px; color: var(--ink2); margin: 2px 0 6px; min-height: 15px; }
.hk-stats:empty { visibility: hidden; }

.empty { text-align: center; padding: 32px 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty[hidden] { display: none; }
.title { font-family: 'Kufi', 'Naskh', serif; font-weight: 700; font-size: 28px; line-height: 1.6; text-align: center; }
.sub { color: var(--accent); font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 10px; }
.facts { display: flex; flex-direction: column; margin: 6px 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink2); }
.facts dd { font-weight: 700; text-align: start; }
.h2 { font-family: 'Kufi', 'Naskh', serif; font-size: 18px; font-weight: 700; margin-top: 18px; }
.blurb { font-size: 17px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 6px; border: 1.5px solid var(--accent, var(--ink)); color: var(--accent, var(--ink)); font: inherit; font-weight: 700; font-size: 16px; line-height: 1; background: transparent; cursor: pointer; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-main { background: var(--accent, var(--ink)); color: #fff; }
.book { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink2); font-size: 15px; }
.others { display: flex; flex-direction: column; }
.other { display: flex; align-items: center; gap: 14px; padding: 8px 0; min-height: 44px; }
.other img { width: 52px; height: 74px; object-fit: cover; border-radius: 4px; }
.other span { display: flex; flex-direction: column; line-height: 1.5; }
.other em { font-style: normal; color: var(--ink2); font-size: 14px; }
.reader { max-width: 760px; margin: 0 auto; }
.readbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.readtitle { font-family: 'Kufi', 'Naskh', serif; font-weight: 700; font-size: 15px; text-align: end; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 6px 0; }
.counter { font-weight: 700; font-size: 16px; min-width: 76px; text-align: center; }
.pagefig { margin: 10px 0; }
.pagebtn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--sand); cursor: zoom-in; }
.pageimg { display: block; width: 100%; height: auto; aspect-ratio: 595 / 842; }
.readtools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.jump { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.jumpsel { min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.dl { text-align: center; margin-top: 8px; font-size: 15px; }
.dl a { text-decoration: underline; display: inline-flex; min-height: 44px; align-items: center; }
.zoom { position: fixed; inset: 0; z-index: 10; background: #0b1020; display: flex; flex-direction: column; }
.zoom[hidden] { display: none; }
.zoombar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; color: #fff; }
.zoombar .btn { color: #fff; border-color: #fff; min-height: 44px; }
.zscroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; text-align: center; touch-action: pan-x pan-y pinch-zoom; }
.zimg { width: 100%; height: auto; background: #fff; display: block; margin: 0 auto; }
.zoom.big .zimg { width: 220%; max-width: none; }
@media (min-width: 768px) {
  .name { font-size: 54px; }
  .shelf { grid-template-columns: repeat(4, 1fr); gap: 28px 22px; }
  .tile-title { font-size: 16px; }
  .actions { flex-direction: row; }
  .actions .btn { flex: 1; }
}

/* modern palette */
.top { background: #0f172a; border-bottom: 0; }
.brand { color: #fff; }
.hero { background: linear-gradient(160deg, #eef0ff 0%, #f4f6fb 70%); margin: 0 -20px; padding: 30px 20px 18px; border-radius: 0 0 24px 24px; }
.name { color: #1e1b4b; }
.search { border-radius: 14px; border-color: #cbd5e1; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.search:focus { border-color: var(--brand); }
.chip { background: #fff; border-color: #cbd5e1; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.cover { border-radius: 14px; }
.tile { background: #fff; border-radius: 18px; padding: 10px 10px 12px; box-shadow: 0 2px 10px rgba(15,23,42,.07); }
.tile .cover { box-shadow: 0 4px 12px rgba(15,23,42,.2); }
.btn { border-radius: 14px; }
.btn-main { box-shadow: 0 4px 12px rgba(15,23,42,.18); }
.pagebtn { border-radius: 12px; overflow: hidden; background: #fff; }
.foot { background: #0f172a; color: #cbd5e1; border-top: 0; }
.facts > div { border-color: var(--line); }

.stats { display: flex; gap: 10px; padding: 4px 0 14px; }
.stat { flex: 1; background: #fff; border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: 0 2px 10px rgba(15,23,42,.07); display: flex; flex-direction: column; line-height: 1.5; }
.stat[hidden] { display: none; }
.stat b { font-family: 'Kufi', 'Naskh', serif; font-size: 24px; color: var(--brand); }
.stat span { font-size: 14px; color: var(--ink2); }
.contact { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 14px 0 24px; text-align: center; }
.ctext { color: var(--ink2); }
.cbox { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 2px 10px rgba(15,23,42,.07); display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.clabel { color: var(--ink2); font-size: 15px; }
.cval { font-weight: 700; font-size: 18px; word-break: break-all; }
.foot a { text-decoration: underline; }

.top { position: relative; }
.hlink { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: #e2e8f0; font-size: 14px; line-height: 1; padding: 9px 12px; border: 1px solid #475569; border-radius: 999px; font-family: 'Kufi', 'Naskh', serif; font-weight: 700; }
.foot div{line-height:1.9}.foot div:first-child{color:#fff;font-weight:700;font-size:16px}.foot2{font-size:14px;opacity:.85}
.bookstats{padding:14px 0 4px}.bookstats .stat b{font-size:28px}
.brand .logo { width: 30px; height: 30px; margin-inline-end: 10px; border-radius: 8px; flex: none; }
.flogo { display: block; margin: 0 auto 8px; border-radius: 8px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; }
.top .brand { justify-content: flex-start; min-width: 0; white-space: nowrap; }
.top .hlink { position: static; transform: none; inset: auto; flex: none; margin: 0; }
.ilogo { display: inline-block; vertical-align: middle; margin-inline-end: 8px; border-radius: 22%; position: relative; top: -.08em; }
.hero .name .ilogo { margin-inline-end: 12px; }
.back { display: inline-flex; align-items: center; }
.fbrand { display: flex; align-items: center; justify-content: center; font-family: 'Kufi', 'Naskh', serif; font-weight: 700; font-size: 17px; color: #fff; margin-bottom: 6px; }
.foot .ilogo { top: 0; }
.btn .ilogo { margin-inline-end: 8px; }
.emblem { display: block; width: 168px; height: 168px; margin: 2px auto 10px; border-radius: 50%; box-shadow: 0 0 0 5px #fff, 0 10px 28px rgba(15,23,42,.22); }
@media (min-width: 700px) { .emblem { width: 200px; height: 200px; } }
.previewnote { background: #fef3c7; color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: 14px; text-align: center; margin: 4px 0 10px; }
.pricecard { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 16px; padding: 16px 18px; margin: 12px 0; box-shadow: 0 2px 10px rgba(15,23,42,.07); }
.pricecard span { color: var(--ink2); }
.pricecard strong { font-family: 'Kufi', 'Naskh', serif; font-size: 22px; color: var(--accent, var(--brand)); }
.ph { background: #fef3c7; color: #92400e; border: 1px dashed #d97706; border-radius: 8px; padding: 2px 8px; font-size: .92em; font-weight: 700; }
.ph-btn { opacity: .55; cursor: not-allowed; }
.phnote { text-align: center; margin: 4px 0 10px; font-size: 14px; }
.gets, .steps { padding-inline-start: 22px; line-height: 2; margin: 6px 0 14px; }
.steps li::marker { font-weight: 700; color: var(--accent, var(--brand)); }
.num { letter-spacing: .5px; }

.hnav{display:flex;align-items:center;gap:6px;flex:none}
.hnav .hlink{padding:8px 10px;font-size:13px;white-space:nowrap}
.hlink-tg{background:#229ed9;border-color:#229ed9!important;color:#fff!important}
.top{flex-wrap:wrap;row-gap:8px;padding-top:6px;padding-bottom:6px}
.foot3{margin-top:4px;font-size:15px}.foot3 a{color:#7dd3fc;font-weight:700}

.hlink-sub{background:#4f46e5;border-color:#4f46e5!important;color:#fff!important}
.subline{text-align:center;margin:0 0 10px;font-size:16px}.subline a{display:inline-block;background:#eef2ff;color:#3730a3;border:1px solid #c7d2fe;border-radius:999px;padding:8px 16px;font-weight:700}
.foot3 .fsub{color:#c7d2fe}

.diff{background:#eef2ff;border:1px solid #c7d2fe;border-radius:10px;padding:10px 14px;margin:10px 0;font-size:15px;line-height:1.8}.diff a{text-decoration:underline;font-weight:700}

.hlink-hk{background:#c2410c;border-color:#c2410c!important;color:#fff!important}
.hkpromo{text-align:center;margin:0 0 12px;font-size:16px}.hkpromo a{display:inline-block;background:#fff1e6;color:#9a3412;border:1px solid #fdba74;border-radius:999px;padding:8px 16px;font-weight:700}

/* nav wraps instead of clipping when there are many links */
.hnav{flex-wrap:wrap;justify-content:flex-end;row-gap:6px}

/* site header menu (owner-approved) */
.pm-wrap{position:relative}
.pm-btn{cursor:pointer;display:inline-flex;align-items:center;gap:6px;background:transparent;-webkit-appearance:none;appearance:none}
.pm-caret{font-size:11px;line-height:1;opacity:.85}
.pm-panel{position:absolute;inset-inline-end:0;top:calc(100% + 10px);min-width:230px;background:#fff;border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 18px 44px rgba(15,23,42,.22);padding:8px;display:flex;flex-direction:column;gap:2px;z-index:80}
.pm-panel a{display:block;padding:13px 15px;border-radius:12px;color:#0f172a;font-size:16px;font-weight:700;text-decoration:none;font-family:'Kufi','Naskh',serif}
.pm-panel a:hover,.pm-panel a:focus-visible{background:#eef2ff;color:#3730a3}
.pm-panel[hidden]{display:none}
@media (max-width:640px){.pm-panel{position:fixed;inset-inline:12px;left:12px;right:12px;min-width:0;top:70px}.pm-home,.pm-btn{padding:8px 10px;font-size:13px}}

.ctab { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(15,23,42,.07); margin: 0 0 18px; }
.ctab th, .ctab td { padding: 11px 14px; text-align: right; border-bottom: 1px solid #eef1f7; font-size: 15px; }
.ctab th { background: #f7f9fd; color: var(--ink2); font-weight: 700; }
.ctab tr:last-child td { border-bottom: 0; }
.ctab a { color: var(--brand); text-decoration: none; font-weight: 700; }
.cs { color: var(--ink2); }
.cs:empty { visibility: hidden; }
