/* =====================================================
   DIGITEREX — LEGAL PAGES STYLESHEET
   Used by: privacy-policy.php, terms.php
===================================================== */

/* ── PAGE WRAPPER ── */
.legal-page {
  padding-top: calc(var(--nav-h) + 60px);
  padding-bottom: 100px;
}

/* ── TWO-COLUMN LAYOUT ── */
.legal-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 64px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 72px);
  align-items: start;
}

/* ── STICKY SIDENAV ── */
.legal-sidenav {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100vh - var(--nav-h) - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
  padding-bottom: 16px;
}

.legal-sidenav::-webkit-scrollbar {
  width: 3px;
}

.legal-sidenav::-webkit-scrollbar-track {
  background: transparent;
}

.legal-sidenav::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 2px;
}

.legal-nav-title {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text3);
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
}

.legal-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 10px 7px 12px;
  border-radius: var(--r-sm);
  font-size: .74rem;
  color: var(--text3);
  line-height: 1.45;
  transition: all .2s;
  border-left: 2px solid transparent;
  text-decoration: none;
}

[dir="rtl"] .legal-nav-link {
  border-left: none;
  border-right: 2px solid transparent;
  padding: 7px 12px 7px 10px;
}

.legal-nav-link:hover {
  color: var(--text2);
  background: var(--surface);
}

.legal-nav-link.active {
  color: var(--lime);
  background: var(--lime-dim);
  border-left-color: var(--lime);
  font-weight: 700;
}

[dir="rtl"] .legal-nav-link.active {
  border-left-color: transparent;
  border-right-color: var(--lime);
}

.legal-nav-num {
  font-size: .6rem;
  font-weight: 700;
  color: inherit;
  opacity: .6;
  flex-shrink: 0;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* ── CONTENT AREA ── */
.legal-content {
  min-width: 0;
}

/* ── HEADER ── */
.legal-header {
  margin-bottom: 52px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line2);
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 18px;
}

.legal-title {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: .94;
  letter-spacing: .02em;
  color: var(--text);
  margin-bottom: 16px;
}

[lang="ar"] .legal-title {
  font-family: var(--f-ar);
  letter-spacing: 0;
  line-height: 1.1;
}

.legal-meta {
  font-size: .8rem;
  color: var(--text3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.legal-meta span {
  color: var(--lime);
  font-weight: 700;
}

/* ── SECTIONS ── */
.legal-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--nav-h) + 32px);
}

.legal-section-num {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 8px;
}

.legal-section h2 {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--text);
  margin-bottom: 20px;
}

[lang="ar"] .legal-section h2 {
  font-family: var(--f-ar);
  letter-spacing: 0;
  line-height: 1.2;
}

.legal-section p {
  font-size: .87rem;
  color: var(--text2);
  line-height: 1.85;
  margin-bottom: 14px;
}

.legal-section ul,
.legal-section ol {
  padding-inline-start: 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-section li {
  font-size: .87rem;
  color: var(--text2);
  line-height: 1.75;
}

.legal-section ul li::marker {
  color: var(--lime);
}

.legal-section a {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity .2s;
}

.legal-section a:hover {
  opacity: .75;
}

/* ── HIGHLIGHT BOX ── */
.legal-highlight {
  background: var(--surface);
  border: 1px solid var(--line2);
  border-inline-start: 3px solid var(--lime);
  border-radius: var(--r-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.legal-highlight p {
  margin-bottom: 0;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.65;
}

/* ── DIVIDER ── */
.legal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2), transparent);
  margin: 44px 0;
}

/* ── CONTACT CARD ── */
.legal-contact-card {
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 28px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.legal-contact-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  background: var(--lime-dim);
  border: 1px solid rgba(180, 248, 0, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime);
  font-size: .95rem;
  flex-shrink: 0;
}

.legal-contact-card h3 {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.legal-contact-card p {
  font-size: .82rem;
  margin-bottom: 0;
  line-height: 1.7;
}

/* ── MOBILE (< 960px) ── */
@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .legal-sidenav {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--line2);
    border-radius: var(--r);
    padding: 20px;
    background: var(--surface);
  }

  .legal-nav-title {
    margin-bottom: 14px;
  }

  .legal-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .legal-nav-link {
    border: 1px solid var(--line2);
    border-left: 2px solid transparent;
    border-radius: var(--r-pill);
    background: var(--bg2);
    padding: 5px 12px;
    font-size: .7rem;
    gap: 5px;
  }

  [dir="rtl"] .legal-nav-link {
    border-right: 2px solid transparent;
  }

  .legal-nav-link.active {
    border-color: rgba(180, 248, 0, .4);
  }

  .legal-nav-num {
    display: none;
  }
}
