/* The small legal pages (/privacy/, /terms/): the site's fonts and colours,
   nothing else loaded. */

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0020, U+00A0, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-latin-letters.woff2") format("woff2");
  unicode-range: U+0041-005A, U+0061-007A;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0021-0040, U+005B-0060, U+007B-007E, U+2013-2014, U+2018-201D, U+2022, U+2026;
}

@font-face {
  font-family: "Aref Ruqaa";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/aref-ruqaa-arabic.woff2") format("woff2");
  unicode-range: U+0020-0021, U+00A0, U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  /* gold tokens (site redesign W1): every gold in the site CSS is one of these
     triplets, used as rgb(var(--gold-…-rgb)) / rgba(var(--gold-…-rgb), a).
     assets/js/look.js swaps them for the member's colour before the first paint.
     Same block in main.css, page.css, comp.css, legal.css, xp-clip.css (tests/gold-tokens.test.mjs). */
  --gold-rgb: 215, 170, 80;
  --gold-1a1205-rgb: 26, 18, 5;
  --gold-1b1203-rgb: 27, 18, 3;
  --gold-3b2a0a-rgb: 59, 42, 10;
  --gold-4e3e1e-rgb: 78, 62, 30;
  --gold-6f4f1b-rgb: 111, 79, 27;
  --gold-8a6a2c-rgb: 138, 106, 44;
  --gold-8c6423-rgb: 140, 100, 35;
  --gold-a8792b-rgb: 168, 121, 43;
  --gold-a97b2c-rgb: 169, 123, 44;
  --gold-b8862f-rgb: 184, 134, 47;
  --gold-b8862f-shade-rgb: 184, 134, 47;
  --gold-b98a35-rgb: 185, 138, 53;
  --gold-c39340-rgb: 195, 147, 64;
  --gold-c89235-rgb: 200, 146, 53;
  --gold-c8973f-rgb: 200, 151, 63;
  --gold-c99135-rgb: 201, 145, 53;
  --gold-c99a45-rgb: 201, 154, 69;
  --gold-c9ad74-rgb: 201, 173, 116;
  --gold-d8ab51-rgb: 216, 171, 81;
  --gold-dcb45f-rgb: 220, 180, 95;
  --gold-deep-rgb: 107, 76, 23;
  --gold-e0b55c-rgb: 224, 181, 92;
  --gold-e3b862-rgb: 227, 184, 98;
  --gold-e3cf9f-rgb: 227, 207, 159;
  --gold-e6be64-rgb: 230, 190, 100;
  --gold-e7c27a-rgb: 231, 194, 122;
  --gold-e9d3a1-rgb: 233, 211, 161;
  --gold-f0d28c-rgb: 240, 210, 140;
  --gold-f0d296-rgb: 240, 210, 150;
  --gold-f0d8a0-rgb: 240, 216, 160;
  --gold-f2dcaa-rgb: 242, 220, 170;
  --gold-f2e4c4-rgb: 242, 228, 196;
  --gold-f3d48e-rgb: 243, 212, 142;
  --gold-f4dfae-rgb: 244, 223, 174;
  --gold-f6dda0-rgb: 246, 221, 160;
  --gold-f6dfa4-rgb: 246, 223, 164;
  --gold-f7d796-rgb: 247, 215, 150;
  --gold-f7dc9b-rgb: 247, 220, 155;
  --gold-f7dc9e-rgb: 247, 220, 158;
  --gold-f7e2ad-rgb: 247, 226, 173;
  --gold-fbf6ec-rgb: 251, 246, 236;
  --gold-ffe9ba-rgb: 255, 233, 186;
  --gold-fff1c9-rgb: 255, 241, 201;
  --gold-fff4d6-rgb: 255, 244, 214;
  --gold-fff6dc-rgb: 255, 246, 220;
  --gold-hi-rgb: 242, 210, 139;
  --gold-ink-rgb: 27, 19, 6;
  --gold-light-rgb: 255, 236, 190;
  --gold-soft-rgb: 231, 207, 156;
  /* end gold tokens */

  color-scheme: dark;
  --navy: #030b18;
  --navy-2: #08213d;
  --gold: rgb(var(--gold-rgb));
  --gold-hi: rgb(var(--gold-hi-rgb));
  --gold-line: rgba(var(--gold-hi-rgb), .14);
  --gold-line-strong: rgba(var(--gold-hi-rgb), .36);
  --text: #eef2f8;
  --text-2: #b9c5d6;
  --line: rgba(var(--gold-hi-rgb), .2);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--navy);
}

body {
  margin: 0;
  min-height: 100vh;
  padding: max(28px, env(safe-area-inset-top)) 16px 48px;
  font-family: "Cairo", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
  background:
    radial-gradient(70% 40% at 50% 0%, rgba(var(--gold-rgb), .1), transparent 70%),
    linear-gradient(180deg, #0a2140, var(--navy) 420px);
}

.legal {
  width: min(100%, 720px);
  margin: 0 auto;
}

.legal__head {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 28px;
  text-align: center;
}

.legal__head img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px -18px rgba(var(--gold-rgb), .55);
}

.legal__site {
  margin: 0;
  font-size: .9rem;
  color: var(--text-2);
}

h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--gold-hi);
}

.legal__updated {
  margin: 0;
  font-size: .82rem;
  color: var(--text-2);
}

section {
  margin-top: 18px;
  padding: 22px 22px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16, 44, 80, .55), rgba(7, 24, 46, .55));
}

h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-hi);
}

ul {
  margin: 0 0 14px;
  padding-inline-start: 1.2em;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--gold);
}

p {
  margin: 0 0 14px;
}

[lang="en"] {
  font-family: "Cairo", system-ui, sans-serif;
  line-height: 1.75;
}

a {
  color: var(--gold-hi);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
  border-radius: 4px;
}

.legal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 28px;
  font-size: .9rem;
}

/* moving between the site's pages feels like one app: the browser keeps the bar still and fades the page
   (Phase 8 track P, assets/js/nav.js). Where unsupported, the page simply loads. */
@view-transition {
  navigation: auto;
  types: site-page;
}

/* only for a move between pages (the type), so a page's own transitions (the account's sign-in) stay as they were */
html:active-view-transition-type(site-page) :is(.topbar, .pbar, .cbar) {
  view-transition-name: site-topbar;
}

html:active-view-transition-type(site-page) .tabbar {
  view-transition-name: site-tabbar;
}

html:active-view-transition-type(site-page)::view-transition-old(root),
html:active-view-transition-type(site-page)::view-transition-new(root) {
  animation-duration: .22s;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}


/* ---------- the site's bar (site redesign W1: one bar on every page) ---------- */

.lbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, calc((100% - 820px) / 2)) 10px;
  background: rgba(4, 17, 39, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gold-line);
}

.lbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.lbar__brand img {
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--gold-line-strong);
}

.lbar__brand span {
  font-family: "Aref Ruqaa", serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gold-hi);
}

.lbar__home {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--gold-line-strong);
  border-radius: 999px;
  color: var(--gold-hi);
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
}

.lbar a:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
}


/* ---------- the text pages in the S8 look (site wave 3: /about/ «عن الأسرة», /about-site/ «عن الموقع»;
   the same pieces dress privacy/terms in W9) ---------- */

html.legal-s8 {
  scroll-padding-top: 130px;
}

.legal-toc {
  position: sticky;
  top: 61px;
  z-index: 15;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 18px -16px 6px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(2, 9, 20, .96), rgba(2, 9, 20, .85));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-block: 1px solid rgba(var(--gold-hi-rgb), .1);
}

.legal-toc::-webkit-scrollbar {
  display: none;
}

.legal-toc a {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(var(--gold-hi-rgb), .2);
  border-radius: 999px;
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.legal-toc a.on {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: transparent;
  color: rgb(var(--gold-1b1203-rgb));
}

.legal-s8 .legal > section {
  margin: 14px 0 0;
  padding: 18px 18px 8px;
  border-radius: 22px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
}

.legal-s8 .legal > section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.legal-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--gold-line-strong);
  background: rgba(var(--gold-rgb), .16);
  color: var(--gold-hi);
  font-size: .95rem;
  font-weight: 900;
}

.legal-s8 .legal > .legal-lead {
  border-color: rgba(var(--gold-hi-rgb), .4);
  background: radial-gradient(90% 70% at 100% 0%, rgba(var(--gold-rgb), .16), transparent 60%), rgba(255, 255, 255, .03);
}

.legal-s8 .legal > .legal-lead h2 {
  font-family: "Aref Ruqaa", serif;
  font-size: 1.6rem;
  color: var(--gold-hi);
}

.legal-s8 .legal > .legal-lead p {
  font-size: 1.05rem;
  line-height: 2;
}

/* privacy / terms (site W9, S8): the English summary folded under its title */
.legal-toc__en {
  direction: ltr;
}

.legal-en {
  direction: ltr;
  text-align: left;
}

.legal-en summary {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 4px 0 10px;
  color: var(--gold-hi);
}

.legal-en summary h2 {
  display: inline;
  margin: 0;
  font: inherit;
  color: inherit;
}

.legal-en summary:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
  border-radius: 6px;
}

/* the actions under a section: a call, WhatsApp, the map */
.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}

.legal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--gold-line-strong);
  border-radius: 999px;
  color: var(--gold-hi);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
}

.legal-btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.legal-btn--primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: transparent;
  color: rgb(var(--gold-1b1203-rgb));
}

.legal-btn--wa {
  border-color: rgba(37, 211, 102, .38);
  background: rgba(37, 211, 102, .09);
  color: var(--text);
}

.legal-btn--wa svg {
  color: #25d366;
}

/* two ways to reach us, side by side on a wide screen */
.legal-ways {
  display: grid;
  gap: 12px;
  margin: 6px 0 14px;
}

@media (min-width: 640px) {
  .legal-ways {
    grid-template-columns: 1fr 1fr;
  }
}

.legal-way {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px 2px;
  border: 1px solid var(--gold-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
}

.legal-way h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-hi);
}

.legal-way__who {
  margin: 0;
  font-size: .9rem;
  color: var(--text-2);
}

.legal-way p {
  margin-bottom: 8px;
}

/* «ده مش دعم فني»: the line that sends a question to the right person */
.legal-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-inline-start: 3px solid var(--gold);
  border-radius: 10px;
  background: rgba(var(--gold-rgb), .08);
  font-size: .94rem;
}

/* the projects: a quiet list, not a gallery */
.legal-projects {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.legal-projects > li {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--gold-line);
}

.legal-projects > li:first-child {
  border-top: 0;
  padding-top: 2px;
}

.legal-projects h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.legal-projects p {
  margin: 0 0 6px;
  color: var(--text-2);
}

.legal-projects__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: .9rem;
}

/* inline-block, not flex: the words and the <bdi> name keep their spaces */
.legal-projects__links a {
  display: inline-block;
  padding: 4px 0;
  line-height: 24px;
}

.legal-foot-links a,
.legal__foot a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

/* back to the top */
.legal-up {
  position: fixed;
  z-index: 30;
  inset-inline-start: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--gold-line-strong);
  border-radius: 50%;
  background: rgba(6, 26, 49, .92);
  color: var(--gold-hi);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .25s, transform .3s;
  box-shadow: 0 12px 30px -12px #000;
}

.legal-up.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.legal-up svg {
  width: 22px;
  height: 22px;
}

.legal-up:focus-visible,
.legal-btn:focus-visible,
.legal-toc a:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .legal-up {
    transition: none;
  }
}
