/* ============================================================
   شمس · التخطيط
   الحاويات، الرأس، التنقّل، الأقسام، التذييل
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--mid    { max-width: var(--wrap-mid); }
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--alt   { background: var(--bg-alt); }
.section--deep {
  background: var(--deep-900);
  color: rgb(255 255 255 / 0.92);
}
.section--deep h2,
.section--deep h3 { color: #fff; }
.section--deep .lede { color: rgb(255 255 255 / 0.72); }

/* ============================================================
   الرأس
   ============================================================ */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  background: rgb(252 250 246 / 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-block-end: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out),
              box-shadow 0.3s var(--ease-out);
}
.site-header.is-stuck {
  border-block-end-color: var(--line);
  box-shadow: 0 8px 24px -20px rgb(6 34 42 / 0.5);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ---- العلامة ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  transition: transform 0.5s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(45deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.6875rem;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

/* ---- التنقّل ---- */
.nav { margin-inline-start: auto; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  border-radius: var(--r-xs);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.nav-link:hover { color: var(--ink); background: rgb(10 47 57 / 0.045); }
.nav-link[aria-current="page"] {
  color: var(--teal-700);
  font-weight: 500;
}

.header-cta { flex-shrink: 0; }

/* نسخة الزر داخل لوحة الجوال تظهر عند فتحها فقط */
.nav-cta { display: none; }

/* بين 68rem و80rem تضيق المسافات كي تتّسع بنود التنقّل السبعة */
@media (min-width: 68rem) and (max-width: 80rem) {
  .nav-link { padding-inline: 0.5rem; font-size: 0.875rem; }
  .header-inner { gap: 1rem; }
  .brand-sub { display: none; }
}

/* ---- زر قائمة الجوال ---- */
.nav-toggle {
  display: none;
  margin-inline-start: auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.nav-toggle:hover { border-color: var(--line-strong); }
.nav-toggle-bars {
  position: relative;
  width: 1.125rem;
  height: 0.75rem;
  display: block;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after,
.nav-toggle-bars span {
  content: '';
  position: absolute;
  inset-inline: 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s var(--ease-out);
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars span { top: 50%; margin-top: -0.75px; }
.nav-toggle-bars::after { bottom: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(0.365rem) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-0.365rem) rotate(-45deg);
}

@media (max-width: 68rem) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    margin: 0;
    padding: 1.5rem var(--gutter) 3rem;
    background: var(--bg);
    border-block-start: 1px solid var(--line);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.75rem);
    transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out),
                visibility 0.28s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list li { border-block-end: 1px solid var(--line-soft); }
  .nav-link {
    display: block;
    padding: 1rem 0.25rem;
    font-size: 1.0625rem;
    border-radius: 0;
  }
  .nav-link:hover { background: transparent; }
  .nav-cta { display: block; margin-block-start: 1.75rem; }
  .nav-cta .btn { width: 100%; }
}

/* ============================================================
   ترويسة الصفحة الداخلية
   ============================================================ */

.page-head {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem);
  background:
    radial-gradient(120% 100% at 85% 0%, var(--teal-50) 0%, transparent 58%),
    linear-gradient(180deg, var(--sand-100) 0%, var(--bg) 100%);
  border-block-end: 1px solid var(--line-soft);
  overflow: hidden;
}
.page-head::after {
  content: '';
  position: absolute;
  inset-block-start: -30%;
  inset-inline-start: -12%;
  width: 34rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(203 156 72 / 0.10) 0%, transparent 66%);
  pointer-events: none;
}
.page-head > .wrap { position: relative; z-index: 1; }
.page-head h1 { max-width: 20ch; }
.page-head .lede { margin-block-start: 1.25rem; max-width: 56ch; }

/* ---- مسار التنقّل ---- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--ink-mute);
}
.crumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.crumbs li + li::before {
  content: '';
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--sand-400);
}
.crumbs a { color: var(--ink-mute); text-decoration: none; }
.crumbs a:hover { color: var(--teal-700); }
.crumbs [aria-current="page"] { color: var(--ink-soft); }

/* ============================================================
   الشبكات
   ============================================================ */

.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }

/* عمودان غير متساويين: نص + لوحة */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 56rem) {
  .split { grid-template-columns: 1.05fr 0.95fr; }
  /* اللوحة أوّل عنصر في DOM، فتقع في العمود الأول (يمينًا) */
  .split--reverse { grid-template-columns: 0.95fr 1.05fr; }
}

/* ============================================================
   التذييل
   ============================================================ */

.site-footer {
  background: var(--deep-900);
  color: rgb(255 255 255 / 0.66);
  font-size: 0.9375rem;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset-block-start: -18rem;
  inset-inline-end: -10rem;
  width: 40rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(13 129 141 / 0.22) 0%, transparent 65%);
  pointer-events: none;
}
.site-footer > * { position: relative; z-index: 1; }

.footer-top {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(2.5rem, 5vw, 3.5rem);
}
@media (min-width: 56rem) {
  .footer-top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr); }
}

.footer-brand .brand { color: #fff; }
.footer-brand .brand-sub { color: rgb(255 255 255 / 0.5); }
.footer-tagline {
  margin-block-start: 1.5rem;
  max-width: 32ch;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgb(255 255 255 / 0.8);
}

.footer-cols {
  display: grid;
  gap: 2rem clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}
.footer-col h2 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  color: var(--gold-300);
  margin-block-end: 1.1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.footer-col a {
  color: rgb(255 255 255 / 0.68);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.footer-col a:hover { color: #fff; }
.footer-col address { font-style: normal; line-height: 1.9; color: rgb(255 255 255 / 0.68); }

.footer-bottom {
  border-block-start: 1px solid rgb(255 255 255 / 0.1);
  padding-block: 1.75rem 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: rgb(255 255 255 / 0.5);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-legal a { color: rgb(255 255 255 / 0.55); text-decoration: none; }
.footer-legal a:hover { color: #fff; }

/* ---- زر العودة للأعلى ---- */
.to-top {
  position: fixed;
  inset-block-end: 1.5rem;
  inset-inline-start: 1.5rem;
  z-index: 90;
  width: 2.875rem;
  height: 2.875rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(8px);
  color: var(--deep-800);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out),
              visibility 0.3s, background 0.2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #fff; color: var(--teal-700); }
