/* Full Option — shared stylesheet for the standalone pages.
 *
 * Tokens are lifted from the live site (cream #F5F0E8 / gold #D4AF37 /
 * ink #1A1A1A, Cairo for Arabic and Poppins for Latin) so these pages read as
 * the same site rather than a bolt-on. Nothing here depends on the SPA bundle:
 * every page is plain HTML that works if dropped anywhere under public_html.
 */

:root {
  --cream:      #F5F0E8;
  --cream-2:    #FBF8F3;
  --paper:      #FFFFFF;
  --ink:        #1A1A1A;
  --body:       #333333;
  --muted:      #6B6459;
  --line:       #E2DACB;
  --line-soft:  #EDE7DB;
  --gold:       #D4AF37;
  --gold-dark:  #9C7F1E;
  --gold-wash:  #FAF3DE;
  --alert:      #9C2B2B;
  --alert-wash: #FBEEEE;

  --ar: "Cairo", system-ui, -apple-system, sans-serif;
  --la: "Poppins", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --measure: 68ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--body);
  font-family: var(--ar);
  font-size: 17px;
  line-height: 1.95;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------------ shell */

.bar {
  background: var(--ink);
  border-bottom: 3px solid var(--gold);
}
.bar-in {
  max-width: 74rem;
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.6rem;
}
.brand {
  font-family: var(--la);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: .01em;
  margin-inline-end: auto;
}
.brand span { color: var(--gold); }
.bar nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.bar nav a {
  color: #CFC8BB;
  text-decoration: none;
  font-size: .93rem;
  padding: .15rem 0;
  border-bottom: 2px solid transparent;
}
.bar nav a:hover { color: var(--cream); border-bottom-color: var(--gold); }
.bar nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1.5rem; }
.doc  { max-width: 52rem; margin: 0 auto; padding: 0 1.5rem; }

/* ------------------------------------------------------------------- head */

.page-head {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}
.kicker {
  font-family: var(--la);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin: 0 0 .7rem;
  direction: ltr;
  text-align: right;
}
h1 {
  font-family: var(--ar);
  font-weight: 700;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 1rem 0 0;
}
.stamp {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  margin: 1.25rem 0 0;
}

/* ------------------------------------------------------------------- type */

h2 {
  font-family: var(--ar);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 3rem 0 .9rem;
  text-wrap: balance;
}
h2:first-child { margin-top: 0; }
h3 {
  font-family: var(--ar);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
  margin: 2rem 0 .5rem;
}
p { margin: 0 0 1.1rem; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.2rem; padding-inline-start: 1.4rem; max-width: var(--measure); }
li { margin-bottom: .55rem; }
li::marker { color: var(--gold-dark); }

a { color: var(--gold-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; border-radius: 3px; }

strong { color: var(--ink); font-weight: 700; }

code, .mono {
  font-family: var(--mono);
  font-size: .86em;
  direction: ltr;
  unicode-bidi: isolate;
}
code {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .1em .38em;
}

/* ------------------------------------------------------------------ parts */

section { scroll-margin-top: 5rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.4rem 1.6rem;
  margin: 1.5rem 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.note {
  border-inline-start: 4px solid var(--gold);
  background: var(--gold-wash);
  padding: 1.05rem 1.3rem;
  border-radius: 0 4px 4px 0;
  margin: 1.5rem 0;
}
.note.alert { border-color: var(--alert); background: var(--alert-wash); }
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }

.grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.75rem 0;
}
.cell {
  background: var(--paper);
  padding: 1.35rem 1.5rem;
  display: grid;
  gap: .35rem;
  align-content: start;
}
.cell h3 { margin: 0; font-size: 1.02rem; }
.cell p { font-size: .95rem; color: var(--muted); margin: 0; line-height: 1.8; }

.net {
  font-family: var(--la);
  font-size: .7rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--gold-dark);
  direction: ltr;
  text-align: right;
}

.scroll { overflow-x: auto; margin: 1.75rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 32rem; }
th, td { text-align: right; padding: .8rem .95rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th {
  font-size: .82rem;
  letter-spacing: .03em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--cream-2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }

.toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.2rem 1.5rem;
  margin: 0 0 2.5rem;
}
.toc p { font-weight: 700; color: var(--ink); margin: 0 0 .6rem; font-size: .95rem; }
.toc ol { margin: 0; padding-inline-start: 1.3rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: .3rem; font-size: .93rem; break-inside: avoid; }
@media (max-width: 40rem) { .toc ol { columns: 1; } }

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: .7rem 1.6rem;
  border-radius: 3px;
  border: 1px solid var(--gold-dark);
}
.btn:hover { background: var(--gold-dark); color: var(--cream); }
.btn.ghost { background: transparent; color: var(--gold-dark); }
.btn.ghost:hover { background: var(--gold-wash); color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 0; }

/* ----------------------------------------------------------------- footer */

footer.site {
  margin-top: 5rem;
  background: var(--ink);
  color: #B9B2A5;
  padding: 2.5rem 0 2rem;
  font-size: .92rem;
}
footer.site .wrap { display: grid; gap: 1.75rem; }
footer.site a { color: var(--gold); }
footer.site a:hover { color: var(--cream); }
.foot-cols {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.foot-cols h4 {
  font-family: var(--la);
  font-size: .74rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--cream);
  margin: 0 0 .6rem;
  direction: ltr;
  text-align: right;
}
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { margin-bottom: .4rem; }
.foot-note {
  border-top: 1px solid #2E2E2E;
  padding-top: 1.5rem;
  color: #8B8578;
  font-size: .85rem;
}
.foot-note p { max-width: none; margin: 0 0 .4rem; }

.skip {
  position: absolute;
  right: -9999px;
  background: var(--gold);
  color: var(--ink);
  padding: .6rem 1rem;
  z-index: 10;
}
.skip:focus { right: 1rem; top: 1rem; }

/* The subscribe button lives in the dark bar, so it needs its own contrast:
 * solid gold on ink reads as the one action on the page, and it sits before
 * the nav in source order so keyboard users reach it first. */
.bar .btn.subscribe {
  padding: .38rem 1.15rem;
  font-size: .92rem;
  border-radius: 3px;
  background: var(--gold);
  color: var(--ink);
  border: 1px solid var(--gold);
  white-space: nowrap;
}
.bar .btn.subscribe:hover { background: #E8C860; border-color: #E8C860; color: var(--ink); }
.bar .btn.subscribe:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
@media (max-width: 34rem) { .bar .btn.subscribe { order: 3; } }

/* ------------------------------------------------------------ the English side
 *
 * One stylesheet serves both directions. The Arabic pages set dir="rtl" on
 * <html> and get everything above; the English pages set dir="ltr" and get
 * these overrides. Logical properties (padding-inline, margin-inline) already
 * flip on their own — what needs saying here is only what does not: the type
 * stack, and the few places where text-align was pinned to `right` so Latin
 * eyebrows would sit on the correct edge in an RTL page.
 */

[dir="ltr"] body { font-family: var(--la); font-size: 16.5px; line-height: 1.8; }
[dir="ltr"] h1,
[dir="ltr"] h2,
[dir="ltr"] h3 { font-family: var(--la); font-weight: 600; }
[dir="ltr"] h1 { letter-spacing: -.015em; }
[dir="ltr"] strong { font-weight: 600; }

[dir="ltr"] .kicker,
[dir="ltr"] .net,
[dir="ltr"] .foot-cols h4,
[dir="ltr"] .urls dt { text-align: left; }
[dir="ltr"] th,
[dir="ltr"] td { text-align: left; }

/* ⚠ The measure is set in ch, and a ch is wider in Latin than in Arabic —
 * the same number would run the English lines long. */
[dir="ltr"] { --measure: 72ch; }
[dir="ltr"] .lede { max-width: 52ch; }

/* --------------------------------------------------------- language switch */

.lang {
  font-family: var(--la);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--cream);
  text-decoration: none;
  border: 1px solid #4A443A;
  border-radius: 3px;
  padding: .3rem .65rem;
  white-space: nowrap;
  direction: ltr;
}
.lang:hover { border-color: var(--gold); color: var(--gold); }
.lang:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
