/* ═══════════════════════════════════════════════════════════════
   SADEEM LEGAL PAGE — style.css
   Premium bilingual legal page — dark purple/violet + cyan theme
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. CSS CUSTOM PROPERTIES ── */
:root {
  /* Core palette */
  --bg-base:        #070710;
  --bg-surface:     #0d0d1e;
  --bg-card:        #11112a;
  --bg-card-hover:  #151530;
  --bg-elevated:    #1a1a38;

  /* Purple / Violet */
  --purple-deep:    #1e0b4e;
  --purple-mid:     #3d1a8f;
  --purple-light:   #7c3aed;
  --violet-soft:    #a78bfa;
  --violet-muted:   #6d28d9;

  /* Cyan / Turquoise glow */
  --cyan:           #22d3ee;
  --cyan-glow:      rgba(34, 211, 238, 0.18);
  --cyan-dim:       rgba(34, 211, 238, 0.08);
  --teal:           #2dd4bf;

  /* Text */
  --text-primary:   #f0eeff;
  --text-secondary: #b8b4d8;
  --text-muted:     #6e6a90;
  --text-faint:     #3a3660;

  /* Borders */
  --border-subtle:  rgba(124, 58, 237, 0.15);
  --border-card:    rgba(124, 58, 237, 0.22);
  --border-glow:    rgba(34, 211, 238, 0.3);

  /* Semantic */
  --accent:         var(--cyan);
  --accent-glow:    var(--cyan-glow);

  /* Typography */
  --font-arabic:    'IBM Plex Sans Arabic', sans-serif;
  --font-latin:     'Syne', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Spacing */
  --section-gap:    3.5rem;
  --content-max:    780px;
  --sidebar-w:      260px;

  /* Transitions */
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── 2. RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-arabic);
  line-height: 1.9;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* English language mode — switch to Syne font */
body.lang-en {
  font-family: var(--font-latin);
  direction: ltr;
}

body.lang-en html { direction: ltr; }

::selection {
  background: var(--purple-mid);
  color: #fff;
}

/* ── 3. AMBIENT BACKGROUND ── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: driftOrb 20s ease-in-out infinite alternate;
}

.bg-orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #3b0082, transparent 70%);
  top: -200px; left: -150px;
  animation-duration: 25s;
}

.bg-orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0e4a6e, transparent 70%);
  bottom: 10%; right: -100px;
  animation-duration: 30s;
  animation-delay: -10s;
}

.bg-orb--3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #1e1060, transparent 70%);
  top: 40%; left: 30%;
  animation-duration: 20s;
  animation-delay: -5s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 75%);
}

@keyframes driftOrb {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 60px) scale(1.12); }
}

/* ── 4. SITE HEADER & NAV ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 16, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.scrolled {
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  font-size: 1.4rem;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px var(--cyan));
  line-height: 1;
}

.logo-ar,
.logo-en {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, var(--violet-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body:not(.lang-en) .logo-en,
body.lang-en .logo-ar { display: none; }

/* New: image-based logo */
.logo-img {
  height: 28px;
  width: auto;
  display: block;
  border-radius: 8px;
}

/* Footer logo image */
.footer-brand .footer-logo {
  height: 22px;
  width: auto;
  display: block;
  border-radius: 6px;
}

/* Doc Switcher */
.doc-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 3px;
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}

.doc-tab {
  flex: 1;
  padding: 0.45rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 7px;
  transition: color 0.25s var(--ease);
  font-family: inherit;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.doc-tab.active {
  color: var(--text-primary);
}

.doc-tab-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: calc(50% - 3px);
  background: linear-gradient(135deg, var(--purple-mid), var(--violet-muted));
  border-radius: 6px;
  transition: left 0.3s var(--ease-spring);
  left: 3px;
  box-shadow: 0 0 16px rgba(109, 40, 217, 0.5);
}

.doc-tab-indicator.right {
  left: calc(50%);
}

.doc-tab .tab-ar,
.doc-tab .tab-en { pointer-events: none; }

body:not(.lang-en) .tab-en,
body.lang-en .tab-ar { display: none; }

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-latin);
}

.lang-btn.active {
  color: var(--cyan);
  background: var(--cyan-dim);
}

.lang-divider {
  color: var(--text-faint);
  font-size: 0.75rem;
}

/* ── 5. HERO ── */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.5;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

.eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

body:not(.lang-en) .eyebrow-en,
body.lang-en .eyebrow-ar { display: none; }

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(140deg, #fff 0%, var(--violet-soft) 60%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.lang-en .hero-title {
  font-family: var(--font-latin);
}

body:not(.lang-en) [class*="title-en"],
body.lang-en [class*="title-ar"] { display: none; }

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 2;
}

body:not(.lang-en) .subtitle-en,
body.lang-en .subtitle-ar { display: none; }

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.meta-badge--version {
  border-color: rgba(34, 211, 238, 0.2);
  color: var(--cyan);
}

.badge-icon { font-style: normal; }

body:not(.lang-en) .badge-en,
body.lang-en .badge-ar { display: none; }

/* ── 6. PAGE LAYOUT ── */
.page-layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

/* ── 7. SIDEBAR TOC ── */
.toc-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.toc-sidebar::-webkit-scrollbar {
  width: 3px;
}
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-card);
  border-radius: 99px;
}

.toc-inner {
  padding: 1.5rem 0;
}

.toc-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

body:not(.lang-en) .toc-label .en,
body.lang-en .toc-label .ar { display: none; }

.toc-list {
  list-style: none;
  border-right: 1px solid var(--border-subtle);
  padding-right: 1px;
}

body.lang-en .toc-list {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
  padding-right: 0;
  padding-left: 1px;
}

.toc-link {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  position: relative;
  line-height: 1.5;
}

.toc-link::before {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--cyan);
  border-radius: 99px;
  transition: height 0.2s var(--ease);
}

body.lang-en .toc-link::before {
  right: auto;
  left: -1px;
}

.toc-link:hover,
.toc-link.active {
  color: var(--text-primary);
  background: var(--cyan-dim);
}

.toc-link.active {
  color: var(--cyan);
}

.toc-link.active::before {
  height: 60%;
}

body:not(.lang-en) .toc-link .en,
body.lang-en .toc-link .ar { display: none; }

.toc-print {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.print-btn {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
}

.print-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

body:not(.lang-en) .print-btn .en,
body.lang-en .print-btn .ar { display: none; }

/* ── 8. CONTENT AREA ── */
.content-area {
  flex: 1;
  min-width: 0;
}

/* ── 9. DOCUMENT ARTICLES ── */
.doc-article {
  animation: fadeIn 0.45s var(--ease) both;
}

.doc-article.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 10. SECTIONS ── */
.doc-section {
  margin-bottom: var(--section-gap);
  scroll-margin-top: 90px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

body.lang-en .section-header::after {
  right: auto;
  left: 0;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  opacity: 0.7;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

body.lang-en .section-title {
  font-family: var(--font-latin);
  letter-spacing: -0.02em;
}

body:not(.lang-en) .section-title .en,
body.lang-en .section-title .ar { display: none; }

/* Section body language switching */
.section-body .ar,
.section-body .en {
  display: block;
}

body:not(.lang-en) .section-body .en,
body.lang-en .section-body .ar { display: none; }

.section-body p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.975rem;
  line-height: 1.95;
}

.section-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── 11. COMPONENTS ── */

/* Info Card */
.info-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 12px;
  margin-top: 1.25rem;
}

.info-icon {
  font-style: normal;
  font-size: 1rem;
  color: var(--cyan);
  flex-shrink: 0;
  margin-top: 0.1rem;
  opacity: 0.8;
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(34, 211, 238, 0.85);
}

/* Compliance notice card — distinct amber/warning tone */
.info-card--compliance {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.28);
  align-items: flex-start;
}

.info-card--compliance .info-icon {
  color: #f59e0b;
  font-size: 1.1rem;
}

.info-card--compliance p {
  color: rgba(245, 200, 100, 0.9);
  line-height: 1.8;
}

.info-card--compliance p + p {
  margin-top: 0.5rem;
}

/* Highlight Cards */
.highlight-card {
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
}

.highlight-card:hover {
  border-color: var(--border-glow);
}

.highlight-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--violet-soft);
  margin-bottom: 0.75rem;
}

.highlight-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.highlight-card--warning {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.18);
}

.highlight-card--warning h3 {
  color: #f59e0b;
}

.highlight-card--accent {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(34, 211, 238, 0.04));
  border-color: rgba(124, 58, 237, 0.3);
}

/* Data Grid */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.data-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.data-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.data-card--prohibited {
  border-color: rgba(239, 68, 68, 0.15);
}

.data-card--prohibited:hover {
  border-color: rgba(239, 68, 68, 0.3);
}

.data-card-icon {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.data-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--violet-soft);
  margin-bottom: 0.75rem;
}

body:not(.lang-en) .data-card h3.en,
body.lang-en .data-card h3.ar { display: none; }

.data-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.data-card ul {
  padding-right: 1.1rem;
  margin: 0;
}

body.lang-en .data-card ul {
  padding-right: 0;
  padding-left: 1.1rem;
}

.data-card li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

/* Usage List */
.usage-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.usage-item {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  align-items: flex-start;
}

.usage-item p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0.3rem 0 0;
  line-height: 1.7;
}

.usage-item strong {
  font-size: 0.88rem;
}

.usage-icon {
  color: var(--cyan);
  flex-shrink: 0;
  font-size: 0.75rem;
  margin-top: 0.3rem;
  opacity: 0.8;
}

/* Security Badges */
.security-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.25rem 0;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(34, 211, 238, 0.06));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--violet-soft);
  white-space: nowrap;
}

body:not(.lang-en) .security-badge .en,
body.lang-en .security-badge .ar { display: none; }

/* Rights Grid */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.right-item {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  transition: border-color 0.2s;
}

.right-item:hover { border-color: var(--border-glow); }

.right-item h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

body:not(.lang-en) .right-item h4.en,
body.lang-en .right-item h4.ar { display: none; }

.right-item p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.85rem;
}

.data-table thead {
  background: var(--bg-elevated);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: right;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-card);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

body.lang-en .data-table th { text-align: left; }

.data-table td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
}

body.lang-en .data-table td { text-align: left; }

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--bg-card); }

/* Table: hide language columns based on mode */
body:not(.lang-en) .data-table .en,
body.lang-en .data-table .ar {
  display: none;
}

/* Prohibited List */
.prohibited-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.prohibited-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.prohibited-icon {
  color: #ef4444;
  font-style: normal;
  flex-shrink: 0;
  font-size: 0.9rem;
}

body:not(.lang-en) .prohibited-item .en,
body.lang-en .prohibited-item .ar { display: none; }

/* Contact Card */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 1.25rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.contact-row:last-child { border-bottom: none; }

.contact-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  min-width: 140px;
  flex-shrink: 0;
}

body:not(.lang-en) .contact-label.en,
body.lang-en .contact-label.ar { display: none; }

.contact-val {
  font-size: 0.88rem;
  color: var(--text-primary);
  text-decoration: none;
}

a.contact-val {
  color: var(--cyan);
  transition: opacity 0.2s;
}

a.contact-val:hover { opacity: 0.75; }

body:not(.lang-en) .contact-val.en,
body.lang-en .contact-val.ar { display: none; }

/* Support Contact Block (end of each article) */
.support-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.06), rgba(124, 58, 237, 0.06));
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 14px;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.support-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.support-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.support-text p {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.support-text strong {
  color: var(--text-secondary);
}

.support-email {
  font-size: 0.95rem;
  font-family: var(--font-mono);
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.support-email:hover { opacity: 0.75; }

body:not(.lang-en) .support-text p.en,
body.lang-en .support-text p.ar { display: none; }

/* ── 12. SITE FOOTER ── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-brand .logo-mark {
  font-size: 1rem;
}

body:not(.lang-en) .footer-brand .en,
body.lang-en .footer-brand .ar { display: none; }

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover { color: var(--text-primary); }

body:not(.lang-en) .footer-link .en,
body.lang-en .footer-link .ar { display: none; }

.footer-support {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-support-icon { font-size: 0.9rem; }

.footer-support-email {
  color: var(--cyan);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: opacity 0.2s;
}

.footer-support-email:hover { opacity: 0.75; }

.footer-support-sep {
  color: var(--text-faint);
  font-size: 0.75rem;
}

body:not(.lang-en) .footer-support .en,
body.lang-en .footer-support .ar { display: none; }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-faint);
}

body:not(.lang-en) .footer-copy .en,
body.lang-en .footer-copy .ar { display: none; }

/* ── 13. BACK TO TOP ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 42px; height: 42px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, border-color 0.2s, color 0.2s;
  z-index: 50;
}

body.lang-en .back-to-top {
  left: auto;
  right: 2rem;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--border-glow);
  color: var(--cyan);
}

/* ── 14. UTILITY ── */
.hidden { display: none !important; }

/* Mobile TOC base (hidden by default on desktop) */
.mobile-toc { display: none; }
.mobile-toc-scroller { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem 1rem; scrollbar-width: none; }
.mobile-toc-scroller::-webkit-scrollbar { display: none; }
.mobile-toc-chip {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.mobile-toc-chip:hover { color: var(--text-primary); background: var(--bg-card-hover); border-color: var(--border-glow); }
.mobile-toc-chip.active { color: var(--cyan); background: var(--cyan-dim); border-color: rgba(34, 211, 238, 0.25); }
body:not(.lang-en) .mobile-toc-chip .en,
body.lang-en .mobile-toc-chip .ar { display: none; }

/* ── 15. RESPONSIVE ── */
@media (max-width: 900px) {
  .toc-sidebar {
    display: none;
  }

  /* Mobile TOC bar */
  .mobile-toc {
    display: block;
    position: sticky;
    top: 64px;
    z-index: 90;
    background: rgba(7, 7, 16, 0.82);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--border-subtle);
  }

  .page-layout {
    padding: 0 1.25rem 4rem;
  }

  .nav-inner {
    padding: 0 1.25rem;
    gap: 0.75rem;
  }

  .doc-switcher {
    max-width: 100%;
  }

  .hero {
    padding: 3.5rem 1.25rem 2rem;
  }
}

@media (max-width: 600px) {
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.6rem;
  }

  .logo { order: 1; }
  .lang-toggle { order: 2; margin-right: auto; }
  body.lang-en .lang-toggle { margin-right: 0; margin-left: auto; }
  .doc-switcher { order: 3; width: 100%; max-width: 100%; }

  .hero-title { font-size: 2rem; }

  .data-grid,
  .rights-grid { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .back-to-top {
    bottom: 1.25rem;
    left: 1.25rem;
  }

  body.lang-en .back-to-top {
    left: auto;
    right: 1.25rem;
  }
}

/* ── 16. PRINT STYLES ── */
@media print {
  .bg-layer,
  .site-header,
  .toc-sidebar,
  .back-to-top,
  .doc-switcher,
  .lang-toggle { display: none !important; }

  body {
    background: #fff;
    color: #111;
    font-family: Georgia, serif;
  }

  .page-layout { padding: 0; }
  .content-area { width: 100%; }
  .hero { padding: 2rem 0 1rem; text-align: right; }

  body.lang-en .hero { text-align: left; }

  .hero-title {
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: #111;
    color: #111;
    font-size: 2rem;
  }

  .section-header {
    border-bottom: 2px solid #111;
  }

  .section-num { color: #555; }
  .section-title { color: #111; }

  .section-body p,
  .section-body li { color: #333; }

  .info-card,
  .highlight-card,
  .data-card,
  .usage-item,
  .right-item,
  .contact-card {
    background: #f8f8f8;
    border: 1px solid #ccc;
  }

  .doc-section { break-inside: avoid; page-break-inside: avoid; }

  .site-footer {
    border-top: 1px solid #ccc;
    background: none;
  }

  .footer-copy, .footer-brand, .footer-link { color: #555; }
}

/* ── 17. SMOOTH TRANSITIONS FOR LANGUAGE SWITCH ── */
.doc-article,
.hero-title,
.hero-subtitle,
.hero-meta,
.section-body,
.section-title {
  transition: opacity 0.2s var(--ease);
}

body.lang-switching .doc-article,
body.lang-switching .hero-title,
body.lang-switching .hero-subtitle {
  opacity: 0;
}
