/* ==========================================================================
   عبد الرحمن العدواني - نظام التصميم
   Accessible luxury RTL design system (WCAG AA), plain CSS, no dependencies.
   Palette: deep navy (comfortable for low vision) + gold accent.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --navy-900: #0a1420;   /* page background */
  --navy-800: #0f1e30;   /* header / panels */
  --navy-700: #16293f;   /* cards */
  --navy-600: #1e3550;   /* raised surfaces */
  --gold: #d4af37;       /* primary accent (large/high-emphasis) */
  --gold-light: #f0d77b; /* gold on dark for small/semibold text */
  --gold-deep: #8a6d1a;  /* gold text on light background */
  --text-hi: #f3f6fa;    /* primary text on dark */
  --text-mid: #c9d2dd;   /* secondary text on dark (contrast >= 7:1) */
  --text-dim: #93a3b5;   /* small muted - used only >= 4.5:1 contexts */
  --bg-paper: #faf7f0;   /* light content surface */
  --ink: #101820;        /* text on light */
  --ink-mid: #3c4858;
  --line: rgba(212, 175, 55, 0.32);
  --line-soft: rgba(243, 246, 250, 0.14);
  --danger: #ff8f7a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --focus: 3px solid var(--gold-light);
  --focus-offset: 4px;
  --font-body: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Amiri", "Times New Roman", serif;
  --space: clamp(1.25rem, 4vw, 2.75rem);
  --content: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text-hi);
  background-color: var(--navy-900);
  background-image:
    radial-gradient(1100px 520px at 85% -8%, rgba(212, 175, 55, 0.10), transparent 60%),
    radial-gradient(900px 480px at -10% 8%, rgba(30, 53, 80, 0.55), transparent 60%);
  background-repeat: no-repeat;
  text-align: right;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--gold-light);
  line-height: 1.35;
  margin: 0 0 0.6em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); color: #f9e6a8; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; color: var(--text-hi); }

p { margin: 0 0 1em; }

a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 4px;
}

a:hover { color: #fff; }

/* Visible keyboard focus — required for accessibility */
:focus-visible {
  outline: var(--focus);
  outline-offset: var(--focus-offset);
}

/* ---------- Skip link (screen-reader friendly) ---------- */
.skip-link {
  position: absolute;
  top: -4rem;
  right: 1rem;
  z-index: 200;
  background: var(--gold);
  color: #141a08;
  font-weight: 800;
  padding: 0.8rem 1.4rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: #141a08;
}

/* ---------- Layout utilities ---------- */
.container {
  width: min(var(--content), 100% - 2.5rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--space);
}

.section--alt {
  background: rgba(15, 30, 48, 0.6);
  border-block: 1px solid var(--line-soft);
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
}

.section__title {
  margin: 0;
}

.section__lead {
  color: var(--text-mid);
  max-width: 70ch;
}

.kicker {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gold);
  color: #141a08;
  font: 800 1.05rem/1 var(--font-body);
  padding: 0.9rem 1.6rem;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: #141a08;
  transform: translateY(-2px);
}

.btn:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--gold-light);
  border-color: var(--gold);
}

.btn--ghost:hover { background: rgba(212, 175, 55, 0.12); color: #fff; border-color: var(--gold-light); }

.btn--lg { padding: 1.05rem 2rem; font-size: 1.15rem; }
.btn--block { display: flex; width: 100%; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 20, 32, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-soft);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand__mark {
  width: 48px;
  height: 48px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.brand__tag {
  display: block;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--text-mid);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font: 700 0.95rem var(--font-body);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.nav-toggle[aria-expanded="true"] { background: rgba(212, 175, 55, 0.15); }

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.primary-nav a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  text-decoration: none;
  font-weight: 600;
}

.primary-nav a:hover { color: var(--gold-light); background: rgba(212, 175, 55, 0.1); }

.primary-nav a[aria-current="page"] {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.14);
  outline: 2px solid var(--line);
  outline-offset: -2px;
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  align-items: center;
  gap: 2rem;
}

.hero__title { margin-bottom: 0.45rem; }

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.hero__text { color: var(--text-mid); max-width: 62ch; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.5rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.6rem;
  padding: 0;
  list-style: none;
  color: var(--text-mid);
  font-size: 1rem;
}

.hero__meta span::before { content: "◆ "; color: var(--gold); font-size: 0.7em; margin-inline-end: 0.35em; }

.hero__media { position: relative; }

.hero__media img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero__media .figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-mid);
  text-align: center;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}

.stat__num sup { font-size: 1.1rem; }

.stat__label { color: var(--text-mid); font-size: 0.98rem; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card h3 { margin: 0; }

.card p { color: var(--text-mid); margin: 0; flex: 1; }

.card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.card__meta { font-size: 0.92rem; color: var(--text-dim); }

.timeline { list-style: none; margin: 0; padding: 0; counter-reset: tl; }

.timeline li {
  position: relative;
  padding-inline-start: 2.2rem;
  padding-bottom: 1.1rem;
  border-inline-start: 2px solid var(--line);
  margin-inline-start: 0.6rem;
}

.timeline li::before {
  counter-increment: tl;
  content: counter(tl);
  position: absolute;
  inset-inline-start: -1rem;
  top: 0.1rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--gold);
  color: #141a08;
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}

.timeline strong { color: #fff; }
.timeline .date { display: block; font-size: 0.9rem; color: var(--gold); margin-bottom: 0.25rem; }

/* ---------- News ticker (accessible: static list in DOM) ---------- */
.ticker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--navy-800);
  overflow: hidden;
}

.ticker__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold);
  color: #141a08;
  font-weight: 800;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.ticker__viewport { overflow: hidden; }

.ticker__track {
  display: flex;
  gap: 3rem;
  padding: 0.6rem 1.2rem;
  white-space: nowrap;
  animation: ticker 36s linear infinite alternate;
  will-change: transform;
}

.ticker__track,
.ticker__track li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticker__track li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ticker__viewport:hover .ticker__track,
.ticker__viewport:focus-within .ticker__track {
  animation-play-state: paused;
}

.ticker__track a { color: var(--text-hi); text-decoration: none; font-weight: 600; }
.ticker__track a:hover { color: var(--gold-light); text-decoration: underline; }
.ticker__track .ticker-sep { color: var(--gold); }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(28%); }
}

/* ---------- Media / audio ---------- */
.media-box figure { margin: 0; }

video, .video-poster {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #000;
}

.video-poster {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  position: relative;
}

.audio-wrap {
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.audio-wrap audio { width: 100%; }

.transcript {
  background: var(--navy-800);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  color: var(--text-mid);
  font-size: 0.98rem;
}

/* ---------- Bands / CTA ---------- */
.band {
  background: linear-gradient(120deg, var(--navy-800), var(--navy-600));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  text-align: center;
}

.band h2 { color: var(--gold-light); }
.band p { color: var(--text-mid); max-width: 66ch; margin-inline: auto; }
.band .btn { margin-top: 0.5rem; }

/* ---------- Utility helpers ---------- */
.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.u-mt { margin-top: 0.8rem; }
.u-mt-1 { margin-top: 1rem; }
.u-mt-1-5 { margin-top: 1.5rem; }
.u-mb-1-5 { margin-bottom: 1.5rem; }
.u-mb-2 { margin-bottom: 2rem; }
.u-mb-2-5 { margin-bottom: 2.5rem; }
.u-center-actions { justify-content: center; }
.u-flat { border: none; margin: 0; padding: 0; }
.u-stats-slim { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.u-content-narrow { max-width: 860px; margin-inline: auto; }
.u-note { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.6rem; }
.u-note--mid { color: var(--text-mid); }
.video-poster__play { font-size: 3rem; color: var(--gold); }

/* ---------- Partners / ads ---------- */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.partner {
  background: var(--navy-700);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 1.1rem 0.8rem;
  text-align: center;
  color: var(--text-mid);
  font-weight: 600;
}

.ad-box {
  background:
    repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.05) 0 12px, transparent 12px 24px),
    var(--navy-800);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-mid);
  min-height: 120px;
  display: grid;
  place-items: center;
}

/* ---------- Lists (docs / CV) ---------- */
.doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: nl;
}

.doc-list li {
  counter-increment: nl;
  position: relative;
  padding-inline-start: 2.4rem;
  padding-block: 0.45rem;
  border-bottom: 1px solid var(--line-soft);
}

.doc-list li::before {
  content: counter(nl, arabic-indic);
  position: absolute;
  inset-inline-start: 0;
  top: 0.45rem;
  font-weight: 800;
  color: var(--gold);
}

.doc-list--plain li { padding-inline-start: 0; }
.doc-list--plain li::before { content: none; }

.def-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.def {
  background: var(--navy-700);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.3rem;
}

.def h3 { margin: 0 0 0.4rem; font-family: var(--font-body); font-size: 1.05rem; }
.def p { color: var(--text-mid); margin: 0; font-size: 0.98rem; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field--full { grid-column: 1 / -1; }

.field label { font-weight: 700; color: #fff; }

.field .hint { font-size: 0.88rem; color: var(--text-dim); }

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--navy-600);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  min-height: 3rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--navy-700);
}

.field textarea { min-height: 130px; resize: vertical; }

.field .error-msg {
  color: #ffb4a3;
  font-size: 0.92rem;
  min-height: 1.2em;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fff4f2;
}

.form-status {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  margin-top: 0.8rem;
}

.form-status[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #081119;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 2rem;
  padding-block: 2.2rem 1.4rem;
}

.footer h3 { font-family: var(--font-body); font-size: 1.05rem; color: var(--gold-light); margin-bottom: 0.7rem; }

.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.footer a { color: var(--text-mid); text-decoration: none; }
.footer a:hover { color: var(--gold-light); text-decoration: underline; }
.footer p { color: var(--text-mid); font-size: 0.98rem; }

.footer__bottom {
  border-top: 1px solid var(--line-soft);
  padding-block: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.social-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.social-links a,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--navy-700);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  color: var(--text-hi);
  text-decoration: none;
  font-weight: 600;
}

.social-links a:hover { border-color: var(--gold); color: var(--gold-light); }

/* ---------- Back to top ---------- */
.back-top {
  position: fixed;
  bottom: 1.2rem;
  inset-inline-end: 1.2rem;
  z-index: 90;
  background: var(--gold);
  color: #141a08;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 480px; margin-inline: auto; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: fixed;
    inset: 0;
    background: rgba(8, 17, 25, 0.98);
    z-index: 120;
    padding: 4.5rem 1.5rem 1.5rem;
    display: none;
  }

  .primary-nav.is-open { display: block; }

  .primary-nav ul { flex-direction: column; gap: 0.4rem; }

  .primary-nav a { display: block; font-size: 1.25rem; padding: 0.9rem 0.6rem; }

  .nav-close {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
  }
}

/* Reduced motion — accessibility */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header, .site-footer, .back-top, .ticker, .social-links { display: none; }
  body { background: #fff; color: #000; }
  .card, .stat, .def { background: #fff; border-color: #999; }
  h1, h2, h3, h4 { color: #000; }
}