/* دار زيد بن ثابت — الموقع العام
   الألوان كلها هنا كمتغيرات: الوضع الساطع أولًا ثم الداكن. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3ede4;
  --text: #1f1a17;
  --muted: #6b625a;
  --line: #e6ddd0;
  --maroon: #8b2e2e;
  --maroon-strong: #732424;
  --on-maroon: #ffffff;
  --green: #2d5a3d;
  --maroon-soft: #f6e9e6;
  --green-soft: #e6efe8;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .06);
  --todo-bg: #fff6d6;
  --todo-line: #d9b44a;
  --todo-text: #6b5310;

  --font-body: "Tajawal", system-ui, sans-serif;
  --font-quote: "Amiri", "Tajawal", serif;
  --radius: 14px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f;
    --surface: #1d1916;
    --surface-2: #26211d;
    --text: #f1ebe4;
    --muted: #b3a89c;
    --line: #3a332c;
    --maroon: #e08a7e;
    --maroon-strong: #eda196;
    --on-maroon: #1d1210;
    --green: #8cc4a0;
    --maroon-soft: #33201d;
    --green-soft: #1c2c22;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --todo-bg: #3a3116;
    --todo-line: #a88a2e;
    --todo-text: #f0dc9a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14110f;
  --surface: #1d1916;
  --surface-2: #26211d;
  --text: #f1ebe4;
  --muted: #b3a89c;
  --line: #3a332c;
  --maroon: #e08a7e;
  --maroon-strong: #eda196;
  --on-maroon: #1d1210;
  --green: #8cc4a0;
  --maroon-soft: #33201d;
  --green-soft: #1c2c22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --todo-bg: #3a3116;
  --todo-line: #a88a2e;
  --todo-text: #f0dc9a;
  color-scheme: dark;
}

html[lang="en"] {
  --font-body: "Inter", system-ui, sans-serif;
}

/* ---------- أساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  transition: background-color .2s, color .2s;
}
html[lang="en"] body { line-height: 1.65; font-size: 16px; }
img, svg { display: block; max-width: 100%; }
a { color: var(--maroon); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--maroon); color: var(--on-maroon); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; border-radius: 6px; }

/* مكان معلومة ناقصة — يُحذف عند تعبئتها */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  border: 1px dashed var(--todo-line);
  border-radius: 6px;
  padding: 0 .4em;
  font-size: .92em;
}

/* ---------- الترويسة ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.header.scrolled { border-bottom-color: var(--line); }
.header .wrap { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-inline-end: auto; min-width: 0; }
.brand img { width: 44px; height: 44px; flex: none; object-fit: contain; }
.brand b { font-size: 1.05rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); }

.tools { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; font-size: .9rem;
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--maroon); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; top: 68px; inset-inline: 0;
    flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1rem; }
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .1s, background-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--maroon); color: var(--on-maroon); }
.btn-primary:hover { background: var(--maroon-strong); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--maroon); }

/* ---------- البطل ---------- */
.hero { padding: 56px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--green); font-weight: 700; font-size: .95rem; margin-bottom: 8px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 800; margin-bottom: .2em; }
.hero h1 small { display: block; font-size: .42em; font-weight: 500; color: var(--muted); margin-top: .3em; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.quote-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 36px 28px; text-align: center; box-shadow: var(--shadow);
  overflow: hidden;
}
.quote-card::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 0 0, var(--maroon-soft), transparent 45%),
    radial-gradient(circle at 100% 100%, var(--green-soft), transparent 45%);
  pointer-events: none;
}
.quote-card > * { position: relative; }
.quote-card img { width: 200px; height: 200px; margin: 0 auto 12px; object-fit: contain; }
@media (max-width: 480px) { .quote-card img { width: 170px; height: 170px; } }
.quote { font-family: var(--font-quote); font-size: 1.9rem; line-height: 1.7; color: var(--maroon); margin: 0 0 8px; }
.quote-tr { color: var(--text); font-style: italic; margin: 0 0 6px; }
.quote-src { color: var(--muted); font-size: .9rem; margin: 0; }

@media (max-width: 860px) {
  .hero { padding: 32px 0 48px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
  .quote { font-size: 1.6rem; }
}

/* ---------- الأقسام ---------- */
.section { padding: 72px 0; }
.section.alt { background: var(--surface-2); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
.section-head h2::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--maroon); margin-top: 12px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.card h3 { font-size: 1.15rem; font-weight: 700; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.ico {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--maroon-soft); color: var(--maroon);
}
.ico.green { background: var(--green-soft); color: var(--green); }
.ico svg { width: 24px; height: 24px; }

/* من نحن */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.values { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.values li { display: flex; gap: 12px; align-items: flex-start; }
.values li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--green); margin-top: .7em; transform: rotate(45deg); }
html[lang="en"] .values li::before { margin-top: .55em; }
.name-card { border-inline-start: 4px solid var(--green); }
.name-card h3 { color: var(--green); }

/* الأقسام: ذكور وإناث */
.branches { margin-top: 28px; }
.branch { display: flex; flex-direction: column; gap: 6px; }
.branch h3 { margin: 0; }
.meta { display: grid; gap: 4px; margin-top: 8px; color: var(--muted); }
.meta span b { color: var(--text); font-weight: 600; }

/* خطوات التسجيل */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 56px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 20px; inset-inline-start: 24px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--maroon); color: var(--on-maroon); font-weight: 800;
}
.note { margin-top: 20px; color: var(--muted); }

/* الكفالة */
.sponsor {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px; box-shadow: var(--shadow);
}
@media (max-width: 860px) { .sponsor { grid-template-columns: 1fr; padding: 24px; } }
.sponsor .quote { font-size: 1.5rem; }
.sponsor-side { display: grid; gap: 14px; }
.sponsor-box { background: var(--green-soft); border-radius: var(--radius); padding: 24px; text-align: center; }
.sponsor-box p { margin-bottom: 16px; }
.donate-box {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  display: grid; gap: 2px; text-align: center;
}
.donate-box > span { color: var(--muted); font-size: .92rem; }
.donate-num { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.donate-num > span { font-size: 1.5rem; font-weight: 800; color: var(--maroon); letter-spacing: .03em; }
.copy-btn.done { border-color: var(--green); color: var(--green); }

/* التواصل */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 24px; margin: 0; display: grid; gap: 18px; align-content: start; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .ico { margin: 0; flex: none; width: 44px; height: 44px; }
.contact-list b { display: block; }
.contact-list div > span, .contact-list div > a { display: block; color: var(--muted); }
.contact-list div > a { color: var(--maroon); font-weight: 700; text-decoration: none; width: fit-content; }
.contact-list div > a:hover { text-decoration: underline; }
.map {
  min-height: 300px; border-radius: var(--radius); border: 1px dashed var(--todo-line);
  background: var(--surface-2); display: grid; place-items: center; text-align: center; padding: 24px;
}
.map iframe { width: 100%; height: 100%; min-height: 300px; border: 0; border-radius: var(--radius); }

/* التذييل */
/* مسافة سفلية حتى لا يغطي زر «راسلنا» الثابت شيئًا من التذييل */
.footer { border-top: 1px solid var(--line); padding: 28px 0 96px; color: var(--muted); font-size: .92rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer a { color: var(--muted); }

/* زر واتساب الثابت */
.float-chat {
  position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--green); color: var(--bg);
  font-weight: 700; text-decoration: none; box-shadow: var(--shadow);
}
.float-chat svg { width: 22px; height: 22px; }
@media (max-width: 480px) { .float-chat span { display: none; } .float-chat { padding: 14px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* قسم التواصل بلا خريطة (مؤقتًا حتى تصل الإحداثيات) */
.contact.no-map { grid-template-columns: 1fr; max-width: 640px; }
