/* الأذكار — in the colours of the printed «حصن المسلم»: an orange cover with a green title, cream pages */
@font-face { font-family: "KFGQPC Hafs"; font-display: swap; src: url(../assets/qurancomplex/kfgqpc_hafs_v30.ttf) format("truetype"); }
:root {
  --orange: #ef6a1f; --orange-d: #c9521a; --orange-l: #fde6d6; --green: #17692f; --green-d: #0f4a22;
  --paper: #fbf3e6; --page: #fffaf2; --ink: #231b14; --muted: #786a59; --line: #ecdcc4; --src: #a3401b;
  --ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; --say: "Amiri", "Traditional Arabic", serif;
  --fs: 1.38rem; color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--ui); line-height: 1.7; padding-bottom: 40px; }
a { color: var(--green); }

/* the way back: home on the right, as everywhere on the site */
.top { max-width: 820px; margin: 0 auto; padding: 14px 16px 4px; display: flex; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; flex-wrap: wrap; }
.crumbs a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; padding: 4px 8px; border-radius: 10px; white-space: nowrap; }
.crumbs a:hover, .crumbs a:focus-visible { background: var(--orange-l); outline: none; }
.crumbs .home { padding-inline-start: 2px; }
.crumbs svg { width: 28px; height: 28px; flex: none; }
.crumbs .sep { color: var(--orange); }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.intro { text-align: center; padding: 18px 0 6px; }
.intro h1 { margin: 0; font-family: "Aref Ruqaa", var(--say); font-size: clamp(2.4rem, 8vw, 3.2rem); color: var(--green); line-height: 1.3; }
.intro p { margin: 4px 0 0; color: var(--muted); }
.now { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: .5rem 1.1rem; border-radius: 99px; background: var(--orange); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 6px 18px rgba(239, 106, 31, .3); }
.now:empty { display: none; }

.grpH { margin: 22px 0 10px; font-size: 1rem; color: var(--green-d); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tiles:not(.small) .tile b { font-size: 1.05rem; }
.tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: var(--page); border: 1px solid var(--line); transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(160, 80, 20, .12); outline: none; }
.tile .tt { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.tile i { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--orange-l); color: var(--orange-d); }
.tile i svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font-size: 1rem; }
.tile small { color: var(--muted); font-size: .8rem; }
.tile.done { border-color: #a9d3b5; }
.tile.done::after { content: "✓"; position: absolute; top: 10px; left: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-size: .8rem; font-weight: 700; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tiles.small .tile { padding: 10px 12px; gap: 10px; }
.tiles.small .tile i { width: 34px; height: 34px; flex: none; }
.tiles.small .tile small { display: none; }
.tiles.small .tile b { font-size: .9rem; line-height: 1.4; }
.ruqyahTile { display: flex; flex-direction: column; margin-top: 10px; padding: 14px 16px; border-radius: 18px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #17692f, #0f4a22); box-shadow: 0 10px 24px rgba(15, 74, 34, .2); }
.ruqyahTile b { font-size: 1.05rem; }
.ruqyahTile span { font-size: .85rem; opacity: .85; }

/* the book, as printed: orange cover, green calligraphy */
.bookBox { margin-top: 26px; display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; padding: 16px; border-radius: 22px; background: var(--page); border: 1px solid var(--line); }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; background: linear-gradient(90deg, #f37a32, var(--orange) 12%, #ee6418 88%, #d9561a);
  box-shadow: -6px 8px 18px rgba(120, 50, 10, .3), inset 8px 0 10px rgba(0, 0, 0, .12); display: flex; flex-direction: column; align-items: center; padding: 18% 8% 10%; text-align: center; overflow: hidden; }
.cover::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 9px; background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .08)); }
.cover .c1 { font-family: "Aref Ruqaa", var(--say); color: var(--green); font-size: 1.85rem; line-height: 1.15; text-shadow: 0 1px 0 rgba(255, 255, 255, .15); }
.cover .c2 { margin-top: 6px; font-family: "Aref Ruqaa", var(--say); color: #1f2a20; font-size: .82rem; }
.cover .c3 { margin-top: auto; color: #3a2510; font-size: .6rem; font-weight: 600; opacity: .85; }
.bookTxt h2 { margin: 0 0 4px; font-size: 1.1rem; color: var(--green-d); }
.bookTxt p { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.bookBtn { display: inline-flex; align-items: center; gap: 8px; padding: .6rem 1.2rem; border-radius: 12px; background: var(--orange); color: #fff; text-decoration: none; font-weight: 700; }
.bookBtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bookTxt small { display: block; margin-top: 6px; color: var(--muted); font-size: .76rem; }

/* a chapter, like a page of the book */
.rBar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.back { text-decoration: none; font-weight: 700; color: var(--orange-d); padding: 6px 10px; border-radius: 10px; }
.back:hover { background: var(--orange-l); }
.rTools { display: flex; gap: 4px; }
.rTools button { border: 1px solid var(--line); background: var(--page); border-radius: 10px; padding: 4px 10px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.pageHead { margin-top: 10px; padding: 16px 18px 12px; border-radius: 20px 20px 6px 6px; background: var(--orange); color: #fff; text-align: center; position: relative; overflow: hidden; }
.pageHead::after { content: ""; position: absolute; inset: 6px; border: 1.5px solid rgba(255, 255, 255, .35); border-radius: 15px 15px 3px 3px; pointer-events: none; }
.pageHead h1 { margin: 0; font-family: "Aref Ruqaa", var(--say); font-weight: 700; font-size: clamp(1.8rem, 6vw, 2.4rem); color: var(--green-d); line-height: 1.35; }
.pageHead p { margin: 2px 0 8px; font-size: .86rem; opacity: .95; }
.prog { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .35); overflow: hidden; margin: 0 8px; }
.prog i { display: block; height: 100%; width: 0; background: var(--green-d); transition: width .25s ease; }
.reader { display: flex; align-items: center; gap: 10px; margin: 12px 2px 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.reader select { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; }

.items { display: grid; gap: 12px; margin-top: 12px; }
.sub { margin: 10px 4px -2px; font-size: .95rem; color: var(--orange-d); font-weight: 700; }
.dk { position: relative; background: var(--page); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: border-color .2s ease, background-color .2s ease, opacity .3s ease; }
.dk:active { background: #fff3e6; }
.dk .say { margin: 0; font-family: var(--say); font-size: var(--fs); line-height: 2.05; text-align: justify; text-align-last: center; }
.dk .say small { font-size: .7em; color: var(--muted); font-family: var(--ui); }
.dk .say .add { color: #5d4b37; }
.dk .say .qv { color: var(--green-d); }
.dk .how { margin: 0 0 4px; color: var(--muted); font-size: .9rem; text-align: center; }
.dk .how + .say, .dk .say + .how { margin-top: 2px; }
.dk .qb { margin: 2px 0; font-family: "KFGQPC Hafs", var(--say); font-size: calc(var(--fs) * 1.08); line-height: 2.15; text-align: justify; text-align-last: center; }
.dk .qb .bs { display: block; text-align: center; }
.dk .qb .on { background: rgba(239, 106, 31, .16); border-radius: .3em; }
.num { display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; margin-inline: .1em .04em; vertical-align: -.15em; font-family: "Amiri", serif; color: #8c5a1e; line-height: 1;
  border: 1.5px solid #d39a5c; border-radius: 50%; background: #fff6ea; }
.num b { font-size: .52em; }
.dk .play { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--green); color: #fff; border-radius: 99px; padding: .3rem .85rem; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; margin: 4px auto 0; }
.dk .play svg { width: 14px; height: 14px; fill: currentColor; }
.dk .center { text-align: center; }
.dk .links { text-align: center; display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.dk .links a { font-size: .85rem; font-weight: 700; padding: .25rem .8rem; border-radius: 99px; background: var(--orange-l); color: var(--orange-d); text-decoration: none; }
.foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.meta { min-width: 0; }
.src { color: var(--src); font-weight: 700; font-size: .8rem; }
.fadl { margin: 2px 0 0; color: var(--green); font-size: .82rem; line-height: 1.7; }
.cnote, .when { display: block; color: var(--muted); font-size: .78rem; }
.cnt { flex: none; min-width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; font: inherit; cursor: pointer; display: grid; place-items: center; line-height: 1.05; padding: 0 6px;
  box-shadow: 0 6px 14px rgba(239, 106, 31, .3); transition: transform .08s ease; }
.cnt:active { transform: scale(.93); }
.cnt b { font-size: 1.3rem; }
.cnt span { font-size: .66rem; font-weight: 600; opacity: .9; }
.dk.done { border-color: #a9d3b5; background: #f3faf4; opacity: .72; }
.dk.done .cnt { background: var(--green); box-shadow: none; }
.doneBox { margin: 16px 0 0; padding: 16px; border-radius: 18px; text-align: center; background: #eaf6ee; border: 1px solid #a9d3b5; }
.doneBox b { display: block; color: var(--green-d); font-size: 1.05rem; }
.doneBox button { margin-top: 8px; border: 1px solid #a9d3b5; background: #fff; border-radius: 99px; padding: .35rem 1rem; font: inherit; font-weight: 600; color: var(--green-d); cursor: pointer; }
.credit { margin-top: 20px; text-align: center; color: var(--muted); font-size: .76rem; line-height: 1.9; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--green-d); color: #fff; border-radius: 99px; padding: .5rem 1.1rem; font-size: .9rem;
  transition: opacity .25s ease, transform .25s ease; pointer-events: none; max-width: calc(100vw - 24px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  :root { --fs: 1.28rem; }
  .bookBox { grid-template-columns: 110px 1fr; gap: 14px; padding: 12px; }
  .cover .c1 { font-size: 1.35rem; } .cover .c2 { font-size: .64rem; }
  .crumbs { font-size: .8rem; gap: 2px; } .crumbs a { padding: 4px 5px; } .crumbs svg { width: 24px; height: 24px; }
  .dk { padding: 12px 12px 8px; }
  .cnt { min-width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* the phone's own voice for the duas (labelled «صوت آلي»); the verses keep the human readers */
.spk { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; border: 1px solid var(--line); background: #fff; color: var(--green); border-radius: 99px; padding: .3rem .75rem; font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; }
.spk svg { width: 13px; height: 13px; fill: currentColor; }
.spk small { font-weight: 500; font-size: .66rem; color: var(--muted); display: inline; }
.spk.on { background: var(--green); color: #fff; border-color: var(--green); }
.spk.on small { color: #d8eadf; }
.meta .spk { display: inline-flex; }
.meta .spk[hidden] { display: none; }
.spkNote { font-family: var(--ui); margin: 6px 0 0; padding: 6px 10px; border-radius: 10px; background: #fff6e0; border: 1px solid #f1dca6; color: #6d4a07; font-size: .8rem; line-height: 1.8; }
