:root {
  --bg: #f1efe8;
  --fg: #7b4a1d;
  --dim: rgba(123, 74, 29, .82);
  --faint: rgba(123, 74, 29, .60);
  --hair: rgba(123, 74, 29, .18);
  --accent: #cda22a;
  --accent-text: #a67810;
  --sage: #a1b480;
  --paper: #ffffff;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --vignette-z: 1;
  --vignette-edge: rgba(123, 74, 29, .14);
  --rise-distance: 20px;
  --contact-bar-h: 96px;
  --header-padding: clamp(20px, 3.4vw, 40px);
  --wordmark-height: clamp(52px, 6.2vw, 72px);
  --nav-gap: clamp(18px, 2.5vw, 36px);
  --nav-mobile-gap: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
  background: var(--bg);
  color: var(--fg);
  font-family: "Cairo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--fg); }
a { color: inherit; text-decoration: none; }
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 30px;
  height: 1px;
  background: var(--faint);
  content: "";
}
html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"] {
  direction: ltr;
  text-align: left;
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: var(--vignette-z);
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 44%, var(--vignette-edge) 100%);
}

@keyframes fade {
  to { opacity: 1; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(var(--rise-distance)); }
  to { opacity: 1; transform: none; }
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  direction: ltr;
  /* flex-start (not space-between) so the only flexible gap is the one
     .nav's margin-inline-start:auto creates before it — this keeps the
     nav pinned flush against .header-actions (language link/menu button)
     instead of leaving an uneven gap before it. */
  justify-content: flex-start;
  align-items: center;
  padding: var(--header-padding);
}
.top--solid {
  background: rgba(241, 239, 232, .96);
  border-bottom: 1px solid var(--hair);
}
.top--animated {
  opacity: 0;
  animation: fade 1s var(--ease) .1s forwards;
}
.wordmark img {
  display: block;
  width: auto;
  height: var(--wordmark-height);
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(241, 239, 232, .94);
  color: var(--fg);
  font: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}
.nav {
  display: flex;
  /* Physical (not logical) margin: .top is always direction:ltr, and on
     Arabic pages .nav gets its own direction:rtl below to mirror the link
     order. margin-inline-start resolves against an element's OWN
     direction, so once .nav is rtl it would silently flip to margin-right
     and push the nav toward the logo instead of the language button.
     margin-left stays anchored to .top's ltr flow regardless. */
  margin-left: auto;
  gap: var(--nav-gap);
  font-size: clamp(20.8px, 1.755vw, 27.3px);
  font-weight: 400;
}
/* .top stays direction:ltr so the wordmark and header-actions (language
   switcher, menu button) keep their fixed left/right positions on Arabic
   pages. Reversing direction on just the nav flips the link order to read
   right-to-left, matching Arabic reading order, without moving the logo
   or language button. */
html[dir="rtl"] .nav {
  direction: rtl;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 3px;
  color: var(--dim);
  transition: color .3s;
}
.nav a:hover,
.nav a.active { color: var(--accent-text); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: var(--nav-gap);
}
.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--accent-text);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1;
}

.pager { display: flex; justify-content: space-between; font-size: 17px; color: var(--faint); }
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  pointer-events: auto;
  color: var(--accent-text);
  transition: color .3s;
}
.pager a:hover { color: var(--fg); }

.site-contact {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px 20px;
  border-top: 1px solid var(--hair);
  padding: clamp(18px, 3vw, 30px) clamp(20px, 3.4vw, 40px);
  background: rgba(241, 239, 232, .72);
  color: var(--dim);
  font-size: 15px;
  line-height: 1.45;
}
.site-contact .social-links {
  margin-inline-start: auto;
}
.site-contact strong {
  display: block;
  color: var(--accent-text);
  font-weight: 600;
  letter-spacing: .04em;
}
.site-contact a {
  color: var(--dim);
  border-bottom: 1px solid transparent;
  transition: color .3s, border-color .3s;
}
.site-contact a:hover { color: var(--accent-text); border-color: rgba(205, 162, 42, .48); }
.contact-social-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.social-links { display: flex; align-items: center; gap: 12px; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--dim);
  border: 0;
}
.social-links a:hover { color: var(--accent-text); }
.social-links svg { display: block; width: 20px; height: 20px; fill: currentColor; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

@media (max-width: 820px) {
  .top { align-items: flex-start; }
  .top.nav-open { opacity: 1; animation: none; }
  .nav-toggle { display: inline-flex; }
  .nav {
    margin-inline-start: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: var(--header-padding);
    right: var(--header-padding);
    display: none;
    grid-template-columns: 1fr;
    gap: 4px;
    max-width: none;
    padding: 10px;
    border: 1px solid var(--hair);
    border-radius: 16px;
    background: var(--bg);
    box-shadow: 0 18px 44px rgba(90, 52, 16, .14);
    font-size: 18.2px;
  }
  .header-actions { margin-inline-start: auto; gap: 8px; }
  .language-link { min-height: 48px; padding-inline: 14px; font-size: 18px; }
  .top.nav-open .nav { display: grid; }
  .nav a {
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 10px;
  }
  .nav a:hover,
  .nav a.active { background: rgba(123, 74, 29, .07); }
}
@media (max-width: 760px) {
  .site-contact { flex-direction: column; gap: 8px; }
  .site-contact > a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-contact .social-links { margin-inline-start: 0; }
  .mobile-compact-flow .page {
    min-height: auto;
    padding-bottom: 24px;
  }
  .mobile-compact-flow .pager { position: static; margin-top: 0; }
}
