/* ===== المتغيرات والأساسيات ===== */
:root {
  --navy: #1a2942;
  --navy-soft: #2d3e5c;
  --gold: #c9a961;
  --gold-soft: #e0c88a;
  --green: #2c5f4b;
  --green-soft: #4a8068;
  --bg: #faf8f5;
  --bg-alt: #f2ede5;
  --surface: #ffffff;
  --surface-hover: #fefdfb;
  --text: #1a2332;
  --text-muted: #6b7280;
  --text-light: #9aa3ad;
  --border: #e5e0d8;
  --border-strong: #d1c9bd;
  --danger: #b8392f;
  --shadow-sm: 0 1px 3px rgba(26, 41, 66, 0.08);
  --shadow-md: 0 4px 16px rgba(26, 41, 66, 0.10);
  --shadow-lg: 0 12px 32px rgba(26, 41, 66, 0.15);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --font-ar: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-en: 'IBM Plex Sans', system-ui, sans-serif;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --container: 1200px;
}

[data-theme="dark"] {
  --navy: #d9dde3;
  --navy-soft: #b0b8c4;
  --gold: #d4b876;
  --gold-soft: #e0c88a;
  --green: #6fae8f;
  --bg: #0f1419;
  --bg-alt: #1a1f28;
  --surface: #1e2530;
  --surface-hover: #252d3a;
  --text: #e8eaed;
  --text-muted: #9aa3ad;
  --text-light: #6b7280;
  --border: #2d3540;
  --border-strong: #3d4550;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ar);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ===== الشريط العلوي ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--navy), var(--green));
  color: var(--gold);
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 0.9rem;
}

.brand-text small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-list {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-list a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--navy);
  background: var(--bg-alt);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.menu-toggle {
  display: none;
}

/* ===== التذييل ===== */
.site-footer {
  background: var(--navy);
  color: #d9dde3;
  margin-top: 80px;
  padding: 48px 0 24px;
}

[data-theme="dark"] .site-footer {
  background: #0a0e13;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand p {
  color: #9aa3ad;
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 320px;
}

.footer-col h4 {
  color: var(--gold);
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  color: #9aa3ad;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
}

/* ===== العناوين المساعدة ===== */
.section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
}

.section-title small {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-link {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.section-link:hover {
  color: var(--navy);
}

/* ===== الحركات ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 400ms ease-out both;
}