/* ═══════════════════════════════════════════════════════════════
   LEGAL — Dubai Flea Market Intelligence v2
   Privacy Policy + Terms of Service pages
   ═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ───────────────────────────── */
.legal-page {
  background: var(--bg);
  min-height: 100svh;
}

/* ── Hero intro card ────────────────────────── */
.legal-hero {
  background: linear-gradient(135deg, #1a2e4a 0%, var(--dark) 100%);
  padding: 5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(212,168,67,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.legal-hero::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(212,168,67,0.15) 0%, transparent 65%);
  pointer-events: none;
}

.legal-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) { .legal-hero-inner { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .legal-hero-inner { padding: 0 2rem; } }

.legal-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text-invert);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0.875rem 0 0.625rem;
}

.legal-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.legal-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: rgba(212,168,67,0.12);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 600;
}


/* ══════════════════════════════════════════════
   STICKY FIX — overflow-x: hidden on html/body
   breaks position: sticky. Use clip instead.
   clip prevents overflow visually but does NOT
   create a scroll container, so sticky works.
   ══════════════════════════════════════════════ */
html:has(body.legal-dark),
body.legal-dark {
  overflow-x: clip;
}


/* ══════════════════════════════════════════════
   SINGLE-COLUMN LAYOUT
   ══════════════════════════════════════════════ */

.legal-shell {
  max-width: 56rem;
  margin: 0 auto;
  padding: 3rem 1rem 5rem;
}

@media (min-width: 640px) { .legal-shell { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .legal-shell { padding-left: 2rem; padding-right: 2rem; } }


/* ── Article ────────────────────────────────── */

.legal-article {
  min-width: 0;
}

/* Individual section card */
.legal-section {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 5.5rem; /* offset for fixed header */
}

.legal-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.legal-section-title h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  padding-left: 0.75rem;
  border-left: 3px solid var(--gold);
}

/* Icon box inside section headings */
.icon-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--gold-tint);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.icon-section svg {
  width: 1.125rem;
  height: 1.125rem;
}

.legal-section p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0.875rem;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

/* Lists */
.legal-section ul,
.legal-section ol {
  margin: 0.625rem 0 0.875rem 0;
  padding: 0;
  list-style: none;
}

.legal-section li {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
  padding: 0.2rem 0 0.2rem 1.5rem;
  position: relative;
}

.legal-section ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.6rem;
  top: 0.55rem;
}

/* Suppress bullet when using icon-based flex list items */
.legal-section li:has(.legal-list-icon)::before {
  display: none;
}

.legal-section li:has(.legal-list-icon) {
  padding-left: 0;
  position: static;
}

.legal-section ol {
  counter-reset: legal-item;
}

.legal-section ol li {
  counter-increment: legal-item;
}

.legal-section ol li::before {
  content: counter(legal-item) '.';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 700;
  top: 0.3rem;
  font-family: var(--font-mono);
}

/* Callout block */
.legal-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
}

.legal-callout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: #7A5A10;
}

.legal-callout-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.legal-callout-text {
  flex: 1;
  min-width: 0;
}

.legal-callout-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #7A5A10;
  margin-bottom: 0.25rem;
}

.legal-callout-desc {
  font-size: 0.8125rem;
  color: #856308;
  line-height: 1.6;
}

.legal-callout p {
  font-size: 0.875rem;
  color: #7A5A10;
  margin: 0;
}

/* Bold in legal sections */
.legal-section strong {
  font-weight: 700;
  color: var(--text);
}

/* Links in article */
.legal-section a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.legal-section a:hover {
  color: var(--gold-bright);
}

/* List item icon */
.legal-list-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--gold);
}

/* Contact block */
.legal-contact-block {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--text);
  margin-top: 0.5rem;
}


/* ══════════════════════════════════════════════
   DARK THEME — Privacy & Terms pages
   Add class="legal-dark" to <body> to activate
   ══════════════════════════════════════════════ */

.legal-dark {
  background-color: var(--dark);
  color: var(--dark-text);
}

/* ── Header ────────────────────────────────── */
/* Override the light Tailwind utility classes on the <header> */
.legal-dark .landing-header,
.legal-dark .landing-header.header-scrolled {
  background-color: rgba(6, 13, 26, 0.92);
  border-bottom-color: rgba(212, 168, 67, 0.10);
}

/* Dashboard CTA button → gold so it reads on dark header */
.legal-dark .landing-header .btn-primary {
  background-color: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
  font-weight: 700;
}

.legal-dark .landing-header .btn-primary:hover {
  background-color: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.35);
}

/* ── Text colour overrides ──────────────────── */
.legal-dark .text-navy-800 {
  color: rgba(255, 255, 255, 0.92);
}

.legal-dark .text-slate-500,
.legal-dark .text-slate-600,
.legal-dark .text-slate-700 {
  color: var(--dark-muted);
}

/* ── Section cards ───────────────────────────── */
.legal-dark .legal-section {
  background-color: var(--dark-surface);
  border-color: var(--dark-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

.legal-dark .legal-section-title h2 {
  color: rgba(255, 255, 255, 0.92);
  border-left-color: var(--gold);
}

.legal-dark .icon-section {
  background-color: rgba(212, 168, 67, 0.10);
  border-color: rgba(212, 168, 67, 0.20);
  color: var(--gold);
}

.legal-dark .legal-section p,
.legal-dark .legal-section li {
  color: var(--dark-muted);
}

/* ── Callout ─────────────────────────────────── */
.legal-dark .legal-callout {
  background-color: rgba(212, 168, 67, 0.07);
  border-left-color: var(--gold);
}

.legal-dark .legal-callout-icon {
  color: var(--gold);
}

.legal-dark .legal-callout-title {
  color: var(--gold-bright);
}

.legal-dark .legal-callout-desc,
.legal-dark .legal-callout p {
  color: rgba(212, 168, 67, 0.70);
}

/* ── "Back to Home" minimal link ────────────── */
.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, gap 0.15s;
  padding: 0.25rem 0;
}

.legal-back-link svg {
  flex-shrink: 0;
  transition: transform 0.15s;
}

.legal-back-link:hover {
  color: var(--gold);
}

.legal-back-link:hover svg {
  transform: translateX(-3px);
}

.legal-dark .legal-back-link {
  color: rgba(255,255,255,0.35);
}

.legal-dark .legal-back-link:hover {
  color: var(--gold);
}

/* ── Footer ──────────────────────────────────── */
.legal-dark footer {
  background-color: var(--dark-surface);
  border-top-color: var(--dark-border);
  color: var(--dark-muted);
}

/* Brand name in dark footer */
.legal-dark footer .font-semibold {
  color: rgba(255,255,255,0.88);
}

.legal-dark .footer-link {
  color: var(--dark-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.legal-dark .footer-link:hover {
  color: rgba(255,255,255,0.75);
}

/* Active page link in footer */
.legal-dark .footer-link[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
}
