/* isnady.net — one stylesheet; light and dark */
:root {
  --bg: #f7f5ef; --panel: #ffffff; --ink: #1c2421; --muted: #66716c; --line: #e4e0d4;
  --brand: #0f766e; --brand2: #065f46; --gold: #b7892f; --gold-soft: #f5ecd6;
  --good: #15803d; --fair: #b45309; --weak: #b91c1c; --mark: #fde68a;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 6px 18px rgba(20, 30, 25, .06);
  --radius: 14px;
  --ar: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --panel: #161e1b; --ink: #e6ece9; --muted: #93a19b; --line: #26312d;
    --brand: #34d399; --brand2: #10b981; --gold: #e0b862; --gold-soft: #2a2416; --mark: #6b5414;
    --good: #4ade80; --fair: #fbbf24; --weak: #f87171; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --panel: #161e1b; --ink: #e6ece9; --muted: #93a19b; --line: #26312d;
  --brand: #34d399; --brand2: #10b981; --gold: #e0b862; --gold-soft: #2a2416; --mark: #6b5414;
  --good: #4ade80; --fair: #fbbf24; --weak: #f87171; --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--ui); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.ar, [dir="rtl"] { font-family: var(--ar); }
.ar { font-size: 1.15em; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 18px 0 10px; }
h1.ar { font-size: 2.1rem; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
       backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--gold-soft); text-decoration: none; }
.nav a.on { background: var(--brand); color: var(--bg); }
.tools { display: flex; align-items: center; gap: 8px; }
.flags a { font-size: 20px; padding: 2px 4px; border-radius: 6px; opacity: .55; }
.flags a.on, .flags a:hover { opacity: 1; text-decoration: none; }
.theme { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px;
         width: 34px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

/* hero */
.hero { text-align: center; padding: 36px 0 12px; }
.hero h1 { font-size: 2.6rem; margin: 0; letter-spacing: -.5px; }
.hero h1 .ar { font-size: 1.15em; color: var(--gold); margin-inline-end: 10px; }
.tagline { color: var(--muted); font-size: 1.1rem; margin: 8px 0 22px; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 22px 0 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px;
        min-width: 130px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; color: var(--brand); }
.stat span { color: var(--muted); font-size: .9rem; }

/* search */
.search { max-width: 760px; margin: 0 auto 10px; }
.search .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search input[type="search"] { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: 12px 16px;
       border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
.search.big input[type="search"] { font-size: 1.2rem; padding: 15px 20px; }
.search button, .button { font: inherit; font-weight: 600; padding: 11px 22px; border: 0; border-radius: 999px;
       background: var(--brand); color: #fff; cursor: pointer; display: inline-block; }
.button:hover { text-decoration: none; background: var(--brand2); }
.search .opts { margin-top: 10px; justify-content: center; gap: 16px; }
.search select { font: inherit; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line);
       background: var(--panel); color: var(--ink); max-width: 100%; }
.hint { color: var(--muted); font-size: .85rem; text-align: center; margin: 8px 0 0; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
        margin: 16px 0; box-shadow: var(--shadow); }
.lead { font-size: 1.05rem; margin-top: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.feature { background: var(--bg); border-radius: 12px; padding: 14px; }
.feature .ico { font-size: 1.5rem; }
.feature p { margin: 6px 0 0; }
.installs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.installs h3 { margin: 0 0 6px; color: var(--ink); }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; }
.note { color: var(--muted); text-align: center; font-size: .92rem; margin: 18px 0; }
.crumbs { margin: 16px 0 0; color: var(--muted); font-size: .92rem; }

/* books */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 22px; }
.book { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line);
        border-inline-start: 4px solid var(--brand); border-radius: 12px; padding: 14px; color: var(--ink); box-shadow: var(--shadow); }
.book.shia { border-inline-start-color: var(--gold); }
.book:hover { text-decoration: none; transform: translateY(-1px); }
.book span { color: var(--muted); font-size: .9rem; }
.sections { display: flex; flex-direction: column; gap: 6px; }
.section { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line);
           border-radius: 10px; padding: 10px 14px; color: var(--ink); }
.section:hover { text-decoration: none; border-color: var(--brand); }
.section .num { color: var(--gold); font-weight: 700; min-width: 2.4em; }
.section .t { flex: 1; display: flex; flex-direction: column; }
.section .t .ar { color: var(--muted); font-size: 1rem; }
.section .cnt, .nlist .cnt { color: var(--muted); font-size: .85rem; }
.ar.big { font-size: 1.4rem; color: var(--muted); margin: 0 0 10px; }

/* hadith lists */
.hlist, .plist { display: flex; flex-direction: column; gap: 8px; }
.hitem, .pitem { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line);
         border-radius: 12px; padding: 12px 16px; color: var(--ink); }
.hitem:hover, .pitem:hover { text-decoration: none; border-color: var(--brand); }
.hitem .num { color: var(--gold); font-weight: 600; font-size: .9rem; }
.hitem .txt { font-size: 1.05rem; line-height: 1.9; }
.hitem .txt[dir="rtl"], .text.ar p { font-family: var(--ar); font-size: 1.3rem; line-height: 2.1; }
.pitem .ar { font-size: 1.25rem; }
.pitem .meta { color: var(--muted); font-size: .88rem; }
.pitem.shia { border-inline-start: 3px solid var(--gold); }
.pitem.sunni { border-inline-start: 3px solid var(--brand); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.count { color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0; }

/* a hadith */
.text { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 12px 0; box-shadow: var(--shadow); }
.text .lang { color: var(--muted); font-size: .8rem; font-family: var(--ui); letter-spacing: .02em; font-weight: 600; }
.text p { margin: 6px 0 0; font-size: 1.05rem; line-height: 1.8; }
.others summary { cursor: pointer; color: var(--brand); font-weight: 600; margin: 8px 0; }
.grades { margin: 0; padding-inline-start: 18px; }
.chain { list-style: none; padding: 0; margin: 0; position: relative; }
.chain li { position: relative; padding: 10px 14px; margin: 0 26px 8px 0; background: var(--bg); border-radius: 12px;
            display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.chain li::before { content: ""; position: absolute; right: -18px; top: 18px; width: 10px; height: 10px; border-radius: 50%;
            background: var(--brand); box-shadow: 0 0 0 3px var(--panel); }
.chain li:not(:last-child)::after { content: ""; position: absolute; right: -14px; top: 30px; bottom: -20px; width: 2px; background: var(--line); }
.chain .word { color: var(--gold); font-size: 1.1rem; min-width: 3em; }
.chain .who { font-size: 1.25rem; font-weight: 700; }
.chain .who.none { color: var(--muted); font-weight: 400; }
.chain .full { flex-basis: 100%; color: var(--muted); font-size: 1rem; }
.chain .end { background: var(--gold-soft); color: var(--ink); font-family: var(--ui); }
.tag { font-family: var(--ui); font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
.tag.dim { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.rank { font-family: var(--ui); font-size: .75rem; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.rank.good { color: var(--good); } .rank.fair { color: var(--fair); } .rank.weak { color: var(--weak); }

/* a narrator */
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; }
.facts div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
.facts dt { color: var(--muted); font-size: .78rem; }
.facts dd { margin: 0; font-weight: 600; }
.verdicts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.verdicts li { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.verdicts .who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.verdicts p { margin: 6px 0 0; font-size: 1.2rem; line-height: 2; }
.names { font-size: 1.2rem; line-height: 2; margin: 0; }
.big { font-size: 1.15rem; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.barrow { display: grid; grid-template-columns: minmax(120px, 260px) 1fr 60px; gap: 10px; align-items: center; font-size: .9rem; }
.bar { background: var(--bg); border-radius: 999px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); border-radius: 999px; }
.barrow .v { text-align: end; color: var(--muted); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.nlist { list-style: none; padding: 0; margin: 0; }
.nlist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; }
.links { margin: 0; padding-inline-start: 18px; }

.foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 18px 0; font-size: .9rem; }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 2rem; }
  .barrow { grid-template-columns: 1fr 50px; }
  .barrow .l { grid-column: 1 / -1; }
  .card { padding: 16px; }
  .topbar { gap: 6px 10px; padding: 8px 0; }
  .tools { margin-inline-start: auto; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  .nav a { padding: 5px 10px; white-space: nowrap; }
  .flags a { font-size: 18px; }
}
