/* =========================================================
   مَدارِج — ملف التنسيق الرئيسي
   غيّر الألوان والخطوط العامة من المتغيرات التالية فقط.
   ========================================================= */
:root {
  --green: #214d3a;
  --green-dark: #153d2c;
  --green-soft: #e6eee9;
  --ivory: #f7f2e8;
  --surface: #fffdf8;
  --sand: #efe7d8;
  --terracotta: #b96845;
  --terracotta-soft: #e8b59d;
  --gold: #b89a55;
  --gold-soft: #d9c994;
  --ink: #242620;
  --muted: #65675f;
  --border: #d9cfba;
  --danger: #9a3b2b;
  --font-heading: "Noto Kufi Arabic", Tahoma, sans-serif;
  --font-body: "Noto Sans Arabic", Tahoma, sans-serif;
  --container: 1180px;
  --radius-sm: 0.65rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --shadow: 0 18px 55px rgb(36 38 32 / 11%);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgb(184 154 85 / 7%), transparent 28rem),
    var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.028'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--terracotta-soft);
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--surface { background: rgb(255 253 248 / 62%); }
.section--green { color: var(--ivory); background: var(--green); }

h1, h2, h3, h4 {
  margin-top: 0;
  color: var(--green);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.035em;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.65rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
p { margin-top: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.max-copy { max-width: 760px; margin-inline: auto; }

.section-heading {
  max-width: 760px;
  margin: 0 auto clamp(2.5rem, 5vw, 4.5rem);
  text-align: center;
}

.section-heading h2 { margin-bottom: 0.65rem; }
.section-heading p { margin-bottom: 0; color: var(--muted); }

.ornament-rule {
  display: flex;
  width: 9.5rem;
  align-items: center;
  margin: 1rem auto 1.4rem;
  color: var(--terracotta);
}

.ornament-rule::before, .ornament-rule::after {
  height: 1px;
  flex: 1;
  background: var(--gold);
  content: "";
}

.ornament-rule span {
  width: 0.55rem;
  height: 0.55rem;
  margin-inline: 0.55rem;
  background: currentColor;
  transform: rotate(45deg);
}

/* Header and brand */
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgb(247 242 232 / 93%);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  min-height: 5.7rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  color: var(--green);
  text-decoration: none;
  flex: none;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  color: var(--gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linejoin: round;
}

.brand-copy { display: grid; min-width: 0; line-height: 1; }
.brand-copy strong { font-family: var(--font-heading); font-size: 1.75rem; }
.brand-copy small { margin-top: 0.45rem; color: var(--muted); font-size: 0.67rem; }

.primary-nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.primary-nav > a:not(.button) {
  position: relative;
  padding: 0.75rem 0;
  font-weight: 600;
  text-decoration: none;
}

.primary-nav > a:not(.button)::after {
  position: absolute;
  right: 0;
  bottom: 0.25rem;
  width: 0;
  height: 2px;
  background: var(--gold);
  content: "";
  transition: width 180ms ease;
}

.primary-nav > a:hover::after,
.primary-nav > a[aria-current="page"]::after { width: 100%; }

.menu-toggle {
  display: none;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--green);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span { display: block; height: 2px; margin: 0.28rem 0; background: currentColor; }

/* Buttons */
.button {
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 0.72rem;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgb(36 38 32 / 12%); }
.button--green { color: white; background: var(--green); }
.button--green:hover { background: var(--green-dark); }
.button--terracotta { color: white; background: var(--terracotta); }
.button--light { color: var(--green); background: var(--ivory); }
.button--outline { color: var(--green); border-color: var(--green); background: transparent; }
.wa-icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  position: absolute;
  top: -6rem;
  right: -7rem;
  width: 24rem;
  height: 24rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23B89A55' stroke-width='.7'%3E%3Cpath d='M90 5 110 40 150 30 140 70 175 90 140 110 150 150 110 140 90 175 70 140 30 150 40 110 5 90 40 70 30 30 70 40Z'/%3E%3Cpath d='M90 40 105 75 140 90 105 105 90 140 75 105 40 90 75 75Z'/%3E%3Ccircle cx='90' cy='90' r='22'/%3E%3C/g%3E%3C/svg%3E");
  content: "";
  opacity: 0.24;
}

.hero-grid {
  display: grid;
  min-height: 700px;
  align-items: center;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(3rem, 7vw, 7rem);
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}

.hero-content { position: relative; z-index: 1; min-width: 0; text-align: center; }
.hero h1 { margin-bottom: 0; text-wrap: balance; }
.hero-lead { max-width: 680px; margin: 0 auto; font-size: clamp(1.05rem, 1.8vw, 1.22rem); }
.hero-actions { display: flex; justify-content: center; gap: 0.85rem; margin-top: 2rem; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem 1.2rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 0.84rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.meta-svg { width: 1.2rem; height: 1.2rem; padding: 0.2rem; border-radius: 50%; color: white; background: var(--green); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.hero-media-wrap { position: relative; padding: 0.7rem; }
.hero-media-wrap::before {
  position: absolute;
  inset: -0.5rem;
  border: 1px solid var(--gold-soft);
  border-radius: 48% 48% 1rem 1rem / 28% 28% 1rem 1rem;
  content: "";
}
.hero-media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 48% 48% 0.65rem 0.65rem / 28% 28% 0.65rem 0.65rem; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* Inner page hero */
.page-hero { position: relative; overflow: hidden; padding-block: clamp(4.5rem, 10vw, 8rem); text-align: center; border-bottom: 1px solid var(--border); }
.page-hero::before, .page-hero::after { position: absolute; width: 13rem; height: 13rem; border: 1px solid var(--gold-soft); content: ""; transform: rotate(45deg); opacity: 0.5; }
.page-hero::before { top: -8rem; right: -4rem; }
.page-hero::after { bottom: -9rem; left: -4rem; }
.page-hero h1 { max-width: 18ch; margin: 0 auto 1rem; }
.page-hero p { max-width: 760px; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }

/* Programs */
.program-strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.program-card { position: relative; padding: 0 1.5rem; text-align: center; }
.program-card + .program-card { border-right: 1px solid var(--border); }
.icon-circle { display: grid; width: 6.4rem; height: 6.4rem; place-items: center; margin: 0 auto 1.4rem; border: 1px solid var(--gold-soft); border-radius: 50%; color: var(--green); background: var(--surface); }
.icon-circle svg { width: 3.4rem; height: 3.4rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.program-card h3 { margin-bottom: 0.45rem; }
.program-card p { margin-bottom: 0; color: var(--muted); font-size: 0.92rem; }

.program-detail-list { display: grid; gap: 1.5rem; }
.program-detail {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgb(255 253 248 / 76%);
}
.program-detail:nth-child(even) .program-summary { order: 2; }
.program-summary h2 { margin-bottom: 0.8rem; }
.program-summary p { color: var(--muted); }
.program-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem; }
.fact { padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.fact strong { display: block; color: var(--green); }
.fact p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* Steps and values */
.steps-panel { position: relative; padding: clamp(2rem, 5vw, 4rem); border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgb(255 253 248 / 68%); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.step { position: relative; text-align: center; }
.step-number { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; margin: 0 auto 1rem; border-radius: 50%; color: white; background: var(--green); font-weight: 700; }
.step h3 { margin-bottom: 0.35rem; }
.step p { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }

.values-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem 3rem; }
.value-item { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; align-items: start; }
.value-icon { display: grid; width: 3.5rem; height: 3.5rem; place-items: center; border-radius: 50%; color: var(--green); background: var(--sand); font-size: 1.3rem; font-weight: 700; }
.value-item h3 { margin-bottom: 0.3rem; }
.value-item p { margin-bottom: 0; color: var(--muted); }

.principles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.principle { padding: 1.7rem; border-top: 3px solid var(--gold); background: rgb(255 253 248 / 65%); }
.principle b { display: block; margin-bottom: 0.45rem; color: var(--terracotta); font-family: var(--font-heading); font-size: 1.15rem; }
.principle p { margin: 0; color: var(--muted); }

/* FAQ */
.faq-list { max-width: 900px; margin-inline: auto; border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; color: var(--green); font-weight: 700; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--terracotta); font-size: 1.4rem; transition: transform 180ms ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { max-width: 780px; padding-bottom: 1.25rem; margin: 0; color: var(--muted); }

/* Forms */
.contact-layout { display: grid; grid-template-columns: 0.72fr 1.28fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-panel, .contact-form { padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 10px 35px rgb(36 38 32 / 7%); }
.contact-panel h2, .contact-form h2 { margin-bottom: 0.6rem; font-size: 1.55rem; }
.contact-list { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.contact-list strong { display: block; color: var(--green); }
.form-status { display: none; padding: 0.8rem 1rem; margin-bottom: 1rem; border-radius: var(--radius-sm); }
.form-status.error { display: block; color: var(--danger); background: #fff0ec; }
.form-status.success { display: block; color: var(--green-dark); background: var(--green-soft); }
.intent-switch { display: flex; gap: 0.7rem; padding: 0; margin: 1.3rem 0; border: 0; }
.intent-switch legend { width: 100%; margin-bottom: 0.55rem; font-weight: 700; }
.intent-switch label { position: relative; cursor: pointer; }
.intent-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; clip-path: inset(50%); }
.intent-switch span { display: block; min-width: 7rem; padding: 0.55rem 1rem; border: 1px solid var(--border); border-radius: 2rem; text-align: center; }
.intent-switch input:checked + span { color: white; border-color: var(--green); background: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.field { display: block; }
.field--full { grid-column: 1 / -1; }
.field > span { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); background: white; }
input, select { min-height: 3.2rem; padding: 0.55rem 0.8rem; }
textarea { min-height: 8rem; padding: 0.8rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: #92938b; }
[aria-invalid="true"] { border-color: var(--danger); background: #fff8f5; }
.field-error { display: block; min-height: 1.15rem; margin-top: 0.2rem; color: var(--danger); font-size: 0.76rem; }
.privacy-check { display: flex; align-items: flex-start; gap: 0.65rem; margin: 1.1rem 0; color: var(--muted); font-size: 0.85rem; }
.privacy-check input { width: 1.1rem; height: 1.1rem; min-height: 0; margin-top: 0.4rem; accent-color: var(--green); flex: none; }
.contact-form .button { width: 100%; }
.form-note { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

/* Long text */
.article { max-width: 850px; margin-inline: auto; }
.article section { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.article h2 { margin-bottom: 0.6rem; font-size: 1.4rem; }
.article p, .article li { color: var(--muted); }

/* CTA and footer */
.cta-band { position: relative; overflow: hidden; padding-block: clamp(2.2rem, 5vw, 3.5rem); color: white; background: var(--green); }
.cta-band::before, .cta-band::after { position: absolute; width: 10rem; height: 10rem; border: 1px solid rgb(217 201 148 / 45%); content: ""; transform: rotate(45deg); }
.cta-band::before { right: -6rem; top: -5rem; }
.cta-band::after { left: -6rem; bottom: -5rem; }
.cta-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-inner h2 { margin: 0; color: white; }
.cta-inner p { margin: 0.4rem 0 0; color: rgb(255 255 255 / 76%); }

.site-footer { padding: 3.5rem 0 1.5rem; color: var(--ivory); background: var(--green-dark); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.7fr 1fr; gap: 3rem; }
.site-footer .brand { color: white; }
.site-footer .brand-copy small, .site-footer p { color: rgb(247 242 232 / 70%); }
.site-footer h3 { color: white; font-size: 1.05rem; }
.footer-links { display: grid; gap: 0.4rem; }
.footer-links a { color: rgb(247 242 232 / 80%); text-decoration: none; }
.footer-bottom { padding-top: 1.5rem; margin-top: 2rem; border-top: 1px solid rgb(255 255 255 / 14%); color: rgb(247 242 232 / 62%); font-size: 0.8rem; text-align: center; }

/* Accessibility */
.skip-link { position: fixed; z-index: 100; top: 0.5rem; right: 0.5rem; padding: 0.6rem 1rem; color: white; background: var(--green); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 940px) {
  .nav-cta { display: none; }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; }
  .hero-content { order: -1; }
  .hero-media-wrap { width: min(100%, 600px); margin-inline: auto; }
  .program-strip, .principles-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem 0; }
  .program-card:nth-child(3) { border-right: 0; }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .header-inner { min-height: 4.9rem; min-width: 0; }
  .menu-toggle { display: block; }
  .primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: none;
    align-items: stretch;
    gap: 0;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--ivory);
    box-shadow: var(--shadow);
  }
  .primary-nav.open { display: grid; }
  .primary-nav > a:not(.button) { padding: 0.8rem 1rem; }
  .primary-nav > a::after { display: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .program-detail { grid-template-columns: 1fr; }
  .program-detail:nth-child(even) .program-summary { order: initial; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 1.35rem), var(--container)); }
  .brand { max-width: calc(100% - 3.5rem); }
  .brand-mark { width: 2.55rem; height: 2.55rem; }
  .brand-copy strong { font-size: 1.45rem; }
  .brand-copy small { display: none; }
  .hero-grid { gap: 3.3rem; padding-top: 2.8rem; }
  .hero h1 { max-width: 100%; font-size: clamp(2rem, 10vw, 2.7rem); overflow-wrap: anywhere; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-meta { align-items: center; flex-direction: column; }
  .program-strip, .principles-grid, .values-grid, .steps, .form-grid, .program-facts { grid-template-columns: 1fr; }
  .program-card { padding-block: 1.6rem; }
  .program-card + .program-card { border-top: 1px solid var(--border); border-right: 0; }
  .field--full { grid-column: auto; }
  .intent-switch { flex-wrap: wrap; }
  .cta-inner { align-items: stretch; flex-direction: column; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-about { grid-column: auto; }
  .site-footer .brand { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
