/* QuranicWords — static word and root pages (quran-words/, quran-roots/). External file: the
   site's CSP allows no inline styles. Light by default, dark with the system setting. */
@font-face {
  font-family: 'Scheherazade New';
  src: url('fonts/ScheherazadeNew-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Amiri Quran';
  src: url('fonts/AmiriQuran-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
:root {
  --bg: #f4faf6;
  --surface: #ffffff;
  --surface-2: #e8f4ec;
  --fg: #062b1e;
  --muted: #476a5b;
  --line: #d3e6da;
  --accent: #006b37;
  --accent-soft: rgba(0, 191, 99, 0.12);
  --hl: #006b37;
  --hl-bg: rgba(0, 191, 99, 0.16);
  --bar: #053827;
  --gold: #ebc971;
  --shadow: 0 1px 2px rgba(5, 56, 39, 0.06), 0 6px 20px rgba(5, 56, 39, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #021d14;
    --surface: #053827;
    --surface-2: #0a4430;
    --fg: #eef6f1;
    --muted: #a9bdb2;
    --line: rgba(235, 201, 113, 0.18);
    --accent: #ebc971;
    --accent-soft: rgba(235, 201, 113, 0.12);
    --hl: #ffd54f;
    --hl-bg: rgba(255, 213, 79, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[lang="ar"] { font-family: 'Scheherazade New', 'Amiri Quran', 'Noto Naskh Arabic', serif; font-size: 1.35em; line-height: 1.6; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 18px; padding-bottom: 48px; }

.bar { background: var(--bar); border-bottom: 1px solid rgba(235, 201, 113, 0.22); }
.bar-inner { max-width: 920px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.bar-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bar-nav a { color: #e6f2ea; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.bar-nav a:hover { color: var(--gold); }
.bar-nav .cta { background: var(--gold); color: #2a1f00; padding: 6px 12px; border-radius: 10px; }
.bar-nav .cta:hover { color: #2a1f00; filter: brightness(1.05); }

.crumbs { font-size: 0.9rem; color: var(--muted); margin: 4px 0 14px; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.crumbs [lang="ar"] { font-size: 1.1em; }

h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
h1 .big { font-size: 1.6em; color: var(--hl); font-weight: 400; }
h1 .h1-text { display: inline-block; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.lede { font-size: 1.05rem; color: var(--muted); margin: 6px 0 12px; max-width: 720px; }
.lede strong { color: var(--fg); }
.native { color: var(--muted); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 12px; background: var(--accent); color: var(--surface); font-weight: 700; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 18px 0 0; padding: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.facts dt { font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.root { color: var(--accent); }

table { border-collapse: collapse; }
.meanings { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.meanings th, .meanings td { padding: 10px 14px; border-top: 1px solid var(--line); text-align: start; vertical-align: top; }
.meanings tr:first-child th, .meanings tr:first-child td { border-top: 0; }
.meanings th { width: 34%; font-weight: 600; color: var(--muted); }
.meanings td { font-size: 1.08rem; font-weight: 600; }
.senses { margin: 6px 0 0; padding-inline-start: 18px; font-size: 0.92rem; font-weight: 400; }
.ref { color: var(--muted); font-size: 0.85rem; }

.ayah { font-family: 'Amiri Quran', 'Scheherazade New', serif; font-size: 1.75rem; line-height: 2.3; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 0 0 12px; box-shadow: var(--shadow); }
mark { background: var(--hl-bg); color: var(--hl); font-weight: 700; border-radius: 4px; padding: 0 2px; }
.ayah mark { font-weight: 400; }
.trs { display: grid; gap: 8px; }
.tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.tr-lang { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.tr p { margin: 2px 0 0; }
.note { font-size: 0.85rem; color: var(--muted); }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--line); text-decoration: none; }
.chips span:not([lang]) { color: var(--fg); font-size: 0.9rem; }

.wordlist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.wordlist a { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; height: 100%; }
.wordlist a:hover { border-color: var(--accent); }
.wordlist .m { color: var(--fg); flex: 1; overflow-wrap: anywhere; }
.wordlist .n { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.cards { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cards a { display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; box-shadow: var(--shadow); height: 100%; }
.cards strong { display: block; color: var(--fg); }
.cards span { color: var(--muted); font-size: 0.9rem; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.grid th, .grid td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.grid th { font-size: 0.85rem; color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 0; }
.pager a { padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.foot-inner { padding: 18px 16px 30px; }
.foot p { margin: 4px 0; }

@media (max-width: 560px) {
  .meanings th { width: 40%; }
  .ayah { font-size: 1.5rem; padding: 12px 14px; }
  .bar-nav { gap: 10px; }
}
