/* Arab Wuwa legal-page family.
   Shared editorial layout for Privacy, Terms, and Refund on the static app shell. */

.aw-legal-main {
  --aw-legal-gutter: clamp(0.75rem, 2.2vw, 2rem);
  position: relative;
  isolation: isolate;
  flex: 1 0 auto;
  min-width: 0;
  inline-size: 100%;
  overflow: clip;
}

.aw-legal-hero {
  position: relative;
  overflow: hidden;
  border-block-end: 1px solid hsl(var(--border));
  background:
    radial-gradient(circle at 82% 18%, hsl(var(--primary) / 0.13), transparent 30%),
    hsl(var(--card) / 0.28);
}

.aw-legal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(hsl(var(--border) / 0.13) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.13) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 88%, transparent);
  pointer-events: none;
}

.aw-legal-hero::after {
  content: "";
  position: absolute;
  inset-inline-start: clamp(24px, 6vw, 88px);
  inset-block-end: -1px;
  width: min(220px, 32vw);
  height: 2px;
  background: hsl(var(--primary));
  box-shadow: 0 0 28px hsl(var(--primary) / 0.34);
}

.aw-legal-hero-inner,
.aw-legal-document {
  inline-size: 100%;
  margin-inline: auto;
}

.aw-legal-hero-inner {
  padding: clamp(48px, 7vw, 84px) var(--aw-legal-gutter) clamp(44px, 6vw, 72px);
}

.aw-legal-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.aw-legal-kicker::before {
  content: "";
  width: 30px;
  height: 2px;
  border-radius: 999px;
  background: hsl(var(--primary));
  box-shadow: 0 0 14px hsl(var(--primary) / 0.34);
}

.aw-legal-hero h1 {
  max-width: 14ch;
  margin: 0;
  color: hsl(var(--foreground));
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 880;
  letter-spacing: -0.052em;
  line-height: 0.98;
  text-wrap: balance;
}

.aw-legal-effective {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 22px 0 0;
  padding: 7px 10px;
  border: 1px solid hsl(var(--border) / 0.82);
  border-radius: var(--radius-sm);
  background: hsl(var(--background) / 0.48);
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.025em;
  line-height: 1.35;
}

.aw-legal-effective time {
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.aw-legal-lede {
  max-width: 72ch;
  margin: 22px 0 0;
  color: hsl(var(--foreground) / 0.76);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.7;
}

.aw-legal-related {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-block-start: 28px;
}

.aw-legal-related a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card) / 0.72);
  color: hsl(var(--foreground) / 0.82);
  box-shadow: inset 0 1px 0 hsl(var(--foreground) / 0.05);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.aw-legal-related a::after {
  content: "\2192";
  color: hsl(var(--primary));
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
}

.aw-legal-related a:hover {
  border-color: hsl(var(--primary) / 0.52);
  background: hsl(var(--primary) / 0.09);
  color: hsl(var(--foreground));
  transform: translateY(-1px);
}

.aw-legal-document {
  padding: clamp(24px, 4vw, 48px) var(--aw-legal-gutter) clamp(72px, 9vw, 112px);
}

.aw-legal-section {
  display: grid;
  grid-template-columns: minmax(190px, 0.62fr) minmax(0, 1.55fr);
  gap: clamp(30px, 6vw, 78px);
  padding-block: clamp(34px, 5vw, 58px);
  border-block-start: 1px solid hsl(var(--border) / 0.72);
  scroll-margin-block-start: calc(var(--header-height) + 24px);
}

.aw-legal-section:first-child {
  border-block-start: 0;
}

.aw-legal-section h2 {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  align-self: start;
  margin: 0;
  color: hsl(var(--foreground));
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 820;
  letter-spacing: -0.028em;
  line-height: 1.18;
  text-wrap: balance;
}

.aw-legal-section-body {
  min-width: 0;
  color: hsl(var(--foreground) / 0.78);
  font-size: clamp(15px, 1.25vw, 16px);
  line-height: 1.78;
}

.aw-legal-section-body > :first-child {
  margin-block-start: 0;
}

.aw-legal-section-body > :last-child {
  margin-block-end: 0;
}

.aw-legal-section p {
  margin: 0 0 1.15em;
}

.aw-legal-section strong {
  color: hsl(var(--foreground));
  font-weight: 760;
}

.aw-legal-section em {
  color: hsl(var(--foreground) / 0.74);
}

.aw-legal-section a {
  color: hsl(var(--primary));
  font-weight: 670;
  text-decoration: underline;
  text-decoration-color: hsl(var(--primary) / 0.48);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.aw-legal-section a:hover {
  color: hsl(var(--foreground));
  text-decoration-color: hsl(var(--primary));
}

.aw-legal-section code {
  padding: 2px 6px;
  border: 1px solid hsl(var(--border) / 0.86);
  border-radius: var(--radius-sm);
  background: hsl(var(--card-strong) / 0.74);
  color: hsl(var(--foreground));
  font: 0.88em/1.5 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  overflow-wrap: anywhere;
}

.aw-legal-list {
  margin: 0 0 1.25em;
  padding-inline-start: 1.35em;
}

.aw-legal-list li {
  padding-inline-start: 0.35em;
}

.aw-legal-list li + li {
  margin-block-start: 0.64em;
}

.aw-legal-list li::marker {
  color: hsl(var(--primary));
  font-weight: 800;
}

.aw-legal-table-wrap {
  max-width: 100%;
  margin-block: 0 1.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid hsl(var(--border) / 0.84);
  border-radius: var(--radius);
  background: hsl(var(--card) / 0.42);
  box-shadow: inset 0 1px 0 hsl(var(--foreground) / 0.04);
  scrollbar-color: hsl(var(--primary) / 0.5) hsl(var(--card));
  scrollbar-width: thin;
}

.aw-legal-table-wrap:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 3px;
}

.aw-legal-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.58;
}

.aw-legal-table thead th {
  padding: 12px 14px;
  border-block-end: 1px solid hsl(var(--border));
  background: hsl(var(--card-strong) / 0.82);
  color: hsl(var(--foreground) / 0.72);
  font-size: 10.5px;
  font-weight: 820;
  letter-spacing: 0.105em;
  text-align: start;
  text-transform: uppercase;
  vertical-align: bottom;
}

.aw-legal-table tbody th,
.aw-legal-table tbody td {
  padding: 13px 14px;
  border-block-end: 1px solid hsl(var(--border) / 0.58);
  text-align: start;
  vertical-align: top;
}

.aw-legal-table tbody th {
  width: 22%;
  background: hsl(var(--card) / 0.66);
  color: hsl(var(--foreground));
  font-weight: 740;
}

.aw-legal-table tbody td {
  background: hsl(var(--card) / 0.34);
  color: hsl(var(--foreground) / 0.74);
}

.aw-legal-table tbody tr:nth-child(even) th {
  background: hsl(var(--card-strong) / 0.54);
}

.aw-legal-table tbody tr:nth-child(even) td {
  background: hsl(var(--card-strong) / 0.3);
}

.aw-legal-table tbody tr:last-child > * {
  border-block-end: 0;
}

.aw-legal-footnote {
  margin-block-start: -0.35rem;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-style: italic;
  line-height: 1.65;
}

.aw-legal-last-updated {
  margin: 12px 0 0;
  padding-block-start: 24px;
  border-block-start: 1px solid hsl(var(--border) / 0.72);
  color: hsl(var(--muted-foreground));
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

a.aw-legal-current {
  color: hsl(var(--foreground));
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: hsl(var(--primary) / 0.72);
  text-underline-offset: 3px;
}

[dir="rtl"] .aw-legal-kicker,
[dir="rtl"] .aw-legal-hero h1,
[dir="rtl"] .aw-legal-effective,
[dir="rtl"] .aw-legal-section h2,
[dir="rtl"] .aw-legal-table thead th,
[dir="rtl"] .aw-legal-last-updated {
  letter-spacing: 0;
}

[dir="rtl"] .aw-legal-related a::after {
  content: "\2190";
}

.aw-legal-ltr {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
}

html.light .aw-legal-hero {
  background:
    radial-gradient(circle at 82% 18%, hsl(var(--primary) / 0.12), transparent 30%),
    hsl(var(--card) / 0.4);
}

html.light .aw-legal-hero::before {
  opacity: 0.78;
}

html.light .aw-legal-table-wrap {
  background: hsl(var(--card) / 0.64);
}

@media (max-width: 900px) {
  .aw-legal-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .aw-legal-section h2 {
    position: static;
    max-width: 26ch;
  }
}

@media (max-width: 600px) {
  .aw-legal-hero-inner,
  .aw-legal-document {
    padding-inline: var(--aw-legal-gutter);
  }

  .aw-legal-hero-inner {
    padding-block: 38px 42px;
  }

  .aw-legal-hero::before {
    background-size: 30px 30px;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 94%, transparent);
  }

  .aw-legal-hero::after {
    inset-inline-start: 16px;
  }

  .aw-legal-hero h1 {
    font-size: clamp(38px, 13vw, 54px);
  }

  .aw-legal-effective {
    margin-block-start: 18px;
  }

  .aw-legal-lede {
    margin-block-start: 18px;
    font-size: 15px;
    line-height: 1.68;
  }

  .aw-legal-related {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-block-start: 24px;
  }

  .aw-legal-related a {
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
  }

  .aw-legal-document {
    padding-block: 16px 72px;
  }

  .aw-legal-section {
    gap: 14px;
    padding-block: 32px;
  }

  .aw-legal-section-body {
    font-size: 15px;
    line-height: 1.72;
  }

  .aw-legal-table-wrap {
    margin-inline-end: 0;
    border-radius: var(--radius-sm);
  }

  .aw-legal-table {
    min-width: 640px;
    font-size: 13px;
  }

  .aw-legal-table thead th,
  .aw-legal-table tbody th,
  .aw-legal-table tbody td {
    padding: 11px 12px;
  }
}

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