/* =========================================================================
   ZynNFT — the standalone legal documents.

   `privacy.html` and `terms.html` are their own pages rather than an overlay
   inside the app, because Pi's App Checklist asks for a URL for each and an
   overlay has none. They link `styles.css` for the tokens and the base type,
   then this file for the document layout, so a legal page and the app still
   look like the same product.

   Nothing here is read by the app itself: `index.html` links this file only to
   keep the repo's rule true that the stylesheet list and the page's `<link>`
   tags are the same list. The rules are scoped to `legal-*`, so they cannot
   reach anything the app draws.
   ========================================================================= */

/* `styles.css` pins html/body to the viewport height, which is right for an
   app shell that scrolls its own panes and wrong for a document that should
   scroll as one. Undo it here rather than changing the app. */
html,
body {
  height: auto;
  min-height: 100%;
}

.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.legal-back {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 22px;
}

.legal-back:hover {
  text-decoration: underline;
}

.legal-wrap h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}

.legal-meta {
  color: var(--label-2);
  font-size: 13px;
  margin: 0 0 4px;
}

.legal-lead {
  font-size: 17px !important;
  color: var(--label-2) !important;
  margin-top: 18px !important;
}

.legal-wrap h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--separator);
}

.legal-wrap h3 {
  font-size: 15.5px;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.legal-wrap p,
.legal-wrap li {
  font-size: 15.5px;
  line-height: 1.62;
}

.legal-wrap p {
  margin: 0 0 14px;
}

.legal-wrap ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal-wrap li {
  margin: 0 0 9px;
}

.legal-wrap a {
  color: var(--accent);
}

.legal-wrap code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  background: var(--fill);
  border-radius: 6px;
  padding: 1px 5px;
}

/* One collected thing: a heading, where it came from, and why it is kept. */
.legal-item {
  padding: 14px 0 2px;
  border-top: 1px solid var(--separator);
}

.legal-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.legal-where {
  color: var(--label-2);
  font-size: 14px;
  margin: 0 0 8px;
}

/* A field only the operator can fill in. Deliberately loud: a legal page that
   quietly invents a contact address or a governing law is worse than one that
   says the field is empty. */
.legal-todo {
  background: rgba(255, 149, 0, 0.12);
  border: 1px solid rgba(255, 149, 0, 0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 16px;
}

.legal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  font-size: 14px;
}

.legal-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.legal-foot a:hover {
  text-decoration: underline;
}

.legal-foot span {
  color: var(--label-3);
}

@media (max-width: 420px) {
  .legal-wrap {
    padding: 20px 16px 56px;
  }

  .legal-wrap h1 {
    font-size: 27px;
  }

  .legal-wrap p,
  .legal-wrap li {
    font-size: 15px;
  }
}

/* ------------------------------------------------------------------- عربي
   The Arabic copies live in `web/ar/` and put `dir="rtl"` and `lang="ar"` on
   `<html>`. The app already has an RTL convention (`dirAttr()` in
   `web/i18n.js`, the `[dir="rtl"]` rules in `components.css` and
   `create.css`), so this follows it instead of inventing a second one.

   Only two rules below are physical rather than logical: the list bullet sits
   on the left, and `styles.css` puts a Latin face first in the body stack.
   Both flip here. The rest of this file is centred or direction-agnostic. */
[dir="rtl"] .legal-wrap {
  text-align: right;
}

[dir="rtl"] .legal-wrap ul {
  padding-left: 0;
  padding-right: 20px;
}

/* Arabic sits on a deeper baseline than Latin and carries its vocalisation
   above and below it, so 1.62 reads cramped. */
[dir="rtl"] .legal-wrap p,
[dir="rtl"] .legal-wrap li {
  line-height: 1.85;
}

[dir="rtl"] .legal-wrap h1,
[dir="rtl"] .legal-wrap h2,
[dir="rtl"] .legal-wrap h3 {
  letter-spacing: 0;
}
